forked from the-benchmarker/web-frameworks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yaml
80 lines (66 loc) · 2.45 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
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:
- docker build -f {{{manifest}}} -t {{{language}}}.{{{framework}}} .
metadata:
- docker run -p 3000:3000 -td {{{language}}}.{{{framework}}} > cid.txt
- docker inspect `cat cid.txt` | jq -r '.[0].NetworkSettings.IPAddress' > ip.txt
clean:
- docker ps -a -q --filter ancestor={{{language}}}.{{{framework}}} | xargs docker
rm -f
docker-machine:
build:
- docker build -f {{{manifest}}} -t {{{language}}}.{{{framework}}} .
metadata:
- docker run -p 3000:3000 -td {{{language}}}.{{{framework}}} > cid.txt
- echo 127.0.0.1 > ip.txt
clean:
- docker ps -a -q --filter ancestor={{{language}}}.{{{framework}}} | 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.txt
- rake cloud:wait LANG={{{language}}} FRAMEWORK={{{framework}}} HOST=`cat ip.txt`
SSH_KEY={{{DO_KEY}}}
- rake cloud:upload LANG={{{language}}} FRAMEWORK={{{framework}}} HOST=`cat ip.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