| @@ -1,90 +0,0 @@ | |||
| version: 2 | |||
| name: pcm-ac-rpc | |||
| description: "" | |||
| global: | |||
| concurrent: 1 | |||
| cache: pcm_ac_rpc_cache | |||
| trigger: | |||
| webhook: gitlink@1.0.0 | |||
| event: | |||
| - ref: push | |||
| ruleset: | |||
| - param-ref: branch | |||
| operator: EQ | |||
| value: '"2.0"' | |||
| ruleset-operator: AND | |||
| workflow: | |||
| - ref: start | |||
| name: 开始 | |||
| task: start | |||
| - ref: git_clone_0 | |||
| name: git clone | |||
| task: git_clone@1.2.6 | |||
| input: | |||
| remote_url: '"https://gitlink.org.cn/JCCE/PCM.git"' | |||
| ref: '"refs/heads/2.0"' | |||
| commit_id: '""' | |||
| depth: 1 | |||
| needs: | |||
| - start | |||
| - ref: shell_0 | |||
| name: 打包 | |||
| image: docker.jianmuhub.com/library/alpine:3.17.0 | |||
| cache: | |||
| pcm_ac_rpc_cache: /root/go | |||
| env: | |||
| CODE_PATH: git_clone_0.git_path | |||
| IMAGE_TAG: git_clone_0.commit_id | |||
| REGISTER_URL: ((dev.registryUrl)) | |||
| IMAGE_ENDPOINT: '"jcce/pcm-ac-rpc"' | |||
| script: | |||
| - apk add --update --no-cache go docker docker-compose | |||
| - "" | |||
| - export GOPATH=/root/go | |||
| - export PATH=${GOPATH}/bin:/usr/local/go/bin:$PATH | |||
| - export GOBIN=$GOROOT/bin | |||
| - mkdir -p ${GOPATH}/src ${GOPATH}/bin | |||
| - export GO111MODULE=on | |||
| - "" | |||
| - go version | |||
| - "" | |||
| - "docker version " | |||
| - "" | |||
| - cd ${CODE_PATH} | |||
| - "" | |||
| - cd adaptor/PCM-HPC/PCM-AC/rpc | |||
| - "" | |||
| - export GOPROXY=https://goproxy.cn | |||
| - "" | |||
| - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o pcm-ac-rpc ./hpcac.go | |||
| - "" | |||
| - echo ${REGISTER_URL} | |||
| - "" | |||
| - docker login ${REGISTER_URL} -u jcce@1877781286485167 -p jcce@nudt | |||
| - docker build -t ${REGISTER_URL}/${IMAGE_ENDPOINT}:${IMAGE_TAG} . | |||
| - docker push ${REGISTER_URL}/${IMAGE_ENDPOINT}:${IMAGE_TAG} | |||
| - docker rmi -f ${REGISTER_URL}/${IMAGE_ENDPOINT}:${IMAGE_TAG} | |||
| needs: | |||
| - git_clone_0 | |||
| - ref: docker_buildx_build_0 | |||
| name: docker buildx构建镜像 | |||
| task: docker_buildx_build@1.0.1 | |||
| input: | |||
| dockerfile: git_clone_0.git_path/ | |||
| context: '""' | |||
| image: '""' | |||
| platform: '""' | |||
| registry_url: '"https://index.docker.io/v1/"' | |||
| build_args: '""' | |||
| tls_servername: '""' | |||
| tls_cacert: '""' | |||
| tls_cert: '""' | |||
| tls_key: '""' | |||
| needs: | |||
| - shell_0 | |||
| - ref: end | |||
| name: 结束 | |||
| task: end | |||
| needs: | |||
| - docker_buildx_build_0 | |||