bosh-gen 0.21.2 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog.md +9 -0
- data/Rakefile +1 -1
- data/lib/bosh/gen/generators/errand_generator/templates/jobs/%job_name%/templates/helpers/ctl_utils.sh +1 -2
- data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/ctl_start.sh.erb +2 -4
- data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/ctl_utils.sh +1 -2
- data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/nginx_ctl.tt +1 -2
- data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/rails_ctl_setup.sh.erb +1 -2
- data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_simple/templates/bin/ctl.tt +1 -2
- data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_simple/templates/helpers/ctl_utils.sh +1 -2
- data/lib/bosh/gen/generators/new_release_generator.rb +4 -0
- data/lib/bosh/gen/generators/new_release_generator/templates/templates/infrastructure-warden.yml.tt +3 -3
- data/lib/bosh/gen/generators/new_release_generator/templates/templates/make_manifest.tt +24 -15
- data/lib/bosh/gen/generators/package_docker_image_generator/templates/jobs/%job_name%/templates/bin/install_ctl.tt +2 -3
- data/lib/bosh/gen/generators/package_docker_image_generator/templates/jobs/%job_name%/templates/helpers/ctl_utils.sh +1 -2
- data/lib/bosh/gen/version.rb +1 -1
- data/spec/generators/job_generator_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f17041e4f4a608b4955a09e655c62d200689525
|
4
|
+
data.tar.gz: 47bb082f621ca64763a7a19cacc10323415fcb3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70495c5c389f7692dfef781d6c95993195cb8f2fea2cf73e80e550469a06cd56590bbe4f3ccac7485f44b0e1815f2debd8f399dadfd8bcbe845534af5cc42925
|
7
|
+
data.tar.gz: 03a70228d6950940a1f525b64443ba550b4f235df569be262e7dba4781ceeaf99437defb5fc1c0489f216bf8f8233a57d84f7b51d6f41621cc63c4e86f1fcd83
|
data/ChangeLog.md
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
Change Log
|
2
2
|
==========
|
3
3
|
|
4
|
+
v0.22.0
|
5
|
+
|
6
|
+
Thanks to James Hunt, Quintessence Anx, and Long Nguyen for this version!
|
7
|
+
|
8
|
+
- Fixed stemcell URLs from `bosh public stemcells` to https://bosh.io
|
9
|
+
- Randomize Warden Network definitions so they don't always clash
|
10
|
+
- Unify stdout/stderr log files everywhere
|
11
|
+
- Fixed issue where dir cpi was found as `warden_cpi' not`warden'
|
12
|
+
|
4
13
|
v0.21.0
|
5
14
|
|
6
15
|
- `new` assumes using [spruce](https://github.com/geofffranks/spruce) instead of spiff. Yay!
|
data/Rakefile
CHANGED
@@ -38,8 +38,7 @@ link_job_file() {
|
|
38
38
|
redirect_output() {
|
39
39
|
SCRIPT=$1
|
40
40
|
mkdir -p /var/vcap/sys/log/monit
|
41
|
-
exec 1>> /var/vcap/sys/log/monit/$SCRIPT.log
|
42
|
-
exec 2>> /var/vcap/sys/log/monit/$SCRIPT.err.log
|
41
|
+
exec 1>> /var/vcap/sys/log/monit/$SCRIPT.log 2>&1
|
43
42
|
}
|
44
43
|
|
45
44
|
pid_guard() {
|
@@ -34,14 +34,12 @@ then
|
|
34
34
|
MIN_THREADS=<%= (puma_threads && puma_threads.min) || 0 %>
|
35
35
|
MAX_THREADS=<%= (puma_threads && puma_threads.max) || 16 %>
|
36
36
|
exec bundle exec puma --pidfile $PIDFILE -p $PORT -t $MIN_THREADS:$MAX_THREADS \
|
37
|
-
>>$LOG_DIR/webapp.stdout.log
|
38
|
-
2>>$LOG_DIR/webapp.stderr.log || exit 1
|
37
|
+
>>$LOG_DIR/webapp.stdout.log 2>&1 || exit 1
|
39
38
|
|
40
39
|
elif [[ "${appstack}" = "rackup" ]]
|
41
40
|
then
|
42
41
|
exec bundle exec rackup -D -P $PIDFILE -p $PORT \
|
43
|
-
>>$LOG_DIR/webapp.stdout.log
|
44
|
-
2>>$LOG_DIR/webapp.stderr.log || exit 1
|
42
|
+
>>$LOG_DIR/webapp.stdout.log 2>&1 || exit 1
|
45
43
|
|
46
44
|
elif [[ "${appstack}" = "phpfpm" || "${appstack}" = "php-fpm" ]]
|
47
45
|
then
|
@@ -30,8 +30,7 @@ link_job_file_to_package() {
|
|
30
30
|
redirect_output() {
|
31
31
|
SCRIPT=$1
|
32
32
|
mkdir -p /var/vcap/sys/log/monit
|
33
|
-
exec 1>> /var/vcap/sys/log/monit/$SCRIPT.log
|
34
|
-
exec 2>> /var/vcap/sys/log/monit/$SCRIPT.err.log
|
33
|
+
exec 1>> /var/vcap/sys/log/monit/$SCRIPT.log 2>&1
|
35
34
|
}
|
36
35
|
|
37
36
|
pid_guard() {
|
@@ -28,8 +28,7 @@ function run_migrations() {
|
|
28
28
|
|
29
29
|
echo "Running migrations"
|
30
30
|
bundle exec ${migration_command} \
|
31
|
-
>>$LOG_DIR/db_migrate.
|
32
|
-
2>>$LOG_DIR/db_migrate.stderr.log
|
31
|
+
>>$LOG_DIR/db_migrate.log 2>&1
|
33
32
|
if [ $? != 0 ]; then
|
34
33
|
echo "Migrations failed"
|
35
34
|
exit 1
|
@@ -38,8 +38,7 @@ link_job_file() {
|
|
38
38
|
redirect_output() {
|
39
39
|
SCRIPT=$1
|
40
40
|
mkdir -p /var/vcap/sys/log/monit
|
41
|
-
exec 1>> /var/vcap/sys/log/monit/$SCRIPT.log
|
42
|
-
exec 2>> /var/vcap/sys/log/monit/$SCRIPT.err.log
|
41
|
+
exec 1>> /var/vcap/sys/log/monit/$SCRIPT.log 2>&1
|
43
42
|
}
|
44
43
|
|
45
44
|
pid_guard() {
|
@@ -191,6 +191,10 @@ module Bosh::Gen
|
|
191
191
|
@project_name ||= File.basename(proposed_app_path).gsub(/-(?:boshrelease|release)$/, '')
|
192
192
|
end
|
193
193
|
|
194
|
+
def warden_net
|
195
|
+
@warden_net ||= "10.244.#{rand(255) + 1}"
|
196
|
+
end
|
197
|
+
|
194
198
|
def job_name
|
195
199
|
project_name_underscored
|
196
200
|
end
|
data/lib/bosh/gen/generators/new_release_generator/templates/templates/infrastructure-warden.yml.tt
CHANGED
@@ -29,8 +29,8 @@ networks:
|
|
29
29
|
- name: <%= project_name_underscored %>1
|
30
30
|
type: manual
|
31
31
|
subnets:
|
32
|
-
- range:
|
32
|
+
- range: <%= warden_net %>.0/24
|
33
33
|
name: <%= project_name_underscored %>1
|
34
|
-
gateway:
|
34
|
+
gateway: <%= warden_net %>.1
|
35
35
|
static:
|
36
|
-
-
|
36
|
+
- <%= warden_net %>.2 - <%= warden_net %>.60
|
@@ -7,32 +7,41 @@ STEMCELL_OS=${STEMCELL_OS:-ubuntu}
|
|
7
7
|
|
8
8
|
infrastructure=$1
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
fail() {
|
11
|
+
echo >&2 $*
|
12
|
+
}
|
13
|
+
|
14
|
+
if [[ "$infrastructure" != "aws-ec2" && "$infrastructure" != "warden" ]] ; then
|
15
|
+
fail "usage: ./make_manifest <aws-ec2|warden>"
|
13
16
|
exit 1
|
14
17
|
fi
|
15
18
|
|
19
|
+
case "${infrastructure}/${STEMCELL_OS}" in
|
20
|
+
(warden/*) STEMCELL_URL="https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-trusty-go_agent" ;;
|
21
|
+
(aws-ec2/ubuntu) STEMCELL_URL="https://bosh.io/d/stemcells/bosh-aws-xen-ubuntu-trusty-go_agent" ;;
|
22
|
+
(aws-ec2/centos) STEMCELL_URL="https://bosh.io/d/stemcells/bosh-aws-xen-centos-7-go_agent" ;;
|
23
|
+
(*)
|
24
|
+
fail "Invalid infrastructure or OS specified."
|
25
|
+
exit 1
|
26
|
+
;;
|
27
|
+
esac
|
28
|
+
|
16
29
|
shift
|
17
30
|
|
18
31
|
BOSH_STATUS=$(bosh status)
|
19
32
|
DIRECTOR_UUID=$(echo "$BOSH_STATUS" | grep UUID | awk '{print $2}')
|
20
|
-
DIRECTOR_CPI=$(echo "$BOSH_STATUS" | grep CPI | awk '{print $2}')
|
33
|
+
DIRECTOR_CPI=$(echo "$BOSH_STATUS" | grep CPI | awk '{print $2}' | sed -e 's/_cpi//')
|
21
34
|
DIRECTOR_NAME=$(echo "$BOSH_STATUS" | grep Name | awk '{print $2}')
|
22
35
|
NAME=$template_prefix-$infrastructure
|
23
36
|
|
24
|
-
if [[ $DIRECTOR_NAME = "warden" ]]; then
|
25
|
-
|
26
|
-
|
27
|
-
exit 1
|
28
|
-
fi
|
37
|
+
if [[ $DIRECTOR_NAME = "warden" && ${infrastructure} != "warden" ]]; then
|
38
|
+
fail "Not targeting bosh-lite with warden CPI. Please make sure you have run 'bosh target' and are targeting a BOSH lite before running this script."
|
39
|
+
exit 1
|
29
40
|
fi
|
30
41
|
|
31
|
-
if [[ $infrastructure = "aws-ec2" ]]; then
|
32
|
-
|
33
|
-
|
34
|
-
exit 1
|
35
|
-
fi
|
42
|
+
if [[ $infrastructure = "aws-ec2" && ${DIRECTOR_CPI} != "aws" ]]; then
|
43
|
+
fail "Not targeting an AWS BOSH. Please make sure you have run 'bosh target' and are targeting an AWS BOSH before running this script."
|
44
|
+
exit 1
|
36
45
|
fi
|
37
46
|
|
38
47
|
function latest_uploaded_stemcell {
|
@@ -40,7 +49,7 @@ function latest_uploaded_stemcell {
|
|
40
49
|
}
|
41
50
|
|
42
51
|
STEMCELL=${STEMCELL:-$(latest_uploaded_stemcell)}
|
43
|
-
if [[
|
52
|
+
if [[ -z ${STEMCELL} ]]; then
|
44
53
|
echo
|
45
54
|
echo "Uploading latest $DIRECTOR_CPI/$STEMCELL_OS stemcell..."
|
46
55
|
STEMCELL_URL=$(bosh public stemcells --full | grep $DIRECTOR_CPI | grep $STEMCELL_OS | sort -nr | head -n1 | awk '{ print $4 }')
|
@@ -19,9 +19,8 @@ case $1 in
|
|
19
19
|
|
20
20
|
time docker \
|
21
21
|
--host unix:///var/vcap/sys/run/docker/docker.sock \
|
22
|
-
load -i /var/vcap/packages/<%= package_name %>/<%= image_filename %>
|
23
|
-
|
24
|
-
2>>$LOG_DIR/$JOB_NAME.stderr.log
|
22
|
+
load -i /var/vcap/packages/<%= package_name %>/<%= image_filename %> \
|
23
|
+
>>$LOG_DIR/$JOB_NAME.log 2>&1
|
25
24
|
|
26
25
|
# do nothing forever
|
27
26
|
exec tail -f /dev/null
|
@@ -38,8 +38,7 @@ link_job_file() {
|
|
38
38
|
redirect_output() {
|
39
39
|
SCRIPT=$1
|
40
40
|
mkdir -p /var/vcap/sys/log/monit
|
41
|
-
exec 1>> /var/vcap/sys/log/monit/$SCRIPT.log
|
42
|
-
exec 2>> /var/vcap/sys/log/monit/$SCRIPT.err.log
|
41
|
+
exec 1>> /var/vcap/sys/log/monit/$SCRIPT.log 2>&1
|
43
42
|
}
|
44
43
|
|
45
44
|
pid_guard() {
|
data/lib/bosh/gen/version.rb
CHANGED
@@ -18,7 +18,7 @@ describe Bosh::Gen::Generators::JobGenerator do
|
|
18
18
|
generate_job("mywebapp")
|
19
19
|
expect(File.exist?("jobs/mywebapp/monit")).to eq(true)
|
20
20
|
expect(File.exist?("jobs/mywebapp/spec")).to eq(true)
|
21
|
-
job_template_exists "mywebapp", "bin/
|
21
|
+
job_template_exists "mywebapp", "bin/ctl", "bin/ctl"
|
22
22
|
job_template_exists "mywebapp", "bin/monit_debugger", "bin/monit_debugger"
|
23
23
|
job_template_exists "mywebapp", "data/properties.sh.erb", "data/properties.sh"
|
24
24
|
job_template_exists "mywebapp", "helpers/ctl_setup.sh", "helpers/ctl_setup.sh"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh-gen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.22.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dr Nic Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|