Skip to content

Commit

Permalink
only copy containerId when darwin OS
Browse files Browse the repository at this point in the history
  • Loading branch information
rcruzper committed Nov 12, 2016
1 parent f135671 commit 27cb170
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: generic
script: bash ./deploy.sh
script: ./deploy.sh
env:
global:
ENCRYPTION_LABEL: 44cecb45b4cf
Expand All @@ -13,4 +13,4 @@ deploy:
file: dps
skip_cleanup: true
on:
tags: true
condition: $TRAVIS_TEST_RESULT == 0
7 changes: 6 additions & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ if git diff-tree --no-commit-id --name-only -r HEAD; then
REPO=`git config remote.origin.url`
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}

# Set config
git config --global user.email "rcruzper@gmail.com"
git config --global user.name "Travis CI"

# Create git tag
GIT_TAG=`git describe --abbrev=0 --tags | awk -F'[.]' '/^v/ {print $1"."$2"."$3+1}'`
export GIT_TAG=`git describe --abbrev=0 --tags | awk -F'[.]' '/^v/ {print $1"."$2"."$3+1}'`
git tag $GIT_TAG -a -m "Generated tag from TravisCI build $TRAVIS_BUILD_NUMBER"

# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc
Expand All @@ -27,4 +31,5 @@ if git diff-tree --no-commit-id --name-only -r HEAD; then
git push $SSH_REPO --tags
else
echo 'dps code does not changed'
exit 1
fi
4 changes: 3 additions & 1 deletion dps
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ if [ -n "$containerId" ]; then
elif [[ "$key" == 'ctrl-e' ]]; then
docker exec -i -t $containerId /bin/bash
else
echo $containerId | tr -d '\n' | pbcopy
if [[ "$OSTYPE" == "darwin"* ]]; then
echo $containerId | tr -d '\n' | pbcopy
fi
echo $containerId
fi
fi

0 comments on commit 27cb170

Please sign in to comment.