Skip to content

Commit a1d4e9c

Browse files
committed
Enforce deploy/push.sh on upstream master
1 parent e707389 commit a1d4e9c

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ env:
2727
- RELEASE_TESTING=0
2828
- COVERAGE=1
2929
- DOCKER_IMAGE_NAME=metacpan-grep-front-end
30+
# only deploy on the upstream repo
31+
- DEPLOY_REPO_SLUG=metacpan/metacpan-grep-front-end
3032
# matrix:
3133

3234
before_install:

deploy/push.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,24 @@
22

33
DEPLOY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
44

5+
if [[ "x${DEPLOY_REPO_SLUG}" != "x${TRAVIS_REPO_SLUG}" ]]; then
6+
echo "skip push.sh: only deploy on ${DEPLOY_REPO_SLUG} repo.";
7+
exit;
8+
fi
9+
10+
if [[ "x$DOCKER_HUB_USER" == "x" ]]; then
11+
echo "DOCKER_HUB_USER env is not defined.";
12+
exit 1;
13+
fi
14+
15+
if [[ "x$DOCKER_HUB_PASSWD" == "x" ]]; then
16+
echo "DOCKER_HUB_PASSWD env is not defined.";
17+
exit 1;
18+
fi
19+
520
source "${DEPLOY_DIR}/vars.sh"
621

722
cd "${DEPLOY_DIR}/.."
823

924
docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWD"
10-
1125
docker push "$DOCKER_HUB_NAME"

0 commit comments

Comments
 (0)