Skip to content

Instantly share code, notes, and snippets.

@yanatan16
Last active December 30, 2015 07:39
Show Gist options
  • Save yanatan16/7797023 to your computer and use it in GitHub Desktop.
Save yanatan16/7797023 to your computer and use it in GitHub Desktop.
Salt states for golang / gvm
{% set goversion = 'go1.2' %}
gvm:
cmd.run:
- name: bash < <(curl -s https://raw.github.com/moovweb/gvm/master/binscripts/gvm-installer)
- user: deploy
- require:
- user: deploy
go1.2:
cmd.run:
- name: gvm install {{ goversion }}
- user: deploy
- require:
- cmd: gvm
# Get your code somewhere
[email protected]:your/code:
git.latest:
- target: /path/to/your/code
go-link-code:
cmd.run:
- name: 'gvm use {{ goversion }} && gvm linkthis github.com/your/code'
- cwd: /path/to/your/code
go-install-code:
cmd.run:
- name: 'gvm use {{ goversion }} && go install github.com/your/code/executable'
go-run-code:
cmd.run:
- name: 'gvm use {{ goversion }} && executable'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment