forked from the-benchmarker/web-frameworks
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yaml
93 lines (76 loc) · 3.3 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
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
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}}} . && cd -
metadata:
- docker run -p 3000:3000 -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
docker-machine:
build:
- cd {{{language}}}/{{{framework}}} && docker build -f {{{manifest}}} -t {{{language}}}.{{{framework}}}.{{{variant}}} .&& cd -
metadata:
- docker run -p 3000:3000 -td {{{language}}}.{{{framework}}}.{{{variant}}}
- echo 127.0.0.1 > {{{language}}}/{{{framework}}}/ip-{{{variant}}}.txt
clean:
- docker ps -a -q --filter ancestor={{{language}}}.{{{framework}}}.{{{variant}}} | xargs docker
rm -f
docker-desktop:
build:
- cd {{{language}}}/{{{framework}}} && docker build -f {{{manifest}}} -t {{{language}}}.{{{framework}}}.{{{variant}}} .&& cd -
metadata:
- docker run -p 3000:3000 -td {{{language}}}.{{{framework}}}.{{{variant}}}
- sleep 5
- echo '127.0.0.1' > {{{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