瀏覽代碼

更新 'Jenkinsfile'

sifu-gogs 2 年之前
父節點
當前提交
30d323de60
共有 1 個文件被更改,包括 7 次插入13 次删除
  1. 7 13
      Jenkinsfile

+ 7 - 13
Jenkinsfile

@@ -5,21 +5,15 @@ pipeline {
     }
     stages {
         stage('Build') {
-            agent {
-                docker {
-                    image 'node:16-alpine'
-                }
-            }
             steps {
-                /* checkout scm */
-                /* echo docker -v  */
-                script {
-                    docker.build("${BRANCH_NAME}:${BUILD_NUMBER}")
+				sh 'docker-compose down'
+                nodejs('16.19.0') {
+                    sh 'npm install yarn -g --registry https://registry.npm.taobao.org'
+                    sh 'yarn config set registry https://registry.npmmirror.com/'
+                    sh 'yarn install'
+                    sh 'yarn build'
                 }
-                /* sh 'docker-compose down' */
-                /* sh 'npm install --registry https://registry.npm.taobao.org' */
-                /* sh 'npm run build:prod' */
-                /* sh 'docker build -t ${BRANCH_NAME}:${BUILD_NUMBER} .' */
+                sh 'docker build -t ${BRANCH_NAME}:${BUILD_NUMBER} .'
             }
         }
         stage('Test') {