pipeline {agent anystages {stage('检出') {steps {checkout([$class: 'GitSCM', branches: [[name: env.GIT_BUILD_REF]],userRemoteConfigs: [[url: env.GIT_REPO_URL, credentialsId: env.CREDENTIALS_ID]]])}}stage('编译') {steps {// Markdown 转成 HTML// sh 'pip install mkdocs && mkdocs build'// React/VUE SPA 生成 HTML// sh 'npm run build'// Android 打包// sh './gradlew assembleDebug'}}stage('上传到腾讯云 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 /'}}}}
变量名 | 含义 | 参考值 |
COS_SECRET_ID | 腾讯云访问密钥 ID | stringLength36stringLength36string36 |
COS_SECRET_KEY | 腾讯云访问密钥 KEY | stringLength32stringLength323232 |
COS_BUCKET_NAME | 腾讯云对象存储桶 | devops-host-1257110097 |
COS_BUCKET_REGION | 腾讯云对象存储区域 | ap-nanjing |
本页内容是否解决了您的问题?