forked from werf/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwerf.yaml
169 lines (166 loc) · 3.98 KB
/
werf.yaml
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
configVersion: 1
project: werf-site
---
image: jekyll_base
fromCacheVersion: "1"
from: jekyll/builder:4
git:
- add: /
to: /app
owner: jekyll
group: jekyll
includePaths:
- Gemfile
- Gemfile.lock
stageDependencies:
setup: ["**/*"]
shell:
setup:
- cd /app
- bundle install
---
image : common_artifacts
from: ubuntu
ansible:
install:
- file:
path: "/artifacts"
state: directory
mode: 0777
- name: "releases.json"
copy:
content: |
{{ .Files.Get ".werf/artifacts/releases.json" | indent 8 }}
dest: /artifacts/releases.json
- name: "Strip escaping sequence from releases.json"
shell: |
sed -i 's#{% raw %}\ *##; s#{% endraw %}##' /artifacts/releases.json
args:
executable: /bin/bash
warn: false
- name: "releases_history.json"
copy:
content: |
{{ .Files.Get ".werf/artifacts/releases_history.json" | indent 8 }}
dest: /artifacts/releases_history.json
- name: "channels_versions.json"
copy:
content: |
{{ .Files.Get ".werf/artifacts/channels_versions.json" | indent 8 }}
dest: /artifacts/channels_versions.json
- name: "feeds.base64"
copy:
content: |
{{ .Files.Get ".werf/artifacts/feeds.tgz.base64" | indent 8 }}
dest: /artifacts/feeds.tgz.base64
- name: "unpack RSS feeds"
shell: |
if [ -f feeds.tgz.base64 ] ; then base64 -d feeds.tgz.base64 > feeds.tgz; tar -xzf feeds.tgz --transform='s/feeds/./' --wildcards '*.xml'; else echo "RSS feeds file feeds.tgz is absent!"; exit 1 ; fi
rm feeds.tgz.base64
rm feeds.tgz
args:
executable: /bin/bash
warn: false
chdir: /artifacts
---
{{- range $lang := list "en" "ru" }}
image: doc_{{ $lang }}
fromImage: jekyll_base
import:
- image: common_artifacts
add: /artifacts
to: /artifacts
before: setup
git:
- add: /
to: /app
owner: jekyll
group: jekyll
includePaths:
- _data
- _includes
- _layouts
- _plugins
- assets
- examples
- pages_{{ $lang }}
- ssi
- _config.yml
- _config_dev.yml
- _config_{{ $lang }}.yml
- "*.xml"
- "*.sh"
- "*.asc"
- "*.png"
- "*.svg"
- favicon.ico
- robots.txt
stageDependencies:
setup: ["**/*"]
shell:
setup:
- cd /app
- set -u
- mkdir -m 0777 -p /app/_site
- cp -f /artifacts/*.json /app/_data/_common/
- cp -f /artifacts/pages_{{ $lang }}/* /app/pages_{{ $lang }}/
- export JEKYLL_ENV="{{ $.Env }}"
{{- if eq $.Env "development" }}
- bundle exec jekyll build -tV --config _config.yml,_config_dev.yml,_config_{{ $lang }}.yml --destination _site/
{{- else }}
- bundle exec jekyll build --config _config.yml,_config_{{ $lang }}.yml --destination _site/
{{- end }}
---
{{ end -}}
image: web-backend-artifact
from: golang:1.16
fromCacheVersion: 20210318
ansible:
install:
- name: Build apis
shell: |
go get -d -v ./
go build -ldflags "-w -s" -v -o /go/src/app/server /go/src/app/
args:
executable: /bin/bash
chdir: /go/src/app
git:
- add: /backend
to: /go/src/app
stageDependencies:
install: '**/*'
---
image: web-backend
docker:
WORKDIR: /app
from: ubuntu:20.04
ansible:
install:
- apt:
name: ['git','curl', 'jq', 'vim']
state: present
update_cache: yes
import:
- image: web-backend-artifact
add: /go/src/app/server
to: /app/server
before: setup
{{- range $lang := list "en" "ru" }}
- image: doc_{{ $lang }}
add: /app/_site
to: /app/root/{{ $lang }}
after: setup
{{ end -}}
---
image: tuf-router
from: fabiocicerchia/nginx-lua:1.21-alpine@sha256:525aa8fd0ac9bf5c7e82cd83b3f8ebf620bedb0d0b1e52955745fd53917eb24c
ansible:
install:
- copy:
content: |
{{ .Files.Get ".werf/nginx-tuf-router.conf" | indent 8 }}
dest: /etc/nginx/nginx.conf
- copy:
content: |
{{ .Files.Get ".werf/tuf-router.lua" | indent 8 }}
dest: /etc/nginx/tuf-router.lua