Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix script for jenkins #1908

Merged
merged 2 commits into from
Oct 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions scripts/ci/update-assets.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
#!/bin/bash

if [ "$CIRCLECI" == "true" ]; then
if [[ ! -z $CIRCLE_PULL_REQUEST ]] ; then export CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}" ; fi
REPO=$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
if [[ ! -z $CIRCLE_PULL_REQUEST ]] ; then
CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}"
REPO=$CIRCLE_PULL_REQUEST
REPO=${REPO##https://github.com/}
REPO=${REPO%%/pull/$CIRCLE_PR_NUMBER}
else
REPO=$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
fi
BRANCH=${CIRCLE_BRANCH:-$CIRCLE_TAG}
PR_NUMBER=${CIRCLE_PR_NUMBER:-false}
elif [ "$TRAVIS" == "true" ]; then
REPO=$TRAVIS_REPO_SLUG
BRANCH=${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}
PR_NUMBER=$TRAVIS_PULL_REQUEST
elif [[ -n $BUILD_NUMBER ]]; then
echo "CHANGE_ID=$CHANGE_ID"
echo "CHANGE_URL=$CHANGE_URL"
REPO=${CHANGE_URL##https://github.com/}
if [[ ! -z $CHANGE_ID ]] ; then
REPO=${REPO%%/pull/$CHANGE_ID}
fi
PR_NUMBER=${CHANGE_ID:-false}
BRANCH=$BRANCH_NAME
fi

REPOSITORY_OWNER=monicahq/monica
Expand Down Expand Up @@ -44,7 +63,6 @@ if [ -z "${ASSETS_USERNAME:-}" ]; then
echo " ~ yarn run production"
exit 2
fi
echo "Configure $ASSETS_USERNAME:$ASSETS_EMAIL"
git config user.email $ASSETS_EMAIL
git config user.name $ASSETS_USERNAME
git commit -m "chore(assets): Update assets"
Expand Down