@@ -16,45 +16,23 @@ var envCmd = &cobra.Command{
1616 Long : heredoc .Doc (`
1717 Check docker and docker-compose installation on Linux and Mac. If docker and docker-compose are not installed, this command will install them for you.
1818
19- For Mac: brew install --cask docker
20-
21- For Linux: sh get-docker.sh
19+ The tools/docker/docker_env/check-install-docker.sh script will be used to check and install docker and docker-compose.
2220 ` ),
2321 Example : heredoc .Doc (`
2422 # Check and install docker and docker-compose (for Linux and Mac)
2523 $ ./trond docker install-docker
2624 ` ),
2725 Run : func (cmd * cobra.Command , args []string ) {
28-
29- if yes , err := utils .IsJDK1_8 (); err != nil || ! yes {
30- fmt .Println ("Error: JDK version should be 1.8" )
31- return
32- }
33-
34- // Get the flag value
35- org , _ := cmd .Flags ().GetString ("org" )
36- artifact , _ := cmd .Flags ().GetString ("artifact" )
37- version , _ := cmd .Flags ().GetString ("version" )
38-
39- fmt .Println ("The building progress may take a long time, depending on your network speed." )
40- fmt .Println ("If you don't specify the flags for building, the default values will be used." )
41- fmt .Println ("The default result will be: tronprotocol/java-tron:latest" )
42- fmt .Println ("Start building..." )
4326 cmds := []string {
44- fmt . Sprintf ( "./gradlew --no-daemon sourceDocker -PdockerOrgName=%s -PdockerArtifactName=%s -Prelease.releaseVersion=%s" , org , artifact , version ) ,
27+ "./check-install-docker.sh" ,
4528 }
46- if err := utils .RunMultipleCommands (strings .Join (cmds , " && " ), "./tools/gradlew " ); err != nil {
29+ if err := utils .RunMultipleCommands (strings .Join (cmds , " && " ), "./tools/docker/docker_env " ); err != nil {
4730 fmt .Println ("Error: " , err )
4831 return
4932 }
5033 },
5134}
5235
5336func init () {
54-
55- envCmd .Flags ().StringP ("org" , "o" , "tronprotocol" , "OrgName for the docker image" )
56- envCmd .Flags ().StringP ("artifact" , "a" , "java-tron" , "ArtifactName for the docker image" )
57- envCmd .Flags ().StringP ("version" , "v" , "latest" , "Release version for the docker image" )
58-
5937 DockerCmd .AddCommand (envCmd )
6038}
0 commit comments