docker总结

jenkins中创建pipeline,在配置中的流水线添加以下脚本

 

 

 

pipeline{

    agent any

    stages{

        stage('build the image'){

            steps{

                bat '''cd E:/dingding/docker/app/app/

                E:

                mvn clean package  -Dmaven.test.skip=true   docker:build'''

            }

        }

        stage('run the container'){

            steps{

                bat '''cd E:/dingding/docker/app/app/src/main/docker/

                E:

                docker-compose up -d '''

            }

        }

    }

}

 

可添加脚本来进行测自动化测试

stage('api test'){

            steps{

                echo "api test"

            }

        }

 

 

 

也可直接输出代码来实现输出

pipeline{        

    agent any

    stages{

        stage("what"){

            steps{

                echo "what"

            }

        }

        

    }

}

 

 

 

 

 

 

 

上传到服务器执行程序或者测试的时候需要有相对应的环境,直接在服务器上搭建环境即可

 

 

 

posted @ 2022-08-15 17:37  丶空·  阅读(23)  评论(0)    收藏  举报