Skip to content

Commit

Permalink
add last fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eduadiez committed Jan 16, 2019
1 parent b23de7c commit dfdfc6f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
16 changes: 10 additions & 6 deletions scripts/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ sudo: required

stages:
- name: build-test
if: tag !~ ^release*$"
if: tag != "release"
- name: release
if: tag =~ ^release*$"
if: tag = "release"

jobs:
include:
# Test that it builds correctly
###############################
- stage: build-test
if: env(TRAVIS_TAG) != master
name: build-test
services:
- docker
script:
Expand All @@ -23,12 +23,16 @@ jobs:
# - code below is common between DAppNode packages
##################################################
- stage: release
name: release
services:
- docker
script: skip
script:
- npm install -g @dappnode/dappnodesdk
- docker-compose build
- dappnodesdk publish patch -p infura
node_js: lts/*
before_deploy:
- wget https://raw.githubusercontent.com/dappnode/DAppNode/master/scripts/before_deploy.sh
- wget https://raw.githubusercontent.com/dappnode/DAppNode/master/scripts/before_deploy_no_publish.sh
- source before_deploy.sh
deploy:
provider: releases
Expand All @@ -47,4 +51,4 @@ jobs:
condition: "$TRAVIS_TAG =~ ^release*$"
after_deploy:
- wget https://raw.githubusercontent.com/dappnode/DAppNode/master/scripts/after_deploy.sh
- source after_deploy.sh
- source after_deploy.sh
11 changes: 4 additions & 7 deletions scripts/before_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,14 @@ export RELEASE_VERSION=$(dappnodesdk next patch -p infura)
export TRAVIS_TAG="v${RELEASE_VERSION}"
echo "NEXT TRAVIS_TAG $TRAVIS_TAG"

# 6. Generate the release files running the dappnodesdk
dappnodesdk publish patch -p infura

# 7. Tag release with the correct version
# (7.) Check if the tag exists, if so delete it. Fail safe, catch errors with ||
# 6. Tag release with the correct version
# (6.) Check if the tag exists, if so delete it. Fail safe, catch errors with ||
if [ $(git tag -l "$TRAVIS_TAG") ]; then export DELETE_TAG=true ; fi
if [ $DELETE_TAG ]; then git push --delete origin $TRAVIS_TAG || echo "Error deleting tag $TRAVIS_TAG from origin" ; fi
if [ $DELETE_TAG ]; then git tag --delete $TRAVIS_TAG || echo "Error deleting tag $TRAVIS_TAG locally" ; fi
# (7.) Tag this commit
# (6.) Tag this commit
git tag $TRAVIS_TAG
# (7.) Return to master.
# (6.) Return to master.
# When travis is triggered by a tag this error happens:
# > error: pathspec 'master' did not match any file(s) known to git.
# A `git fetch` will be run to ensure that the master branch is present
Expand Down
12 changes: 4 additions & 8 deletions scripts/before_deploy_no_publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,14 @@ export RELEASE_VERSION=$(dappnodesdk next patch -p infura)
export TRAVIS_TAG="v${RELEASE_VERSION}"
echo "NEXT TRAVIS_TAG $TRAVIS_TAG"

# 6. Generate the release files running the dappnodesdk
# The DNP_ETHCHAIN takes > 60 min to build. This command triggers a timeout and should be run directly from the travis yml to prevent it.
# dappnodesdk publish patch -p infura

# 7. Tag release with the correct version
# (7.) Check if the tag exists, if so delete it. Fail safe, catch errors with ||
# 6. Tag release with the correct version
# (6.) Check if the tag exists, if so delete it. Fail safe, catch errors with ||
if [ $(git tag -l "$TRAVIS_TAG") ]; then export DELETE_TAG=true ; fi
if [ $DELETE_TAG ]; then git push --delete origin $TRAVIS_TAG || echo "Error deleting tag $TRAVIS_TAG from origin" ; fi
if [ $DELETE_TAG ]; then git tag --delete $TRAVIS_TAG || echo "Error deleting tag $TRAVIS_TAG locally" ; fi
# (7.) Tag this commit
# (6.) Tag this commit
git tag $TRAVIS_TAG
# (7.) Return to master.
# (6.) Return to master.
# When travis is triggered by a tag this error happens:
# > error: pathspec 'master' did not match any file(s) known to git.
# A `git fetch` will be run to ensure that the master branch is present
Expand Down

0 comments on commit dfdfc6f

Please sign in to comment.