forked from the-benchmarker/web-frameworks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yaml
68 lines (57 loc) · 2.43 KB
/
config.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
cloud:
config:
package_update: true
runcmd:
- systemctl disable cloud-init
- systemctl enable web
- mkdir -p /opt/web
- find /opt/web -type f -exec chown -R cloudy:cloudy {} \;
users:
- name: cloudy
gecos: Magic Cloud App Daemon User
lock_passwd: true
ssh_redirect_user: true
no_create_home: true
no_log_init: true
service: |
[Unit]
Description=web
After=network.target
[Service]
Type=simple
EnvironmentFile=/etc/web
WorkingDirectory=/opt/web
ExecStart={{{command}}}
User=cloudy
[Install]
WantedBy=multi-user.target
providers:
docker:
build:
- cd {{{language}}}/{{{framework}}} && docker build -f {{{manifest}}} -t {{{language}}}.{{{framework}}}.{{{variant}}} --build-arg ARCHITECTURE={{{architecture}}} --build-arg ARCH={{{arch}}} . && cd -
metadata:
- docker run -td {{{language}}}.{{{framework}}}.{{{variant}}} > {{{language}}}/{{{framework}}}/cid-{{{variant}}}.txt
- docker inspect `cat {{{language}}}/{{{framework}}}/cid-{{{variant}}}.txt` | jq -r '.[0].NetworkSettings.IPAddress' > {{{language}}}/{{{framework}}}/ip-{{{variant}}}.txt
clean:
- docker ps -a -q --filter ancestor={{{language}}}.{{{framework}}}.{{{variant}}} | xargs docker
rm -f
digitalocean:
build:
- rm -fr ~/.ssh/known_hosts
- rake cloud:config LANG={{{language}}} FRAMEWORK={{{framework}}}
- doctl compute droplet create {{{language}}}.{{{framework}}} --region {{{DO_REGION}}}
--image {{{DO_IMAGE}}} --size {{{DO_SIZE}}} --user-data-file user_data.yml --wait
--ssh-keys {{{DO_FINGERPRINT}}} {{{DO_OPTIONS}}}
metadata:
- doctl compute droplet list {{{language}}}.{{{framework}}} --format ID --no-header
> id.txt
- doctl compute droplet list {{{language}}}.{{{framework}}} --format {{{DO_ATTRIBUTE}}}
--no-header > ip-{{{variant}}}.txt
- rake cloud:wait LANG={{{language}}} FRAMEWORK={{{framework}}} HOST=`cat ip-{{{variant}}}.txt`
SSH_KEY={{{DO_KEY}}}
- rake cloud:upload LANG={{{language}}} FRAMEWORK={{{framework}}} HOST=`cat ip-{{{variant}}}.txt`
SSH_KEY={{{DO_KEY}}}
exec: doctl compute ssh {{{language}}}.{{{framework}}} --ssh-key-path {{{DO_KEY}}} --ssh-command "cd /opt/web && {{{command}}}"
reboot: doctl compute droplet-action reboot `cat id.txt`
clean:
- doctl compute droplet delete {{{language}}}.{{{framework}}} --force