瀏覽代碼

Merge remote-tracking branch 'origin/red' into red

zhangxin 2 年之前
父節點
當前提交
f215b6d337
共有 3 個文件被更改,包括 9 次插入3 次删除
  1. 3 0
      .gitignore
  2. 4 1
      Jenkinsfile
  3. 2 2
      docker-compose.yml

+ 3 - 0
.gitignore

@@ -45,3 +45,6 @@ nbdist/
 !*/build/*.java
 !*/build/*.html
 !*/build/*.xml
+
+.vscode/
+git

+ 4 - 1
Jenkinsfile

@@ -1,5 +1,8 @@
 pipeline {
     agent any
+    environment {
+        BRANCH_NAME="${env.BRANCH_NAME}".toLowerCase()
+    }
     stages {
         stage('pullCode'){
             steps{
@@ -12,7 +15,7 @@ pipeline {
                 echo 'Building..'
                 sh 'docker-compose down'
                 sh '~/tools/apache-maven-3.6.3/bin/mvn  clean install -Dmaven.test.skip=true'
-                sh 'docker build -t red:${BUILD_NUMBER} .'
+                sh 'docker build -t ${BRANCH_NAME}:${BUILD_NUMBER} .'
             }
         }
         stage('Test') {

+ 2 - 2
docker-compose.yml

@@ -1,6 +1,6 @@
 services:
-  post-project-api-red:
-    image: red:${BUILD_NUMBER}
+  post-project-api:
+    image: ${BRANCH_NAME}:${BUILD_NUMBER}
     ports:
       - 8182:8080
     networks: