-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuddy.yml
64 lines (64 loc) · 1.88 KB
/
buddy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
- pipeline: "Deploy"
trigger_mode: "ON_EVERY_PUSH"
ref_name: "master"
ref_type: "BRANCH"
target_site_url: "http://legolize.skillbill.net"
actions:
- action: "[API] Build Docker image"
type: "DOCKERFILE"
login: "${DOCKER_HUB_USER}"
password: "${DOCKER_HUB_PASSWORD}"
docker_image_tag: "latest"
dockerfile_path: "application/Dockerfile"
context_path: "application/"
repository: "skillbillsrl/legolize-api"
build_args:
- "version=${BUDDY_EXECUTION_REVISION}"
trigger_condition_paths:
- "/application"
trigger_condition: "ON_CHANGE_AT_PATH"
- action: "[FE] Build Docker image"
type: "DOCKERFILE"
login: "${DOCKER_HUB_USER}"
password: "${DOCKER_HUB_PASSWORD}"
docker_image_tag: "latest"
dockerfile_path: "fe/Dockerfile"
context_path: "fe/"
repository: "skillbillsrl/legolize-fe"
build_args:
- "version=${BUDDY_EXECUTION_REVISION}"
trigger_condition_paths:
- "/fe"
trigger_condition: "ON_CHANGE_AT_PATH"
- action: "update docker-compose"
type: "SFTP"
input_type: "SCM_REPOSITORY"
local_path: "docker-compose.yml"
remote_path: "${WORKDIR}"
login: "root"
host: "${SERVER_NAME}"
port: "22"
env_key: "prod_rsa"
authentication_mode: "ENV_KEY"
- action: "docker-compose restart"
type: "SSH_COMMAND"
working_directory: "${WORKDIR}"
login: "root"
host: "${SERVER_NAME}"
port: "22"
env_key: "prod_rsa"
authentication_mode: "ENV_KEY"
commands:
- "set -e"
- "echo \"$DOCKER_HUB_PASSWORD\" | \\"
- "\tdocker login -u \"$DOCKER_HUB_USER\" --password-stdin"
- "trap 'docker logout' 0"
- "export TAG=latest"
- "docker-compose pull"
- "docker-compose down --remove-orphans"
- "docker-compose up -d"
- "docker image prune -a"
- "docker volume prune"
run_as_script: true
shell: "BASH"
trigger_condition: "ALWAYS"