-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathauto-ci.yml
22 lines (19 loc) · 868 Bytes
/
auto-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# This example is another simplified playbook. It runs by CI on every commit and deploy to the dev environment.
# The command is just `spot -p auto-ci.yml`.
# Git clone and pull are used to sync the project code. Docker-compose is used to build and run the project.
user: app
targets: [server-dev1.example.com:22, server-dev2.example.com:22]
task:
- name: git checkout
script: git clone git@github.com/my-project/docker.git /srv/my-project
cond: "[ ! -d /srv/my-project/.git ]" # run clone only if the .git directory does not exist
- name: git pull/update
script: |
cd /srv/my-project
git pull
- name: pull docker image and restart
script: |
cd /srv/my-project
docker-compose -f /srv/my-project/dev.yml pull my-service
docker-compose -f /srv/my-project/dev.yml up -d my-service
env: {MHOST: $SPOT_REMOTE_NAME}