Skip to content

Commit

Permalink
travis: move deploy scripts to its own file
Browse files Browse the repository at this point in the history
This is required because before_deploy is ran twice if multiple providers exist, see travis-ci/travis-ci#2570
  • Loading branch information
arekkas authored and arekkas committed Oct 5, 2017
1 parent 2c4539b commit 90d1086
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ script:
- goveralls -service=travis-ci -coverprofile=coverage.txt

before_deploy:
- gox -ldflags "-X github.com/ory/hydra/cmd.Version=`git describe --tags` -X github.com/ory/hydra/cmd.BuildTime=`TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ'` -X github.com/ory/hydra/cmd.GitHash=`git rev-parse HEAD`" -output "dist/{{.Dir}}-{{.OS}}-{{.Arch}}"
- npm version -f --no-git-tag-version $(git describe --tag)
- ./scripts/run-deploy.sh

deploy:
- provider: npm
Expand Down
13 changes: 13 additions & 0 deletions scripts/run-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -euo pipefail

if [[ $(cat package.json | grep $(git describe --tag)) ]]; then
echo "Seems like deploy script ran already."
exit 0;
else
echo "Running deploy script..."
fi

gox -ldflags "-X github.com/ory/hydra/cmd.Version=`git describe --tags` -X github.com/ory/hydra/cmd.BuildTime=`TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ'` -X github.com/ory/hydra/cmd.GitHash=`git rev-parse HEAD`" -output "dist/{{.Dir}}-{{.OS}}-{{.Arch}}"
npm version -f --no-git-tag-version $(git describe --tag)

0 comments on commit 90d1086

Please sign in to comment.