diff --git a/.drone.yml b/.drone.yml index c4c24ca..c3dc8bd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,7 +1,95 @@ kind: pipeline -type: docker name: default -- DRONE_GIT_ALWAYS_AUTH=true -- DRONE_GIT_USERNAME=liupeng -- DRONE_GIT_PASSWORD=Newbie76 \ No newline at end of file +clone: + depth: 10 + +steps: +# 开发版 +- name: docker-${DRONE_BRANCH} + image: plugins/docker:18.09 + settings: + username: liupeng + password: + from_secret: DOCKER_PASSWORD + registry: git.daymele.com + repo: git.daymele.com/liupeng/drone + insecure: true + debug: true + dockerfile: Dockerfile + tags: + - canary + when: + branch: + - master + - dev + event: + - push + +# 稳定版 +- name: docker-release + image: plugins/docker:18.09 + settings: + username: liupeng + password: + from_secret: DOCKER_PASSWORD + registry: git.daymele.com + repo: git.daymele.com/liupeng/drone + insecure: true + dockerfile: Dockerfile + tags: + - ${DRONE_TAG} + - latest + when: + event: + - tag + + +- name: deploy-${DRONE_BRANCH} + image: appleboy/drone-ssh + settings: + host: + - dev.daymele.com + username: liup + password: + from_secret: HOST_PASSWORD + port: 22 + command_timeout: 2m + script: + - echo "deploy ssh!" + - name=test-demo + - image=git.daymele.com/liupeng/drone:canary + - echo ${DRONE_BRANCH} + - docker pull $image + - docker rm -f test-demo || true + - docker image prune -f + - docker run --name=$name -d -p 8001:9000 $image + when: + branch: + - master + - dev + event: + - push + + +- name: deploy-release + image: appleboy/drone-ssh + settings: + host: + - dev.daymele.com + username: liuo + password: + from_secret: HOST_PASSWORD + port: 22 + command_timeout: 2m + script: + - echo "deploy ssh!" + - name=demo-test + - image=git.daymele.com/liupeng/drone::latest + - docker pull $image + - docker rm -f test-demo || true + - docker image prune -f + - docker run --name=$name -d -p 8001:9000 $image + when: + event: + - tag diff --git a/Dockerfile b/Dockerfile index 8137639..ddd5928 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,8 +30,8 @@ ADD zoneinfo.tar.gz / # && echo "Asia/Shanghai" > /etc/timezone \ # && apk del tzdata \ # && rm -rf /var/cache/apk/* -ENTRYPOINT ["/adapt","-port","7000","-conf","/conf/daymele.conf"] -EXPOSE 7000 +ENTRYPOINT ["/adapt","-port","9000","-conf","/conf/daymele.conf"] +EXPOSE 9000 # docker image prune 删除悬虚镜像 # docker run --name res -d -p 7000:7011 -v /mnt/resdata:/data dev.daymele.com:5000/res --restart always