forked from repman-io/repman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buddy.yml
212 lines (212 loc) · 6.79 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
- pipeline: "test"
trigger_mode: "ON_EVERY_PUSH"
ref_name: "refs/*"
ref_type: "WILDCARD"
fetch_all_refs: true
trigger_condition: "ALWAYS"
actions:
- action: "Execute: composer tests"
type: "BUILD"
working_directory: "/buddy/repman"
docker_image_name: "library/php"
docker_image_tag: "7.4.1"
execute_commands:
- "composer validate"
- "composer install"
- "rm -rf var/cache"
- "composer reset-db"
- "composer tests"
- "bash <(curl -s https://codecov.io/bash)"
setup_commands:
- "apt-get update && apt-get install -y git zip"
- "curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer"
- ""
- "# php ext pdo_pgsql"
- "apt-get install -y libpq-dev"
- "docker-php-ext-configure pdo_pgsql --with-pdo-pgsql"
- "docker-php-ext-install pdo_pgsql"
- ""
- "# coverage driver"
- "pecl install pcov && docker-php-ext-enable pcov"
- ""
- "# intl"
- "apt-get install -y libicu-dev && \\"
- " docker-php-ext-configure intl && \\"
- " docker-php-ext-install intl"
- ""
- "# zip"
- "apt-get install -y zip unzip libzip-dev"
- "docker-php-ext-configure zip"
- "docker-php-ext-install zip"
- " "
- "echo \"memory_limit=-1\" >> /usr/local/etc/php/conf.d/buddy.ini"
- "git config --global user.email \"[email protected]\""
"git config --global user.name \"buddy.works\""
services:
- type: "POSTGRE_SQL"
version: "11.6-alpine"
connection:
host: "postgres"
port: 5432
user: "main"
password: "main"
db: "main"
volume_mappings:
- "/:/buddy/repman"
trigger_condition: "ALWAYS"
shell: "BASH"
- action: "Run repman/deploy"
type: "RUN_NEXT_PIPELINE"
comment: "Triggered by $BUDDY_PIPELINE_NAME execution #$BUDDY_EXECUTION_ID"
trigger_condition: "VAR_IS"
trigger_variable_value: "master"
trigger_variable_key: "BUDDY_EXECUTION_BRANCH"
revision: "INHERIT"
next_project_name: "repman"
next_pipeline_name: "deploy"
variables:
- key: "DATABASE_URL"
value: "postgresql://main:main@postgres:5432/main?serverVersion=11&charset=utf8"
id: 352921
description: ""
- pipeline: "security"
trigger_mode: "SCHEDULED"
ref_name: "master"
ref_type: "BRANCH"
priority: "NORMAL"
start_date: "2020-02-05T07:00:00Z"
delay: 1440
fetch_all_refs: true
trigger_condition: "ALWAYS"
actions:
- action: "Execute: composer security"
type: "BUILD"
working_directory: "/buddy/repman"
docker_image_name: "library/php"
docker_image_tag: "7.4.1"
execute_commands:
- "/local-php-security-checker"
setup_commands:
- "curl -L https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 --output local-php-security-checker"
- "chmod 0755 local-php-security-checker"
volume_mappings:
- "/:/buddy/repman"
trigger_condition: "ALWAYS"
shell: "BASH"
- action: "Send notification to Telegram"
type: "TELEGRAM"
trigger_time: "ON_FAILURE"
content: "[#$BUDDY_EXECUTION_ID] $BUDDY_PIPELINE_NAME failed execution by [$BUDDY_INVOKER_NAME]($BUDDY_INVOKER_URL)"
parse_mode: "MARKDOWN"
trigger_condition: "ALWAYS"
integration_hash: "5f4f3794fd5a7366872df494"
variables:
- key: "DATABASE_URL"
value: "postgresql://main:main@postgres:5432/main?serverVersion=11&charset=utf8"
- pipeline: "setup"
trigger_mode: "MANUAL"
ref_name: "refs/heads/*"
ref_type: "WILDCARD"
fetch_all_refs: true
trigger_condition: "ALWAYS"
actions:
- action: "Run setup playbook"
type: "BUILD"
working_directory: "/buddy/repman"
docker_image_name: "library/ubuntu"
docker_image_tag: "19.10"
execute_commands:
- "ansible-playbook ansible/setup.yml -i ansible/inventories/$REPMAN_ANSIBLE_INVENTORY"
setup_commands:
- "apt-get update && apt-get -y install ansible ssh python3-distutils"
- "mkdir ~/.ssh && ssh-keyscan 3.136.55.89 >> ~/.ssh/known_hosts"
volume_mappings:
- "/:/buddy/repman"
trigger_condition: "ALWAYS"
shell: "BASH"
- pipeline: "deploy"
trigger_mode: "MANUAL"
ref_name: "master"
ref_type: "BRANCH"
target_site_url: "https://app.repman.io"
fetch_all_refs: true
trigger_condition: "ALWAYS"
actions:
- action: "Run deploy playbook"
type: "BUILD"
working_directory: "/buddy/repman"
docker_image_name: "library/ubuntu"
docker_image_tag: "19.10"
execute_commands:
- "ansible-playbook ansible/deploy.yml -i ansible/inventories/$REPMAN_ANSIBLE_INVENTORY"
setup_commands:
- "apt-get update && apt-get -y install ansible ssh python3-distutils"
- "mkdir ~/.ssh && ssh-keyscan 3.136.55.89 >> ~/.ssh/known_hosts"
volume_mappings:
- "/:/buddy/repman"
trigger_condition: "ALWAYS"
shell: "BASH"
- pipeline: "[master] Build and push Docker image"
trigger_mode: "ON_EVERY_PUSH"
ref_name: "master"
ref_type: "BRANCH"
fetch_all_refs: true
trigger_condition: "ALWAYS"
actions:
- action: "Run repman/test"
type: "RUN_NEXT_PIPELINE"
wait: true
comment: "Triggered by $BUDDY_PIPELINE_NAME execution #$BUDDY_EXECUTION_ID"
trigger_condition: "ALWAYS"
revision: "INHERIT"
next_project_name: "repman"
next_pipeline_name: "test"
- action: "Lint Dockerfile"
type: "DOCKERFILE_LINTER"
local_path: "Dockerfile"
shell_type: "bash"
trigger_condition: "ALWAYS"
ignore_errors: true
- action: "Build Docker image"
type: "DOCKERFILE"
dockerfile_path: "Dockerfile"
trigger_condition: "ALWAYS"
- action: "Push Docker image"
type: "DOCKER_PUSH"
login: "$REPMAN_DOCKER_HUB_LOGIN"
password: "$REPMAN_DOCKER_HUB_PASSWORD"
docker_image_tag: "latest"
repository: "buddy/repman"
trigger_condition: "ALWAYS"
- pipeline: "[tag] Build and push Docker image"
trigger_mode: "ON_EVERY_PUSH"
ref_name: "refs/tags/*"
ref_type: "WILDCARD"
fetch_all_refs: true
trigger_condition: "ALWAYS"
actions:
- action: "Run repman/test"
type: "RUN_NEXT_PIPELINE"
wait: true
comment: "Triggered by $BUDDY_PIPELINE_NAME execution #$BUDDY_EXECUTION_ID"
trigger_condition: "ALWAYS"
revision: "INHERIT"
next_project_name: "repman"
next_pipeline_name: "test"
- action: "Lint Dockerfile"
type: "DOCKERFILE_LINTER"
local_path: "Dockerfile"
shell_type: "bash"
trigger_condition: "ALWAYS"
ignore_errors: true
- action: "Build Docker image"
type: "DOCKERFILE"
dockerfile_path: "Dockerfile"
trigger_condition: "ALWAYS"
- action: "Push Docker image"
type: "DOCKER_PUSH"
login: "$REPMAN_DOCKER_HUB_LOGIN"
password: "$REPMAN_DOCKER_HUB_PASSWORD"
docker_image_tag: "$BUDDY_EXECUTION_TAG"
repository: "buddy/repman"
trigger_condition: "ALWAYS"