You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Makefile
+2-10Lines changed: 2 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -40,17 +40,9 @@ test:
40
40
41
41
# AUTOMATIC TAG
42
42
sdk-tag-services:
43
-
@if [ "${password}"="" ];then\
44
-
go run $(SCRIPTS_BASE)/automatic_tag.go --update-type ${update-type} --ssh-private-key-file-path ${ssh-private-key-file-path}; \
45
-
else \
46
-
go run $(SCRIPTS_BASE)/automatic_tag.go --update-type ${update-type} --ssh-private-key-file-path ${ssh-private-key-file-path} --password ${password}; \
47
-
fi
43
+
@go run $(SCRIPTS_BASE)/automatic_tag.go --update-type ${update-type} --ssh-private-key-file-path ${ssh-private-key-file-path};
48
44
49
45
50
46
sdk-tag-core:
51
-
@if [ "${password}"="" ];then\
52
-
go run $(SCRIPTS_BASE)/automatic_tag.go --update-type ${update-type} --ssh-private-key-file-path ${ssh-private-key-file-path} --target core; \
53
-
else \
54
-
go run $(SCRIPTS_BASE)/automatic_tag.go --update-type ${update-type} --ssh-private-key-file-path ${ssh-private-key-file-path} --target core --password ${password}; \
55
-
fi
47
+
@go run $(SCRIPTS_BASE)/automatic_tag.go --update-type ${update-type} --ssh-private-key-file-path ${ssh-private-key-file-path} --target core;
usage="go run automatic_tag.go --update-type [minor|patch] --ssh-private-key-file-path path/to/private-key --target [all-services|core]"
35
36
)
36
37
37
38
funcmain() {
@@ -44,12 +45,10 @@ func main() {
44
45
funcrun() error {
45
46
varupdateTypestring
46
47
varsshPrivateKeyFilePathstring
47
-
varpasswordstring
48
48
vartargetstring
49
49
50
50
flag.StringVar(&updateType, updateTypeFlag, "", fmt.Sprintf("Update type, must be one of: %s (required)", strings.Join(updateTypes, ",")))
51
51
flag.StringVar(&sshPrivateKeyFilePath, sshPrivateKeyFilePathFlag, "", "Path to the ssh private key (required)")
52
-
flag.StringVar(&password, passwordFlag, "", "Password of the ssh private key (optional)")
53
52
flag.StringVar(&target, targetFlag, allServices, fmt.Sprintf("Create tags for this target, must be one of %s (optional, default is %s)", strings.Join(targets, ","), allServices))
54
53
55
54
flag.Parse()
@@ -81,13 +80,31 @@ func run() error {
81
80
returnfmt.Errorf("the provided private key file path %s is not valid: %w\nUsage: %s", sshPrivateKeyFilePath, err, usage)
82
81
}
83
82
83
+
password, err:=promptForPassword()
84
+
iferr!=nil {
85
+
returnfmt.Errorf("prompt for password: %s", err.Error())
// automaticTagUpdate goes through all of the existing tags, gets the latest for the target, creates a new one according to the updateType and pushes them
0 commit comments