cloud-foundrybosh-deployer

How to name a BOSH release tarball?


Using: bosh create release --final --with-tarball --version <release version>

I get a package with the name <release version>.tgz.

However, it's not named as I desire and since the documentation is lacking in the use of the command line, and I didn't write the command to automate this, it would be helpful if someone could pick apart just exactly what these flags and commands do for me.

Googling again while I wait just in case I missed something!


Solution

  • $ bosh create release --help
    Usage: bosh [options]
            --force                      bypass git dirty state check
            --final                      create final release
            --with-tarball               create release tarball
            --dry-run                    stop before writing release manifest
            --name NAME                  specify a custom release name
            --version VERSION            specify a custom version number (ex: 1.0.0 or 1.0-beta.2+dev.10)
    

    A BOSH release is a way to package up software (source code and already-compiled binaries) to then be deployed in a distributed fashion and managed by a BOSH director, i.e. once you have a BOSH director running, you can give it a release (or multiple), and a manifest describing how you want the distributed deployment to look like (or multiple manifests) and the director will facilitate everything: deploying, upgrading, failure recovery, etc.

    To create your own BOSH release, all your bits must live in a git repository that's structured in a special way. Given such a repo, you can run bosh create release from the root of the repository to produce the artifact you then later upload to the Director when you actually want to deploy.

    The bosh create release command does not let you choose a location or name for the resulting tarball. You could open an issue here if that's a feature you need. However, in most use cases if you're just building the release in order to upload it to a Director, you don't need the file, bosh upload release will upload the right thing. In fact, you don't even need to pass --with-tarball in this case. On the other hand, if you need to know where the tarball is, because you're going to upload it to some shared location for instance, you can script it like this:

    CF_RELEASE_OUT="${TMPDIR}/create-release.out"
    bosh -n create release --with-tarball --version $VERSION | tee -a $CF_RELEASE_OUT
    TARBALL=`grep -a "Release tarball" $CF_RELEASE_OUT | cut -d " " -f4`