Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
services:
- docker

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

branches:
only:
Expand Down
13 changes: 0 additions & 13 deletions travis/build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,3 @@ for repo in $docker_repos; do
$repo
done

if [[ "${TRAVIS_PULL_REQUEST}" != "false" ]]; then
echo "DockerHub deployment not performed for pull requests"
exit 0
fi

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

for repo in $docker_repos; do
for tag in $timestamp fresh; do
docker push $org/$repo:$tag
done
done
16 changes: 16 additions & 0 deletions travis/push_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash -xe
# Script for pushing XCache docker images

if [[ "${TRAVIS_PULL_REQUEST}" != "false" ]]; then
echo "DockerHub deployment not performed for pull requests"
exit 0
fi

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

for repo in $docker_repos; do
for tag in $timestamp fresh; do
docker push $org/$repo:$tag
done
done
3 changes: 3 additions & 0 deletions travis/stashcache-cache-config/90-docker-ci.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pss.origin localhost:1094
xrd.port 8000

1 change: 1 addition & 0 deletions travis/stashcache-cache-config/cache-env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
XC_ROOTDIR=/tmp
4 changes: 4 additions & 0 deletions travis/stashcache-origin-config/10-origin-authfile.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Manually force the authentication to be public
set StashOriginPublicAuthfile = /etc/xrootd/public-origin-authfile
#set originexport = /stashcache-travis-ci-test
all.export /stashcache-travis-ci-test
1 change: 1 addition & 0 deletions travis/stashcache-origin-config/authfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
u * /stashcache-travis-ci-test rl
Empty file.
1 change: 1 addition & 0 deletions travis/stashcache-origin-config/origin-env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
XC_ORIGINEXPORT=/tmp
2 changes: 2 additions & 0 deletions travis/stashcache-origin-config/test_file
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This is a test file for Docker CI of Stashcache origin and cache images.

1 change: 1 addition & 0 deletions travis/stashcache-travis-ci-test/testfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a test file for travis ci stashcache docker test
Comment thread
efajardo marked this conversation as resolved.
18 changes: 18 additions & 0 deletions travis/test_stashcache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash -xe
# Script for testing StashCache docker images


docker run --rm \
--network="host" \
--env-file=$(pwd)/travis/stashcache-cache-config/cache-env \
--volume $(pwd)/travis/stashcache-cache-config/90-docker-ci.cfg:/etc/xrootd/config.d//90-docker-ci.cfg \
--name test_cache opensciencegrid/stash-cache:fresh &
docker ps
sleep 20

online_md5="$(curl -sL http://localhost:8000/stashcache-travis-ci-test/test_file | md5sum | cut -d ' ' -f 1)"
local_md5="$(md5sum $(pwd)/travis/stashcache-origin-config/test_file | cut -d ' ' -f 1)"
if [ "$online_md5" != "$local_md5" ]; then
echo "MD5sums do not match on stashcache"
exit 1
fi
21 changes: 21 additions & 0 deletions travis/test_stashcache_origin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash -xe
# Script for testing StashCache docker images


docker run --rm \
--network="host" \
--env-file=$(pwd)/travis/stashcache-origin-config/origin-env \
--volume $(pwd)/travis/stashcache-origin-config/empty_stash-origin-auth.conf:/etc/supervisord.d/stash-origin-auth.conf \
--volume $(pwd)/travis/stashcache-origin-config/10-origin-authfile.cfg:/etc/xrootd/config.d/10-origin-authfile.cfg \
--volume $(pwd)/travis/stashcache-origin-config/authfile:/etc/xrootd/public-origin-authfile \
--volume $(pwd)/travis/stashcache-origin-config/test_file:/tmp/stashcache-travis-ci-test/test_file \
--name test_origin opensciencegrid/stash-origin:fresh &
docker ps
sleep 20

online_md5="$(curl -sL http://localhost:1094/stashcache-travis-ci-test/test_file | md5sum | cut -d ' ' -f 1)"
local_md5="$(md5sum $(pwd)/travis/stashcache-origin-config/test_file | cut -d ' ' -f 1)"
if [ "$online_md5" != "$local_md5" ]; then
echo "MD5sums do not match on origin"
exit 1
fi