move images to archive if stable
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful

This commit is contained in:
Stefan Hoffmann 2023-07-30 20:49:32 +02:00
parent b87065b548
commit 72430a2d8e
Signed by: stefan
GPG Key ID: 8EFC7042BF8D5CDD

View File

@ -35,6 +35,13 @@ func release_branch(b string, sDir string, tDir string, dryrun bool, v string) {
if newImages { if newImages {
// delete old firmware files in public folder // delete old firmware files in public folder
// if we are in stable branch, move images to archive
if b == "stable" {
err := os.Rename(tDir+"/"+b, tDir+"/archive/v")
if err != nil {
log.Fatalln(err)
}
} else {
for _, file := range check_tDir { for _, file := range check_tDir {
if !(dryrun) { if !(dryrun) {
err := os.RemoveAll(tDir + file.Name()) err := os.RemoveAll(tDir + file.Name())
@ -47,6 +54,7 @@ func release_branch(b string, sDir string, tDir string, dryrun bool, v string) {
log.Println("DRYRUN: delete folder :", file.Name()) log.Println("DRYRUN: delete folder :", file.Name())
} }
} }
}
//move new files to folder //move new files to folder
for _, file := range check_sDir { for _, file := range check_sDir {