bosh-gen 0.24.0 → 0.90.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -362
  3. data/bosh-gen.gemspec +2 -1
  4. data/lib/bosh/gen/cli.rb +0 -8
  5. data/lib/bosh/gen/generators/errand_generator/templates/jobs/%job_name%/templates/bin/run.tt +2 -1
  6. data/lib/bosh/gen/generators/job_generator.rb +0 -5
  7. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_simple/monit.tt +2 -2
  8. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_simple/spec.tt +24 -0
  9. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_simple/templates/bin/ctl.tt +1 -1
  10. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_simple/templates/helpers/ctl_setup.sh +0 -26
  11. data/lib/bosh/gen/generators/new_release_generator.rb +7 -8
  12. data/lib/bosh/gen/generators/new_release_generator/templates/README.md.tt +13 -63
  13. data/lib/bosh/gen/generators/new_release_generator/templates/jobs/{just_install_packages → %project_name%}/monit.tt +0 -0
  14. data/lib/bosh/gen/generators/new_release_generator/templates/jobs/{just_install_packages → %project_name%}/spec.tt +1 -1
  15. data/lib/bosh/gen/generators/new_release_generator/templates/jobs/{just_install_packages → %project_name%}/templates/ignoreme +0 -0
  16. data/lib/bosh/gen/generators/new_release_generator/templates/manifests/%project_name%.yml.tt +38 -0
  17. data/lib/bosh/gen/generators/new_release_generator/templates/manifests/operators/dev.yml.tt +6 -0
  18. data/lib/bosh/gen/version.rb +1 -1
  19. metadata +28 -191
  20. data/.travis.yml +0 -13
  21. data/lib/bosh/cli/commands/share_release.rb +0 -80
  22. data/lib/bosh/gen/generators/bosh_cli_plugin_generator.rb +0 -33
  23. data/lib/bosh/gen/generators/bosh_cli_plugin_generator/templates/lib/bosh/cli/commands/%underscore_plugin_name%.rb.tt +0 -9
  24. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/monit.tt +0 -13
  25. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/%job_name%_rack_ctl.tt +0 -59
  26. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/ctl_db_utils.sh.erb +0 -54
  27. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/ctl_nginx.sh.erb +0 -17
  28. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/ctl_redis_utils.sh.erb +0 -18
  29. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/ctl_setup.sh.erb +0 -48
  30. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/ctl_start.sh.erb +0 -57
  31. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/ctl_utils.sh +0 -147
  32. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/monit_debugger +0 -13
  33. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/nginx_ctl.tt +0 -40
  34. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/rails_ctl_setup.sh.erb +0 -39
  35. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/config/database.yml.erb +0 -17
  36. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/config/mime.types +0 -73
  37. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/config/nginx.conf.erb +0 -150
  38. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/config/nginx_proxy.conf +0 -11
  39. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/config/redis.yml.erb +0 -6
  40. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_simple/templates/data/properties.sh.erb +0 -10
  41. data/lib/bosh/gen/generators/new_release_generator/templates/templates/deployment.yml.tt +0 -31
  42. data/lib/bosh/gen/generators/new_release_generator/templates/templates/infrastructure-aws-ec2.yml.tt +0 -33
  43. data/lib/bosh/gen/generators/new_release_generator/templates/templates/infrastructure-warden.yml.tt +0 -37
  44. data/lib/bosh/gen/generators/new_release_generator/templates/templates/jobs.yml.tt +0 -21
  45. data/lib/bosh/gen/generators/new_release_generator/templates/templates/make_manifest.tt +0 -83
  46. data/lib/bosh/gen/generators/new_release_generator/templates/templates/stub.yml.tt +0 -14
  47. data/lib/bosh/gen/models.rb +0 -9
  48. data/lib/bosh/gen/models/bosh_config.rb +0 -15
  49. data/lib/bosh/gen/models/deployment_manifest.rb +0 -107
  50. data/lib/bosh/gen/models/release_detection.rb +0 -35
  51. data/lib/bosh/gen/utils/file_with_progress_bar.rb +0 -62
  52. data/spec/fixtures/bosh_config/multiple_boshes.yml +0 -34
  53. data/spec/fixtures/deployment_manifests/2_jobs_1_ip_8196_disk.yml +0 -67
  54. data/spec/fixtures/deployment_manifests/2_jobs_1_ip_8196_disk_with_numeric.yml +0 -67
  55. data/spec/fixtures/deployment_manifests/2_jobs_2_ips_no_disk.yml +0 -67
  56. data/spec/fixtures/releases/bosh-sample-release/.gitignore +0 -9
  57. data/spec/fixtures/releases/bosh-sample-release/LICENSE +0 -8094
  58. data/spec/fixtures/releases/bosh-sample-release/NOTICE +0 -12
  59. data/spec/fixtures/releases/bosh-sample-release/README +0 -53
  60. data/spec/fixtures/releases/bosh-sample-release/config/final.yml +0 -9
  61. data/spec/fixtures/releases/bosh-sample-release/jobs/mysql/monit +0 -5
  62. data/spec/fixtures/releases/bosh-sample-release/jobs/mysql/spec +0 -17
  63. data/spec/fixtures/releases/bosh-sample-release/jobs/mysql/templates/my.bootstrap.erb +0 -6
  64. data/spec/fixtures/releases/bosh-sample-release/jobs/mysql/templates/my.cnf.erb +0 -46
  65. data/spec/fixtures/releases/bosh-sample-release/jobs/mysql/templates/my.shutdown.erb +0 -5
  66. data/spec/fixtures/releases/bosh-sample-release/jobs/mysql/templates/mysql_ctl.erb +0 -56
  67. data/spec/fixtures/releases/bosh-sample-release/jobs/nginx/monit +0 -5
  68. data/spec/fixtures/releases/bosh-sample-release/jobs/nginx/spec +0 -10
  69. data/spec/fixtures/releases/bosh-sample-release/jobs/nginx/templates/mime.types +0 -73
  70. data/spec/fixtures/releases/bosh-sample-release/jobs/nginx/templates/nginx.conf.erb +0 -65
  71. data/spec/fixtures/releases/bosh-sample-release/jobs/nginx/templates/nginx_ctl +0 -28
  72. data/spec/fixtures/releases/bosh-sample-release/jobs/wordpress/monit +0 -5
  73. data/spec/fixtures/releases/bosh-sample-release/jobs/wordpress/spec +0 -12
  74. data/spec/fixtures/releases/bosh-sample-release/jobs/wordpress/templates/httpd.conf.erb +0 -422
  75. data/spec/fixtures/releases/bosh-sample-release/jobs/wordpress/templates/php.ini.erb +0 -1918
  76. data/spec/fixtures/releases/bosh-sample-release/jobs/wordpress/templates/wordpress_ctl +0 -39
  77. data/spec/fixtures/releases/bosh-sample-release/jobs/wordpress/templates/wp-config.php.erb +0 -90
  78. data/spec/fixtures/releases/bosh-sample-release/packages/apache2/packaging +0 -15
  79. data/spec/fixtures/releases/bosh-sample-release/packages/apache2/spec +0 -5
  80. data/spec/fixtures/releases/bosh-sample-release/packages/mysql/packaging +0 -14
  81. data/spec/fixtures/releases/bosh-sample-release/packages/mysql/spec +0 -5
  82. data/spec/fixtures/releases/bosh-sample-release/packages/mysqlclient/packaging +0 -12
  83. data/spec/fixtures/releases/bosh-sample-release/packages/mysqlclient/spec +0 -4
  84. data/spec/fixtures/releases/bosh-sample-release/packages/nginx/packaging +0 -23
  85. data/spec/fixtures/releases/bosh-sample-release/packages/nginx/spec +0 -6
  86. data/spec/fixtures/releases/bosh-sample-release/packages/php5/packaging +0 -24
  87. data/spec/fixtures/releases/bosh-sample-release/packages/php5/spec +0 -7
  88. data/spec/fixtures/releases/bosh-sample-release/packages/wordpress/packaging +0 -14
  89. data/spec/fixtures/releases/bosh-sample-release/packages/wordpress/spec +0 -5
  90. data/spec/fixtures/releases/s3test-boshrelease/.gitignore +0 -18
  91. data/spec/fixtures/releases/s3test-boshrelease/README.md +0 -51
  92. data/spec/fixtures/releases/s3test-boshrelease/Rakefile +0 -15
  93. data/spec/fixtures/releases/s3test-boshrelease/config/blobs.yml +0 -1
  94. data/spec/fixtures/releases/s3test-boshrelease/config/final.yml +0 -5
  95. data/spec/fixtures/releases/s3test-boshrelease/jobs/.gitkeep +0 -0
  96. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/monit +0 -5
  97. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/spec +0 -13
  98. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/templates/bin/monit_debugger +0 -13
  99. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/templates/bin/s3test_ctl +0 -36
  100. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/templates/config/.gitkeep +0 -0
  101. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/templates/config/s3test.conf.erb +0 -5
  102. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/templates/data/properties.sh.erb +0 -10
  103. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/templates/helpers/ctl_setup.sh +0 -81
  104. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/templates/helpers/ctl_utils.sh +0 -156
  105. data/spec/fixtures/releases/s3test-boshrelease/packages/.gitkeep +0 -0
  106. data/spec/fixtures/releases/s3test-boshrelease/src/.gitkeep +0 -0
  107. data/spec/fixtures/releases/s3test-boshrelease/templates/deployment.yml +0 -35
  108. data/spec/fixtures/releases/s3test-boshrelease/templates/infrastructure-aws-ec2.yml +0 -40
  109. data/spec/fixtures/releases/s3test-boshrelease/templates/infrastructure-warden.yml +0 -107
  110. data/spec/fixtures/releases/s3test-boshrelease/templates/jobs.yml +0 -34
  111. data/spec/fixtures/releases/s3test-boshrelease/templates/make_manifest +0 -54
  112. data/spec/fixtures/releases/s3test-boshrelease/templates/stub.yml +0 -13
  113. data/spec/fixtures/releases/some_dev_releases/config/dev.yml +0 -3
  114. data/spec/fixtures/releases/some_dev_releases/dev_releases/index.yml +0 -6
  115. data/spec/fixtures/releases/some_dev_releases/dev_releases/myrelease-1.yml +0 -11
  116. data/spec/fixtures/releases/some_dev_releases/dev_releases/myrelease-10.yml +0 -13
  117. data/spec/fixtures/releases/some_dev_releases/dev_releases/myrelease-2.yml +0 -13
  118. data/spec/generators/job_generator_spec.rb +0 -56
  119. data/spec/generators/new_release_generator_spec.rb +0 -93
  120. data/spec/models/bosh_config_spec.rb +0 -11
  121. data/spec/models/deployment_manifest_spec.rb +0 -40
  122. data/spec/models/release_detection_spec.rb +0 -23
  123. data/spec/spec_helper.rb +0 -30
  124. data/spec/support/generator_spec_helper.rb +0 -155
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fbd5f5ae54cc9d6045654c2545801a6c4f1f3d05
4
- data.tar.gz: 1763c8535dbd032b94009dc164e1d178d983de8c
3
+ metadata.gz: a6628b3382da0dde67f0e955fe2c1d865f74c2c7
4
+ data.tar.gz: 144baff46e83bd9cbc98f38fb784198a951c6a32
5
5
  SHA512:
6
- metadata.gz: bc70d4413f65711c68f4644f63fbec7c02f6c9a66865adba53bcc7e946416bfe206af44ab5ed5a0c709cc21c317402f9c328412d5fb74145191e774dc38227c7
7
- data.tar.gz: 41a3a15b2d28a5e60cc33d076e8eebb24893a915e8e47ecdd4b82fba86d16dc7c49aab1b7752b947b5199da2fba98426c9fd591b1333665d0b69c0505ceb3583
6
+ metadata.gz: 9c0576c0e4c0c7ac85d70b6f5909423be564cb2039ffe16f582093eee02d200729cf286f310dcc13918900b342ae693b5f49d320297ea3d865e9cd7936531f84
7
+ data.tar.gz: 9d44ad668f5537a47d3abc31d314923d855a8d6acad835cfa18cb8627188ebc91d5b4548e06531d54b83dea0e14bfd8be98cfea0ec307de3f43835ae9c6277a7
data/README.md CHANGED
@@ -3,366 +3,6 @@ BOSH Generators
3
3
 
4
4
  Generators for creating and sharing BOSH releases.
5
5
 
6
- New in 0.20: Create packages from embedded Docker images
6
+ New in 0.90: `bosh2` support - single `manifests/thing.yml` deployment file
7
7
 
8
- New in 0.17: Creates blobstore/bucket when creating new release. AWS bucket is publicly readable.
9
-
10
- If you would like to share your BOSH release with the world, you can use the [BOSH Community AWS S3 account](#share-bosh-releases).
11
-
12
- ![example](http://f.cl.ly/items/3v2F43020a3N0Q1g3Z0E/bosh-gen-new.gif)
13
-
14
- Installation
15
- ------------
16
-
17
- This application requires Ruby 1.9 or 2.0 and is installed via RubyGems:
18
-
19
- ```
20
- $ gem install bosh-gen
21
- ```
22
-
23
- Usage
24
- -----
25
-
26
- ```
27
- $ bosh-gen new $(whoami)-project
28
- create
29
- Auto-detected infrastructure API credentials at ~/.fog (override with $FOG)
30
- 1. AWS (community)
31
- 2. Alternate credentials
32
- Choose an auto-detected infrastructure: 2
33
- Choose AWS region: 1
34
-
35
- create README.md
36
- create Rakefile
37
- create jobs
38
- create jobs/my-project/templates/bin/my_project_ctl
39
- ...
40
- create config/blobs.yml
41
- create config/dev.yml
42
- create config/private.yml
43
- create config/final.yml
44
- create .gitignore
45
- run git init from "."
46
-
47
- Next, change to BOSH release location:
48
- cd ./my-project-boshrelease
49
-
50
- Finally...
51
- Attempting to create blobstore my-project-boshrelease... done
52
-
53
- Confirming: Using blobstore my-project-boshrelease
54
- ```
55
-
56
- Your project is now in the folder mentioned above:
57
-
58
- ```
59
- $ cd ./my-project-boshrelease
60
- ```
61
-
62
- ```
63
- $ wget -P /tmp http://ftp.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.gz
64
- $ bosh-gen package ruby -f /tmp/ruby-2.2.2.tar.gz
65
-
66
- $ bosh-gen job some-ruby-job -d ruby
67
-
68
- $ bosh create release --force
69
- ```
70
-
71
- To test out each iteration of your release, you can create a manifest, upload your release, and deploy it:
72
-
73
- ```
74
- ./templates/make_manifest warden
75
- bosh upload release
76
- bosh -n deploy
77
- ```
78
-
79
- The large ruby tarball is automatically placed in the `blobs/` folder. Before you share your boshrelease with other developers you will want to sync it to your blobstore (the S3 bucket created via `bosh-gen new`\):
80
-
81
- ```
82
- $ bosh upload blobs
83
- ```
84
-
85
- Quickly creating packages
86
- -------------------------
87
-
88
- There is a slow way to create a package, and there are three faster ways. Slow vs fast is not a debated about best vs worse. But sometimes you're in a hurry.
89
-
90
- ### Slow way
91
-
92
- ```
93
- $ bosh-gen package apache2
94
- create packages/apache2/packaging
95
- create packages/apache2/spec
96
- ```
97
-
98
- The slowest way to create a package is to run the command above, then get the source, read the "install from source" instructions, and create a package.
99
-
100
- ### Slightly faster way
101
-
102
- As above, when we created the `ruby` package we included a pre-downloaded asset:
103
-
104
- ```
105
- $ bosh-gen package ruby -f /tmp/ruby-2.2.2.tar.gz
106
- ```
107
-
108
- If you download the source files first, and reference them with the `bosh-gen package` generator, then it will attempt to guess how to install the package. The generated `packaging` script will include some starting commands that might work.
109
-
110
- The command above will also copy the target file into the `blobs/ruby/` folder. One less thing for you to do.
111
-
112
- You still need to look up "how to install from source" instructions and put them in `packages/ruby/packaging` script.
113
-
114
- ### Fastest way - reuse existing packages
115
-
116
- ```
117
- $ bosh-gen extract-pkg ../cf-release/packages/postgres
118
- ```
119
-
120
- The fastest way is to reuse an existing, working package from another BOSH release that you have on your local machine.
121
-
122
- This command will copy across the `packages/postgres/spec` & `packages/postgres/packaging` files, as well as any blobs or src files that are referenced in the original BOSH release.
123
-
124
- This is a great command to use. There are a growing number of BOSH releases on GitHub from which to steal, err, extract packages into your own BOSH releases.
125
-
126
- Remember, first run `bosh sync blobs` in the target BOSH release project. Otherwise it will not be able to copy over the blobs.
127
-
128
- ### Fast way - embedded Docker images
129
-
130
- This use case assumes you have `docker` CLI installed and access to a Docker daemon.
131
-
132
- It will also make your BOSH release dependent upon the [cf-platform-eng/docker-boshrelease](https://bosh.io/d/github.com/cf-platform-eng/docker-boshrelease) release which installs the Docker daemon on VMs; and offers a simple way to run Docker containers if required.
133
-
134
- ```
135
- $ bosh-gen package tmate --docker-image nicopace/tmate-docker
136
- exist jobs
137
- create jobs/nicopace_tmate_docker_image/monit
138
- create jobs/nicopace_tmate_docker_image/spec
139
- create jobs/nicopace_tmate_docker_image/templates/bin/install_ctl
140
- create jobs/nicopace_tmate_docker_image/templates/bin/monit_debugger
141
- create jobs/nicopace_tmate_docker_image/templates/helpers/ctl_setup.sh
142
- create jobs/nicopace_tmate_docker_image/templates/helpers/ctl_utils.sh
143
- exist packages
144
- create packages/tmate/packaging
145
- create packages/tmate/spec
146
- docker pull nicopace/tmate-docker
147
- Pulling repository nicopace/tmate-docker
148
- 7b9df453c66b: Download complete
149
- ...
150
- 6df853718c80: Download complete
151
- Status: Image is up to date for nicopace/tmate-docker:latest
152
- docker save nicopace/tmate-docker > blobs/docker-images/nicopace_tmate_docker.tgz
153
-
154
- $ bosh create release --force
155
- ...
156
- Release name: tmate-server
157
- Release version: 0+dev.1
158
- ```
159
-
160
- The `package --docker-image` flag will display the next steps help as well:
161
-
162
- ```
163
- Next steps:
164
- 1. To use this BOSH release, first upload it and the docker release to your BOSH:
165
- bosh upload release https://bosh.io/releases/cloudfoundry-community/consul-docker
166
- bosh upload release https://bosh.io/d/github.com/cf-platform-eng/docker-boshrelease
167
-
168
- 2. To use the docker image, your deployment job needs to start with the following:
169
-
170
- jobs:
171
- - name: some_job
172
- templates:
173
- # run docker daemon
174
- - {name: docker, release: docker}
175
- # warm docker image cache from bosh package
176
- - {name: nicopace_tmate_docker_image, release: tmate-server}
177
-
178
- 3. To simply run a single container, try the 'containers' job from 'docker' release
179
-
180
- https://github.com/cloudfoundry-community/consul-docker-boshrelease/blob/master/templates/jobs.yml#L18-L40
181
- ```
182
-
183
- ### Fast way - reuse Aptitude/Debian packages
184
-
185
- ```
186
- $ bosh-gen package apache2 --apt
187
- $ vagrant up
188
- $ vagrant ssh -c '/vagrant/src/apt/fetch_debs.sh apache2'
189
- $ vagrant destroy
190
- ```
191
-
192
- You can add/change the Debian packages to install by editing `src/apt/apache2/aptfile` and re-running the `fetch_debs.sh` command above. You might want to delete `blobs/apt/apache2` first to ensure that only the fetched `.deb` files are subsequently included during package compilation.
193
-
194
- It is possible now to download one or more `.deb` files into the `blobs/apt/` folder, and have them installed during package compilation time.
195
-
196
- The installed .deb packages will be available at `/var/vcap/packages/apache2/apt`; rather than within the root folder system.
197
-
198
- Your job monit control scripts can source a provided `profile.sh` to setup environment variables:
199
-
200
- ```
201
- source /var/vcap/packages/apache2/profile.sh
202
- ```
203
-
204
- This is the last option, and it is not the best option. Many Debian packages will also start processes that have default configuration that is not correct for your use case. It may be fast to get the Debian packages; but additional work may be required by your jobs to stop and unhook the processes that are automatically started upon installation.
205
-
206
- Tutorial
207
- --------
208
-
209
- To see how the various commands work together, let's create a new bosh release for [Cassandra](http://cassandra.apache.org/).
210
-
211
- ```
212
- $ bosh-gen new cassandra
213
- $ cd cassandra
214
- $ bosh-gen extract-pkg ../cf-release/packages/dea_jvm7
215
- create packages/dea_jvm7
216
- create packages/dea_jvm7/packaging
217
- create packages/dea_jvm7/spec
218
- create blobs/java/jre-7u4-linux-i586.tar.gz
219
- create blobs/java/jre-7u4-linux-x64.tar.gz
220
- readme Upload blobs with 'bosh upload blobs'
221
- $ mv packages/dea_jvm7 packages/java7
222
- ```
223
-
224
- In `packages/java7/spec`, rename it to `java7`.
225
-
226
- ```
227
- $ bosh-gen package cassandra -d java7 -f ~/Downloads/apache-cassandra-1.0.11-bin.tar.gz
228
- create packages/cassandra/packaging
229
- create blobs/cassandra/apache-cassandra-1.0.11-bin.tar.gz
230
- create packages/cassandra/spec
231
- ```
232
-
233
- Change `packages/cassandra/packaging` to:
234
-
235
- ```
236
- tar xfv cassandra/apache-cassandra-1.0.11-bin.tar.gz
237
- cp -a apache-cassandra-1.0.11/* $BOSH_INSTALL_TARGET
238
- ```
239
-
240
- Now create a stub for running cassandra as a job:
241
-
242
- ```
243
- $ bosh-gen job cassandra -d java7 cassandra
244
- create jobs/cassandra
245
- create jobs/cassandra/monit
246
- create jobs/cassandra/templates/bin/cassandra_ctl
247
- create jobs/cassandra/templates/bin/monit_debugger
248
- create jobs/cassandra/templates/data/properties.sh.erb
249
- create jobs/cassandra/templates/helpers/ctl_setup.sh
250
- create jobs/cassandra/templates/helpers/ctl_utils.sh
251
- create jobs/cassandra/spec
252
- ```
253
-
254
- Look at all that goodness!
255
-
256
- A quick summary of these files:
257
-
258
- - The `monit` script uses `bin/monit_debugger` to help you debug any glitches in starting/stopping processes.
259
- - `ctl_setup.sh` setups up lots of common folders and env vars.
260
- - `ctl_utils.sh` comes from cf-release's common/utils.sh with some extra helper functions
261
- - `data/properties.sh.erb` is where you extract any `<%= properties.cassandra... %>` values from the deployment manifest.
262
- - `bin/cassandra_ctl` no longer needs to be an unreadable ERb template! Use the env variables you create in `data/properties.sh.erb` and normal bash if statements instead of ERb `<% if ... %>` templates.
263
- - `examples/...` is a folder for documenting example, valid deployment manifest properties for the release.
264
-
265
- In `bin/cassandra_ctl` you now change "TODO" to `cassandra` and the rest of the tutorial is left to you, dear cassandra lover.
266
-
267
- Your release is now ready to build, test and deploy:
268
-
269
- ```
270
- bosh create release --force
271
- bosh upload release
272
- ```
273
-
274
- When you create a final release, you will first need to setup your AWS credentials in `config/final.yml`
275
-
276
- Share BOSH releases
277
- -------------------
278
-
279
- To share your BOSH release with other BOSH users you need ONLY:
280
-
281
- - Use a public blobstore (such as AWS S3)
282
- - Use a public source control repository
283
- - Optionally, publicly share pre-created final release tarballs via a HTTP URL.
284
-
285
- ### Share release tarballs via HTTP
286
-
287
- bosh-gen includes a BOSH CLI plugin to upload dev or final tarballs to your blobstore, and get a public URL back (if supported by your blobstore)
288
-
289
- ```
290
- $ bosh create release --with-tarball
291
- $ bosh share release releases/my-project-1.tgz
292
- https://my-project-boshrelease.s3.amazonaws.com/boshrelease-my-project-1.tgz
293
- ```
294
-
295
- The URL is displayed and can be given to other users and uploaded directly to their BOSH:
296
-
297
- ```
298
- $ bosh upload release https://my-project-boshrelease.s3.amazonaws.com/boshrelease-my-project-1.tgz
299
- ```
300
-
301
- They no longer require your BOSH release repo to access the BOSH release.
302
-
303
- ![share-http-tarball](http://f.cl.ly/items/0R3A1w3k2E3h3a2d1g2U/bosh-gen-share-release.gif)
304
-
305
- ### BOSH community facilities
306
-
307
- You are welcome to re-use the BOSH user community facilities:
308
-
309
- - Use the shared AWS S3 account (currently over 30 BOSH release blobstores).
310
- - Place your release git repository in the [@cloudfoundry-community](https://github.com/cloudfoundry-community) GitHub account (over 50 people have access).
311
-
312
- One time only, please email [Dr Nic Williams](mailto:&#x64;&#x72;&#x6E;&#x69;&#x63;&#x77;&#x69;&#x6C;&#x6C;&#x69;&#x61;&#x6D;&#x73;&#x40;&#x67;&#x6D;&#x61;&#x69;&#x6C;&#x2E;&#x63;&#x6F;&#x6D;) and he will set you up with access:
313
-
314
- - Read/write credentials to the AWS S3 account for your BOSH release blobstores/buckets
315
- - Access to create [@cloudfoundry-community](https://github.com/cloudfoundry-community) GitHub repositories for your BOSH releases
316
-
317
- When he gives you the AWS S3 credentials, place them in the `~/.fog` file and you'll easily be able to reuse them for each new BOSH release:
318
-
319
- ```yaml
320
- :community:
321
- :aws_access_key_id: ACCESS
322
- :aws_secret_access_key: SECRET
323
- ```
324
-
325
- Then for your next BOSH release:
326
-
327
- ```
328
- $ bosh-gen new my-project
329
- create
330
- Auto-detected infrastructure API credentials at ~/.fog (override with $FOG)
331
- 1. AWS (community)
332
- 2. Alternate credentials
333
- Choose an auto-detected infrastructure: 2
334
- ```
335
-
336
- You'll only need to do this once. Yes, it would be awesome if there was some public service to do this nicely. Want to build it?
337
-
338
- Create BOSH CLI plugins
339
- -----------------------
340
-
341
- You can now (v0.19.0+) quickly create a BOSH CLI plugin within a RubyGem (to share), BOSH workspace or release (local to that project).
342
-
343
- Inside your RubyGem, BOSH workspace or release:
344
-
345
- ```
346
- $ bosh-gen cli-plugin setup-deployment
347
- create lib
348
- create lib/bosh/cli/commands/setup_deployment.rb
349
- ```
350
-
351
- The `setup_deployment.rb` file will now be automatically picked up by `bosh` CLI locally OR if you distribute your project as a RubyGem:
352
-
353
- ```
354
- $ bosh setup deployment
355
- WARNING: loading local plugin: lib/bosh/cli/commands/setup_deployment.rb
356
- TODO
357
- ```
358
-
359
- Note: the hyphenated name `setup-deployment` becomes a space-separated command `setup deployment`.
360
-
361
- Contributing
362
- ------------
363
-
364
- 1. Fork it
365
- 2. Create your feature branch (`git checkout -b my-new-feature`\)
366
- 3. Commit your changes (`git commit -am 'Added some feature'`\)
367
- 4. Push to the branch (`git push origin my-new-feature`\)
368
- 5. Create new Pull Request
8
+ NOTE: this `bosh2` branch is under construction. README will be re-written as we get towards v1.0
data/bosh-gen.gemspec CHANGED
@@ -22,7 +22,8 @@ Gem::Specification.new do |gem|
22
22
 
23
23
  gem.add_dependency "cyoi", "~> 0.10"
24
24
  gem.add_dependency "fog", "~> 1.11"
25
- gem.add_dependency "fog-aws", "0.1.1" # 0.1.2 causes issues
25
+ gem.add_dependency "fog-aws"
26
+ gem.add_dependency "mime-types"
26
27
  gem.add_dependency "readwritesettings", "~> 3.0"
27
28
  gem.add_dependency "activesupport", ">= 4.0", "< 5.0"
28
29
 
data/lib/bosh/gen/cli.rb CHANGED
@@ -5,8 +5,6 @@ module Bosh; end
5
5
  require "cli/config"
6
6
  require "cli/core_ext"
7
7
 
8
- require 'bosh/gen/models'
9
-
10
8
  module Bosh
11
9
  module Gen
12
10
  class Command < Thor
@@ -119,12 +117,6 @@ module Bosh
119
117
  Bosh::Gen::Generators::ExtractPackageGenerator.start([source_package_path])
120
118
  end
121
119
 
122
- desc "cli-plugin NAME", "Add a BOSH CLI plugin into this project"
123
- def cli_plugin(plugin_name)
124
- require 'bosh/gen/generators/bosh_cli_plugin_generator'
125
- Bosh::Gen::Generators::BoshCliPluginGenerator.start([plugin_name])
126
- end
127
-
128
120
  no_tasks do
129
121
  def cyan; "\033[36m" end
130
122
  def clear; "\033[0m" end
@@ -1,5 +1,7 @@
1
1
  #!/bin/bash
2
2
 
3
+ exec 2>&1
4
+
3
5
  set -e # exit immediately if a simple command exits with a non-zero status
4
6
  set -u # report the usage of uninitialized variables
5
7
 
@@ -9,4 +11,3 @@ source /var/vcap/jobs/<%= job_name %>/helpers/ctl_setup.sh '<%= job_name %>'
9
11
  ############################################################################
10
12
 
11
13
  # put your errand steps here...
12
-
@@ -60,11 +60,6 @@ module Bosh::Gen
60
60
  end
61
61
  end
62
62
 
63
- def job_specification
64
- config = { "name" => job_name, "packages" => dependencies, "templates" => @template_files }
65
- create_file job_dir("spec"), YAML.dump(config)
66
- end
67
-
68
63
  private
69
64
  def filenames
70
65
  files.map {|f| File.basename(f) }
@@ -1,5 +1,5 @@
1
1
  check process <%= job_name %>
2
2
  with pidfile /var/vcap/sys/run/<%= job_name %>/<%= job_name %>.pid
3
- start program "/var/vcap/jobs/<%= job_name %>/bin/monit_debugger <%= job_name %>_ctl '/var/vcap/jobs/<%= job_name %>/bin/ctl start'"
4
- stop program "/var/vcap/jobs/<%= job_name %>/bin/monit_debugger <%= job_name %>_ctl '/var/vcap/jobs/<%= job_name %>/bin/ctl stop'"
3
+ start program "/var/vcap/jobs/<%= job_name %>/bin/monit_debugger ctl '/var/vcap/jobs/<%= job_name %>/bin/ctl start'"
4
+ stop program "/var/vcap/jobs/<%= job_name %>/bin/monit_debugger ctl '/var/vcap/jobs/<%= job_name %>/bin/ctl stop'"
5
5
  group vcap