Skip to content

Commit

Permalink
Pull deploy script out to own file
Browse files Browse the repository at this point in the history
  • Loading branch information
hdpe committed Jan 7, 2021
1 parent 52e3e50 commit 1212d4c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
11 changes: 1 addition & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,5 @@ deploy:
skip_cleanup: true
overwrite: true
- provider: script
script: >-
bash -c 'docker build -f circleci.dockerfile -t esup-circleci linux/amd64 &&
{
docker tag esup-circleci hdpe/esup-circleci:latest || exit 1;
if [ -n "${TRAVIS_TAG}" ]; then
docker tag esup-circleci hdpe/esup-circleci:${TRAVIS_TAG} || exit 1;
fi
} &&
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin &&
docker push -a hdpe/circleci;'
script: bash .travis/deploy-circleci-image
skip_cleanup: true
19 changes: 19 additions & 0 deletions .travis/deploy-circleci-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1

docker build -f ../circleci.dockerfile -t esup-circleci ../linux/amd64 &&
{
docker tag esup-circleci hdpe/esup-circleci:latest || exit 1

if [ -n "${TRAVIS_TAG}" ]; then
docker tag esup-circleci "hdpe/esup-circleci:${TRAVIS_TAG}" || exit 1
fi
} &&
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin &&
{
docker push hdpe/circleci || exit 1

if [ -n "${TRAVIS_TAG}" ]; then
docker push "hdpe/esup-circleci:${TRAVIS_TAG}" || exit 1
fi
}

0 comments on commit 1212d4c

Please sign in to comment.