Skip to content

Commit

Permalink
Merge pull request #27 from brianhlin/fix-travis-ci-builds
Browse files Browse the repository at this point in the history
Fix Travis CI builds
  • Loading branch information
brianhlin authored Dec 16, 2019
2 parents 8e88db1 + dac9b96 commit 663aaf2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
services:
- docker

env:
- DOCKER_ORG='opensciencegrid' DOCKER_REPOS='xcache stash-cache stash-origin atlas-xcache cms-xcache'

script:
- ./travis/build_docker.sh
- ./travis/test_stashcache_origin.sh
- ./travis/test_stashcache.sh
- ./travis/push_docker.sh
- ./travis/travis-wrapper.sh

branches:
only:
Expand Down
10 changes: 4 additions & 6 deletions travis/build_docker.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/bin/bash -xe
# Script for building and pushing XCache docker images

org='opensciencegrid'
timestamp=`date +%Y%m%d-%H%M`
docker_repos='xcache stash-cache stash-origin atlas-xcache cms-xcache'
timestamp="$1"

for repo in $docker_repos; do
for repo in $DOCKER_REPOS; do
docker build \
-t $org/$repo:fresh \
-t $org/$repo:$timestamp \
-t $DOCKER_ORG/$repo:fresh \
-t $DOCKER_ORG/$repo:$timestamp \
$repo
done

6 changes: 4 additions & 2 deletions travis/push_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ if [[ "${TRAVIS_PULL_REQUEST}" != "false" ]]; then
exit 0
fi

timestamp="$1"

# Credentials for docker push
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin

for repo in $docker_repos; do
for repo in $DOCKER_REPOS; do
for tag in $timestamp fresh; do
docker push $org/$repo:$tag
docker push $DOCKER_ORG/$repo:$tag
done
done
9 changes: 9 additions & 0 deletions travis/travis-wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -xe
# Wrapper script for building and testing XCache container images

timestamp=`date +%Y%m%d-%H%M`

./travis/build_docker.sh $timestamp
./travis/test_stashcache_origin.sh
./travis/test_stashcache.sh
./travis/push_docker.sh $timestamp

0 comments on commit 663aaf2

Please sign in to comment.