Skip to content

Commit

Permalink
switch to mktemp and cd into dir before posting jenkins status
Browse files Browse the repository at this point in the history
  • Loading branch information
jredbeard committed Feb 1, 2017
1 parent a84b07d commit 1e1c3cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion ciscripts/buildfailure.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash
cd $BUILD_SPACE
curl -XPOST -H "Authorization: token $GITHUB_SECRET" https://api.github.com/repos/steemit/steem/statuses/$(git rev-parse HEAD) -d "{
\"state\": \"failure\",
\"target_url\": \"${BUILD_URL}\",
\"description\": \"JenkinsCI reports the build has failed!\",
\"context\": \"jenkins-ci-steemit\"
}"
rm -rf $WORKSPACE/${GIT_BRANCH#*/}
rm -rf $WORKSPACE/$BUILD_SPACE
# make docker cleanup after itself and delete all exited containers
sudo docker rm -v $(docker ps -a -q -f status=exited) || true
6 changes: 3 additions & 3 deletions ciscripts/buildscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ if [[ $IMAGE_NAME == "steemit/steem:stable" ]] ; then
IMAGE_NAME="steemit/steem:latest"
fi
# switch workspace into directory used for branch
mkdir ${GIT_BRANCH#*/}
cp -a temp-repo-folder/. ${GIT_BRANCH#*/}
export BUILD_SPACE=`mktemp -d`
cp -a temp-repo-folder/. $BUILD_SPACE
rm -rf temp-repo-folder/*
cd ${GIT_BRANCH#*/}
cd $BUILD_SPACE
sudo docker build -t=$IMAGE_NAME .
sudo docker login --username=$DOCKER_USER --password=$DOCKER_PASS
sudo docker push $IMAGE_NAME
Expand Down
4 changes: 2 additions & 2 deletions ciscripts/buildsuccess.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#/bin/bash
#testcommit
cd $BUILD_SPACE
curl -XPOST -H "Authorization: token $GITHUB_SECRET" https://api.github.com/repos/steemit/steem/statuses/$(git rev-parse HEAD) -d "{
\"state\": \"success\",
\"target_url\": \"${BUILD_URL}\",
\"description\": \"Jenkins-CI reports build succeeded!!\",
\"context\": \"jenkins-ci-steemit\"
}"
rm -rf $WORKSPACE/${GIT_BRANCH#*/}
rm -rf $WORKSPACE/$BUILD_SPACE
# make docker cleanup after itself and delete all exited containers
sudo docker rm -v $(docker ps -a -q -f status=exited) || true

0 comments on commit 1e1c3cb

Please sign in to comment.