public
Created

Extract a job & packages from another BOSH release

  • Download Gist
readme.md
Markdown
$ cd /tmp
$ gerrit clone ssh://reviews.cloudfoundry.org:29418/cf-release
$ cd cf-release
$ bosh sync blobs
Syncing blobs...
...wait ages...
postgres/postgres-9.0.3-1.amd64.tar.gz downloaded                               
postgres/postgres-9.0.3-1.i386.tar.gz downloaded                                
postgres/postgresql-9.0.3.tar.gz downloading 17.5M (11%)...
...
Total: 129, 537.9M
No blobs to upload

$ cd /path/to/releases 
$ bosh-gen new newproject
$ cd newproject
$ bosh-gen extract /tmp/cf-release postgres
create  jobs/postgres
create  jobs/postgres/monit
create  jobs/postgres/spec
create  jobs/postgres/templates/pg_hba.conf.erb
create  jobs/postgres/templates/postgres_ctl.erb
create  jobs/postgres/templates/postgresql.conf.erb
create  packages/common
create  packages/common/packaging
create  packages/common/spec
create  packages/postgres
create  packages/postgres/packaging
create  packages/postgres/spec
create  src/common
create  src/common/utils.sh
create  blobs/postgres
create  blobs/postgres/postgres-9.0.3-1.amd64.tar.gz
create  blobs/postgres/postgres-9.0.3-1.i386.tar.gz
create  blobs/postgres/postgresql-9.0.3.tar.gz
readme  Upload blobs with 'bosh upload blobs'

$ git add .; git commit -m "Add postgres job"

$ bosh upload blobs
$ git add .; git commit -m "Uploaded blobs"
$ bosh create release
$ bosh upload release

You can also quickly create an initial deployment manifest for a release, deploy and thus trigger the package compilation:

$ bosh status
# get the bosh UUID
$ bosh-gen manifest example-dev . UUID -d 8196
$ bosh deployment example-dev.yml
$ bosh deploy

The packages will compile but the job will fail. You need to populate some properties into your manifest. Replace properties: {} with the following:

properties:
  db: :mydb
  mydb:
    address: localhost
    port: 5432
    roles:
    - name: vcap
    databases:
    - name: myfirstdb
      run_on_every_startup: []

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.