Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build the latest unreleased tag #3

Merged
merged 1 commit into from Nov 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 14 additions & 1 deletion snap/snapcraft.yaml
@@ -1,5 +1,6 @@
name: vault
version: master
version-script: git -C parts/vault/build describe --dirty
summary: Vault is a tool for securely accessing secrets.
description: |
A modern system requires access to a multitude of secrets: database
Expand All @@ -20,7 +21,19 @@ apps:
parts:
vault:
source: https://github.com/hashicorp/vault.git
source-tag: master
prepare: |
last_committed_tag="$(git describe --tags --abbrev=0)"
last_released_tag="$(snap info vault | awk '$1 == "beta:" { print $2 }')"
# If the latest tag from the upstream project has not been released to
# beta, build that tag instead of master.
if [ "${last_committed_tag}" != "${last_released_tag}" ]; then
git checkout "${last_committed_tag}"
# XXX The snapcraft go plugin builds a link to the src dir, not to the
# build dir. That might be a bug, but let's better checkout both to be
# safe that we are not building the wrong thing. --elopio - 20171108
cd ../src
git checkout "${last_committed_tag}"
fi
plugin: go
go-importpath: github.com/hashicorp/vault
go-buildtags: [vault]
Expand Down