diff --git a/.dockerignore b/.dockerignore index 782f39c..e3e1c93 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,3 @@ -build.sh Dockerfile .git .idea diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..4434862 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,51 @@ +kind: pipeline +type: docker +name: staging + +trigger: + branches: + - master + event: + - push + +steps: + - name: test + image: golang:1.13.5 + commands: + - go test ./... + + - name: build + image: plugins/docker + settings: + username: + from_secret: dockerlogin + password: + from_secret: dockerpassword + repo: llehouerou/zbbot + tags: latest + +--- +kind: pipeline +type: ssh +name: deploy + +server: + host: + from_secret: host + user: + from_secret: username + ssh_key: + from_secret: ssh_key + +clone: + disable: true + +steps: + - name: deploy + commands: + - cd /home/laurent/docker/ + - docker-compose pull dnsupdater + - docker-compose up -d dnsupdater + +depends_on: + - staging \ No newline at end of file diff --git a/build.sh b/build.sh deleted file mode 100644 index 2825884..0000000 --- a/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -docker build --rm -t llehouerou/dnsupdater:latest . -rc=$? -if [[ ${rc} == 0 ]]; then - docker push llehouerou/dnsupdater - ssh srv03 'docker pull llehouerou/dnsupdater; cd docker/conf/goservices; docker-compose up -d --remove-orphans' -fi \ No newline at end of file