pipeline {agent anystages {stage('Check out') {steps {checkout([$class: 'GitSCM', branches: [[name: env.GIT_BUILD_REF]],userRemoteConfigs: [[url: env.GIT_REPO_URL, credentialsId: env.CREDENTIALS_ID]]])}}stage('Compile') {steps {// Convert markdown to HTML// sh 'pip install mkdocs && mkdocs build'// React/VUE SPA generate HTML// sh 'npm run build'// Create Android package// sh './gradlew assembleDebug'}}stage('Upload to Tencent Cloud COS') {steps {sh "coscmd config -a ${env.COS_SECRET_ID} -s ${env.COS_SECRET_KEY}" +" -b ${env.COS_BUCKET_NAME} -r ${env.COS_BUCKET_REGION}"sh "rm -rf .git"sh 'coscmd upload -r ./ /'//sh 'coscmd upload -r ./dist /'}}}}
Variable | Description | Example |
COS_SECRET_ID | Key ID for accessing Tencent Cloud | stringLength36stringLength36string36 |
COS_SECRET_KEY | Secret key for accessing Tencent Cloud | stringLength32stringLength323232 |
COS_BUCKET_NAME | Tencent Cloud COS bucket | devops-host-1257110097 |
COS_BUCKET_REGION | Tencent Cloud COS region | ap-nanjing |
Was this page helpful?