drone ci configu*

This commit is contained in:
Laurent Le Houerou 2019-12-17 21:30:52 +04:00
parent 41af5fb5cd
commit 4463eb2783
3 changed files with 51 additions and 9 deletions

View File

@ -1,4 +1,3 @@
build.sh
Dockerfile
.git
.idea

51
.drone.yml Normal file
View File

@ -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

View File

@ -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