Compare commits
2 Commits
8d77819f57
...
b87065b548
Author | SHA1 | Date | |
---|---|---|---|
b87065b548 | |||
d86d54d2ec |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
target*
|
target*
|
||||||
source*
|
source*
|
||||||
|
go-gluon-publish
|
||||||
|
2
main.go
2
main.go
@ -21,7 +21,7 @@ func main() {
|
|||||||
br := *branch
|
br := *branch
|
||||||
version := readVersions(*branch)
|
version := readVersions(*branch)
|
||||||
var source_dir_branch string = sdir + br + "/images/"
|
var source_dir_branch string = sdir + br + "/images/"
|
||||||
var target_dir_branch string = tdir + br + "/images/"
|
var target_dir_branch string = tdir + br + "/"
|
||||||
|
|
||||||
if is_firmware_folder(source_dir_branch) {
|
if is_firmware_folder(source_dir_branch) {
|
||||||
//generate manifest file for branch
|
//generate manifest file for branch
|
||||||
|
19
release.go
19
release.go
@ -19,13 +19,18 @@ func release_branch(b string, sDir string, tDir string, dryrun bool, v string) {
|
|||||||
}
|
}
|
||||||
sVersion := GetGluonVersion(sDir)
|
sVersion := GetGluonVersion(sDir)
|
||||||
tVersion := GetGluonVersion(tDir)
|
tVersion := GetGluonVersion(tDir)
|
||||||
|
fmt.Println("Target Version: ", tVersion)
|
||||||
|
fmt.Println("Source Version: ", sVersion)
|
||||||
|
fmt.Println("Wanted Version: ", v)
|
||||||
//check wanted version in target
|
//check wanted version in target
|
||||||
if tVersion != v {
|
if tVersion == v {
|
||||||
log.Println("published version is outdated, try to update from source folder")
|
log.Println("wanted version is already published!")
|
||||||
if sVersion != v {
|
os.Exit(0)
|
||||||
log.Println("wanted Version is not availible in source folder")
|
}
|
||||||
os.Exit(1)
|
log.Println("published version is outdated, try to update from source folder")
|
||||||
}
|
if sVersion != v {
|
||||||
|
log.Println("wanted Version is not availible in source folder")
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if newImages {
|
if newImages {
|
||||||
@ -76,7 +81,7 @@ func GetGluonVersion(path string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func readVersions(branch string) string {
|
func readVersions(branch string) string {
|
||||||
filePath := "release_state.json"
|
filePath := "/srv/fwuploads-tmp/bin/release_state.json"
|
||||||
v, err := ioutil.ReadFile(filePath)
|
v, err := ioutil.ReadFile(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln("Error reading version JSON file!")
|
log.Fatalln("Error reading version JSON file!")
|
||||||
|
Loading…
Reference in New Issue
Block a user