diff --git a/.drone.yml b/.drone.yml index bfaff3d..424b104 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,7 +12,8 @@ pipeline: commands: - export GO111MODULE=on - export GOPROXY=https://goproxy.cn,direct - - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server.app + # - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server.app + - make build docker-dev: image: plugins/docker @@ -21,61 +22,26 @@ pipeline: use_cache: true dockerfile: Dockerfile secrets: [ docker_username, docker_password ] - tags: latest + tags: notify-service when: branch: develop - docker-uat: - image: plugins/docker - repo: registry.cn-shenzhen.aliyuncs.com/ax-stor/ax-bkb-seller - registry: registry.cn-shenzhen.aliyuncs.com - use_cache: true - dockerfile: Dockerfile - secrets: [ docker_username, docker_password ] - tags: latest - when: - branch: uat - - docker-prod: - image: plugins/docker - repo: registry.cn-shenzhen.aliyuncs.com/ax-stor/ax-bkb-seller - registry: registry.cn-shenzhen.aliyuncs.com - use_cache: true - dockerfile: Dockerfile - secrets: [ docker_username, docker_password ] - tags: v1.0.0 - when: - branch: master - # deploy: - # image: helm:v2.8.1 + # deploy-dev: + # image: roffe/kubectl # commands: - # - mkdir -p /root/.kube && cp -r .kube/config /root/.kube - # - helm delete drone-go-demo --purge || true - # - helm install --name drone-go-demo --set image.tag=${DRONE_TAG=latest} Chart - + # - rm -rf /root/.kube && cp -r .kube /root + # - kubectl delete -f deployDev.yaml || true + # - kubectl apply -f deployDev.yaml + # when: + # branch: develop deploy-dev: - image: roffe/kubectl - commands: - - rm -rf /root/.kube && cp -r .kube /root - - kubectl delete -f deployDev.yaml || true - - kubectl apply -f deployDev.yaml - when: - branch: develop - - deploy-uat: - image: roffe/kubectl - commands: - - rm -rf /root/.kube && cp -r .kube /root - - kubectl delete -f deployUat.yaml || true - - kubectl apply -f deployUat.yaml - when: - branch: uat - - deploy-prod: - image: roffe/kubectl - commands: - - rm -rf /root/.kube && cp -r .kube /root - # - kubectl delete -f deployment.yaml || true - - kubectl apply -f deployment.yaml --record - when: - branch: master \ No newline at end of file + image: appleboy/drone-ssh + host: 1.92.109.79 + username: root + password: VGuHeBaomhg#fi#Z8^SX@ + port: 22 # 可选,指定 SSH 端口,默认为 22 + script: + - docker pull registry.cn-shenzhen.aliyuncs.com/ax-stor/ax-bkb-seller:notify-service + - docker run -d registry.cn-shenzhen.aliyuncs.com/ax-stor/ax-bkb-seller:notify-service + when: + branch: develop \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..609df07 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM registry.cn-shanghai.aliyuncs.com/lj-go/alpine +LABEL MAINTAINER="template" + +WORKDIR /go/src/show +COPY . /go/src/show +RUN ls +EXPOSE 8001 +ENTRYPOINT ./bin/server \ No newline at end of file