This repository has been archived by the owner on Apr 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
/
Azkfile.js
130 lines (115 loc) · 3.63 KB
/
Azkfile.js
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
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
var mounts = {
"/azk/#{manifest.dir}" : sync('./', { shell: true }),
"/azk/#{manifest.dir}/docs" : path("./docs"),
"/azk/#{manifest.dir}/package" : path("./package"),
"/azk/#{manifest.dir}/node_modules" : persistent('node_modules-#{system.name}'),
"/azk/#{manifest.dir}/.package-envs": path("./.package-envs"),
"/azk/demos" : path("../demos"),
"/azk/build" : persistent('build-#{system.name}'),
"/azk/lib" : persistent('lib-#{system.name}'),
"/azk/data" : persistent('data-#{system.name}'),
"/azk/aptly" : persistent('aptly-#{system.name}'),
"/var/lib/docker" : persistent('docker_files-#{system.name}'),
"/root/.npm" : persistent('npm-cache'),
"/usr/local/bin/make": path("./src/libexec/make"), // Force `make -e`
"/root/.aptly.conf" : path("./src/libexec/aptly.json"),
"/.tmux.conf" : path(env.HOME + "/.tmux.conf"),
};
var envs = {
VERSION: "#{azk.version}",
PATH : "/azk/#{manifest.dir}/bin:/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
AZK_ENV : "development",
AZK_DATA_PATH: "/azk/data",
AZK_LIB_PATH : "/azk/lib",
AZK_NAMESPACE: "azk.linux",
AZK_PACKAGE_PATH: "/azk/build",
// dind options
LOG : "file",
EXTRA_SCRIPT : "/azk/#{manifest.dir}/src/libexec/init_azk",
// Balancer configuration to not conflict
AZK_BALANCER_HOST: "linux.azk.io",
AZK_BALANCER_PORT: 8080,
};
systems({
package: {
image: { docker: 'azukiapp/fpm:1.4.0' },
shell: "/bin/bash",
workdir: "/azk/#{manifest.dir}",
command: "azk nvm ./src/libexec/package-tools/server",
scalable: { default: 0 },
mounts: mounts,
envs: envs,
http: {
domains: ["#{system.name}.azk.#{azk.default_domain}"],
},
ports: {
http: "8080/tcp",
},
},
'dind-ubuntu12': {
image: { docker: 'azukiapp/dind:ubuntu12' },
scalable: false,
workdir: "/azk/#{manifest.dir}",
shell: "/usr/local/bin/wrapdocker",
mounts: mounts,
envs: envs,
docker_extra: {
HostConfig: { Privileged: true },
}
},
'dind-ubuntu14': {
extends: "dind-ubuntu12",
image: { docker: 'azukiapp/dind:ubuntu14' },
},
'dind-ubuntu15': {
extends: "dind-ubuntu12",
image: { docker: 'azukiapp/dind:ubuntu15' },
},
'dind-ubuntu16': {
extends: "dind-ubuntu12",
image: { docker: 'azukiapp/dind:ubuntu16' },
},
'dind-fedora': {
extends: "dind-ubuntu12",
image: { docker: 'azukiapp/dind:fedora20' },
},
'pkg-ubuntu12-test': {
depends: ["package"],
image: { docker: 'azukiapp/dind:ubuntu12' },
workdir: "/azk/#{manifest.dir}",
shell: "/usr/local/bin/wrapdocker",
mounts: {
"/azk/demos" : path("../demos"),
"/azk/#{manifest.dir}/src": sync("./src"),
"/azk/data" : persistent('data-#{system.name}'),
"/var/lib/docker" : persistent('docker_files-#{system.name}'),
},
envs: {
AZK_DATA_PATH: "/azk/data",
AZK_BALANCER_HOST: "linux_dev.azk.io",
LOG: "file", // Log docker to file
},
docker_extra: {
HostConfig: { Privileged: true },
}
},
'pkg-ubuntu14-test': {
extends: "pkg-ubuntu12-test",
image: { docker: 'azukiapp/dind:ubuntu14' },
},
'pkg-ubuntu15-test': {
extends: "pkg-ubuntu12-test",
image: { docker: 'azukiapp/dind:ubuntu15' },
},
'pkg-ubuntu16-test': {
extends: "pkg-ubuntu12-test",
image: { docker: 'azukiapp/dind:ubuntu16' },
},
'pkg-fedora20-test': {
extends: "pkg-ubuntu12-test",
image: { docker: 'azukiapp/dind:fedora20' },
},
});