application-builder

command module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2019 License: MIT Imports: 2 Imported by: 0

README

Go Lift: Application Builder

Go-App Packaging Template for Debian, RedHat, Homebrew and Docker.

The bits are here, and the readme/howto is coming soon.

In a nutshell (and it's a bit more than a nutshell):

  • Use this template. Name the repo the same as your go app.
  • Edit .metadata.sh. Most of the config is done here.
    • If you're not sure about something, don't change it.
  • mv .travis.yml travis.yml ; touch .travis.yml ; travis setup releases
    • Accept the defaults. All you need is the secure key.
  • Enable Travis-CI builds for your new repo. Just check the box.
  • Copy the secure api key from .travis.yml to travis.yml, then put it back:
    • Get the indentation right.
    • mv travis.yml .travis.yml
  • With no other changes Travis-CI should build hello-world from your repo.

Homebrew

If you want to push homebrew formula, you'll need to make another repo for your homebrew tap. Mine is named golift/homebrew-mugs. The mugs part can be any word you want, formula is normal, I'm just weird.

  • Add an SSH key to your homebrew repo.
    • Example, except don't encrypt the key yet.
    • Make a tar file with your key. tar -cf .secret-files.tar github_deploy_key and encrypt this.
    • travis encrypt-file .secret-files.tar and git add .secret-files.tar.env
    • Update .travis.yml with the $encrypted_XXXXXXXXXXXX_key and $encrypted_XXXXXXXXXXXX_iv values printed by travis encrypt-file .secret-files.tar.
    • Using a tar file in case you want to add more secure files later. Travis only supports one encrypted file per repo.
    • The included .travis.yml file will extract the tar file and use the github_deploy_key file automatically.

Docker

If you want to support Docker Builds, create a new Docker Repo, and link it to your new Github Repo. Use this example to setup your build in Docker Cloud. Pretty simple, just add the Tag Auto Build and ENV variables.

Next

  1. Add your Go code, or start hacking on hello-world; it contains quite a bit of boilerplate to get you started.
  2. Update the MANUAL.md file.
  3. Refine .metadata.sh (it doesn't take much). Make some wiki pages, like Docker.
  4. If your app runs as a service update the package scripts for linux.
  5. Fix the REPO variable in the install.sh script.
  6. Clean up .gitignore.

Bitly

Bitly API integration is included to allow shortening a download link in the homebrew formula. Using bitly gives you download statistics for brew tap installs. There is no other way to obtain this information. A wiki will later be added explaining how to add your bitly API Token.

Examples

These repos use this template.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL