Skip to content

Commit

Permalink
changes (aws#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
tornasole-dev authored and rahul003 committed Aug 2, 2019
1 parent 4c9358f commit b4df3f6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
6 changes: 5 additions & 1 deletion config/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ phases:
- if [ $framework = "tensorflow" ] ; then cd $CODEBUILD_SRC_DIR_tornasole_tf && git checkout $TF_BRANCH && chmod +x config/tests.sh && ./config/tests.sh && mkdir -p $TF_PATH && cp ./dist/*.whl $TF_PATH && cd .. ; fi
- if [ $framework = "mxnet" ] ; then cd $CODEBUILD_SRC_DIR_tornasole_mxnet && git checkout $MXNET_BRANCH && chmod +x config/tests.sh && ./config/tests.sh && mkdir -p $MXNET_PATH && cp ./dist/*.whl $MXNET_PATH && cd .. ; fi
- if [ "$CODEBUILD_GIT_BRANCH" = "master" ] && [ "$CODEBUILD_WEBHOOK_EVENT" = "PUSH" ] ; then aws s3 cp $CODEBUILD_SRC_DIR/wheels s3://tornasolecodebuildtest/ --recursive ; fi
- if [ "$CODEBUILD_BUILD_SUCCEEDING" -eq 0 ]; then echo "ERROR $CODEBUILD_BUILD_ARN \n ERROR $CODEBUILD_LOG_PATH" ; fi

post_build:
commands:
- if [ "$CODEBUILD_BUILD_SUCCEEDING" -eq 0 ]; then echo "ERROR BUILD FAILED , ACCESS BUILD LOGS THROUGH GITHUB OR TROUGH THE LINK:$CODEBUILD_BUILD_URL" ; fi
- if [ "$CODEBUILD_BUILD_SUCCEEDING" -eq 1 ]; then echo "INFO BUILD SUCCEEDED !!! , ACCESS BUILD LOGS THROUGH GITHUB OR TROUGH THE LINK:$CODEBUILD_BUILD_URL" ; fi
19 changes: 19 additions & 0 deletions config/get-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ rules_repo="tornasole_rules"
tf_repo="tornasole_tf"
mxnet_repo="tornasole_mxnet"


if [ -z "${CODEBUILD_BUILD_IMAGE##*tensorflow*}" ] ; then export framework="tensorflow"; else export framework="mxnet" ; fi


export CODEBUILD_GIT_BRANCH="$(git symbolic-ref HEAD --short 2>/dev/null)"
if [ "$CODEBUILD_GIT_BRANCH" = "" ] ; then
CODEBUILD_GIT_BRANCH="$(git branch -a --contains HEAD | sed -n 2p | awk '{ printf $1 }')";
Expand Down Expand Up @@ -102,3 +104,20 @@ export CORE_BRANCH ;
export RULES_BRANCH ;
export MXNET_BRANCH ;




export CODEBUILD_ACCOUNT_ID=$(aws sts get-caller-identity --query 'Account' --output text)
export CODEBUILD_PROJECT=${CODEBUILD_BUILD_ID%:$CODEBUILD_LOG_PATH}

export CODEBUILD_BUILD_URL=https://$AWS_DEFAULT_REGION.console.aws.amazon.com/codebuild/home?region=$AWS_DEFAULT_REGION#/builds/$CODEBUILD_BUILD_ID/view/new

echo "INFO =============================BUILD STARTED==================================="
echo "INFO =============================Build details========================== ::"
echo "INFO CODEBUILD_CURRENT_BUILD_URL = $CODEBUILD_BUILD_URL"
echo "INFO CURRENT_REPO_NAME = $CURRENT_REPO_NAME"
echo "INFO CURRENT_COMMIT_DATE = $CURRENT_COMMIT_DATE"
echo "INFO CODEBUILD_ACCOUNT_ID = $CODEBUILD_ACCOUNT_ID"
echo "INFO CURRENT_GIT_BRANCH = $CODEBUILD_GIT_BRANCH"
#echo "INFO CURRENT_GIT_COMMIT = $CODEBUILD_GIT_COMMIT"
echo "INFO CODEBUILD_PROJECT = $CODEBUILD_PROJECT"

0 comments on commit b4df3f6

Please sign in to comment.