-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuddy.yml
86 lines (86 loc) · 3.59 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
- pipeline: "Deploy"
on: "EVENT"
events:
- type: "PUSH"
refs:
- "refs/heads/main"
priority: "NORMAL"
fail_on_prepare_env_warning: true
target_site_url: "https://live-reaction.skillbill.net"
actions:
- action: "[SERVER] Build Docker image"
type: "DOCKERFILE"
login: "${DOCKER_HUB_USER}"
password: "${DOCKER_HUB_PASSWORD}"
docker_image_tag: "latest"
dockerfile_path: "api/Dockerfile"
context_path: "api/"
repository: "skillbillsrl/hackaton-20210528-api"
build_args:
- "version=${BUDDY_EXECUTION_REVISION}"
trigger_condition_paths:
- "/api"
trigger_condition: "ON_CHANGE_AT_PATH"
- action: "[FRONTEND] Build Docker image"
type: "DOCKERFILE"
login: "${DOCKER_HUB_USER}"
password: "${DOCKER_HUB_PASSWORD}"
docker_image_tag: "latest"
dockerfile_path: "frontend/Dockerfile"
context_path: "frontend/"
repository: "skillbillsrl/hackaton-20210528-frontend"
build_args:
- "version=${BUDDY_EXECUTION_REVISION}"
trigger_condition_paths:
- "/frontend"
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: "${TEST_SERVER_NAME}"
port: "22"
env_key: "test_rsa"
authentication_mode: "ENV_KEY"
- action: "docker-compose restart"
type: "SSH_COMMAND"
working_directory: "${WORKDIR}"
login: "root"
host: "${TEST_SERVER_NAME}"
port: "22"
env_key: "test_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"
- action: "Send CD notification"
type: "SLACK"
content: "[#$BUDDY_EXECUTION_ID] $BUDDY_PIPELINE_NAME execution\r\n"
channel: "C0TNK5J4T"
channel_name: "continuous-delivery"
attachments:
- "{\"fallback\":\"$BUDDY_PIPELINE_NAME execution #$BUDDY_EXECUTION_ID\",\"color\":\"good\",\"fields\":[{\"title\":\"Successful execution\",\"value\":\"<$BUDDY_EXECUTION_URL|Execution #$BUDDY_EXECUTION_ID $BUDDY_EXECUTION_COMMENT>\",\"short\":true},{\"title\":\"Pipeline\",\"value\":\"<$BUDDY_PIPELINE_URL|$BUDDY_PIPELINE_NAME>\",\"short\":true},{\"title\":\"Branch\",\"value\":\"$BUDDY_EXECUTION_BRANCH\",\"short\":true},{\"title\":\"Project\",\"value\":\"<$BUDDY_PROJECT_URL|$BUDDY_PROJECT_NAME>\",\"short\":true}]}"
trigger_condition: "ALWAYS"
integration_hash: "secure!hsfeY1zmx5OWr28nxVEllrt2roWyLHzQJEyL2WfMO3U=.WxCZ9vMWN35cljvC67xGWA=="
- action: "Send CD notification ON FAILuRE"
type: "SLACK"
trigger_time: "ON_FAILURE"
content: "[#$BUDDY_EXECUTION_ID] $BUDDY_PIPELINE_NAME "
blocks: "[{\"type\":\"section\",\"fields\":[{\"type\":\"mrkdwn\",\"text\":\"*Failed execution:* <$BUDDY_EXECUTION_URL|Execution #$BUDDY_EXECUTION_ID $BUDDY_EXECUTION_COMMENT>\"},{\"type\":\"mrkdwn\",\"text\":\"*Pipeline:* <$BUDDY_PIPELINE_URL|$BUDDY_PIPELINE_NAME>\"},{\"type\":\"mrkdwn\",\"text\":\"*Branch:* $BUDDY_EXECUTION_BRANCH\"},{\"type\":\"mrkdwn\",\"text\":\"*Project:* <$BUDDY_PROJECT_URL|$BUDDY_PROJECT_NAME>\"}]}]"
channel: "C0TNK5J4T"
channel_name: "continuous-delivery"
trigger_condition: "ALWAYS"
integration_hash: "secure!hsfeY1zmx5OWr28nxVEllrt2roWyLHzQJEyL2WfMO3U=.WxCZ9vMWN35cljvC67xGWA=="