Skip to content

Commit

Permalink
Merge pull request #10 from matyasselmeci/deploy
Browse files Browse the repository at this point in the history
Deploy to tarballs and SRPMs to GH releases
  • Loading branch information
matyasselmeci authored Jan 3, 2018
2 parents d4dc6f9 + 656703a commit ad1707c
Show file tree
Hide file tree
Showing 8 changed files with 240 additions and 102 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ lt~obsolete.m4
missing
mkinstalldirs
.*.swp
.vagrant
103 changes: 65 additions & 38 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,66 @@
sudo: required
env:
matrix:
- IMAGE=centos:centos6 TASK=tests COMPONENTS=udt,myproxy,ssh
- IMAGE=centos:centos7 TASK=tests COMPONENTS=udt,myproxy,ssh
# Fedora builds are implemented but are disabled until we decide we
# need them; Travis limits our number of concurrent jobs so we don't
# want more than are necessary.
# - IMAGE=fedora:26 TASK=tests COMPONENTS=udt,myproxy,ssh
# - IMAGE=fedora:27 TASK=tests COMPONENTS=udt,myproxy,ssh
- IMAGE=centos:centos6 TASK=tests COMPONENTS=gram5
- IMAGE=centos:centos7 TASK=tests COMPONENTS=gram5
# The following gram tests failed for all fedora versions:
# nonblocking-register-test.pl, register-callback-test.pl, register-test.pl
# - IMAGE=fedora:26 TASK=tests COMPONENTS=gram5
# - IMAGE=fedora:27 TASK=tests COMPONENTS=gram5
# The 'rpms' task does not run the unit tests (%check sections in RPMs)
# (except on centos 6, where disabling them is not possible),
# because they are already covered in the 'tests' task
- IMAGE=centos:centos6 TASK=rpms COMPONENTS=udt,myproxy,gram
- IMAGE=centos:centos7 TASK=rpms COMPONENTS=udt,myproxy,gram
# Fedora builds are implemented but are disabled until we decide we
# need them; Travis limits our number of concurrent jobs so we don't
# want more than are necessary.
# - IMAGE=fedora:26 TASK=rpms COMPONENTS=udt,myproxy,gram
# - IMAGE=fedora:27 TASK=rpms COMPONENTS=udt,myproxy,gram


services:
- docker

before_install:
- sudo apt-get update
- sleep 5
- sudo docker pull ${IMAGE}

script:
- travis-ci/setup_tasks.sh
# Fedora builds are implemented but are disabled until we decide we
# need them; Travis limits our number of concurrent jobs so we don't
# want more than are necessary.
# The Fedora docker images are "fedora:26" and "fedora:27"

# Also, the following gram tests failed for all fedora versions:
# nonblocking-register-test.pl, register-callback-test.pl, register-test.pl
jobs:
include:

- &run_tests
# Template; subsequent uses modify 'env'
env:
- IMAGE=centos:centos6 TASK=tests COMPONENTS=udt,myproxy,ssh
stage: test
sudo: required
- IMAGE=centos:centos7 TASK=tests COMPONENTS=gram5
services:
- docker

before_install:
- sudo apt-get update
- sleep 5
- sudo docker pull ${IMAGE}

script:
- travis-ci/setup_tasks.sh
- <<: *run_tests
env:
- IMAGE=centos:centos7 TASK=tests COMPONENTS=udt,myproxy,ssh
- <<: *run_tests
env:
- IMAGE=centos:centos6 TASK=tests COMPONENTS=gram5
- <<: *run_tests
env:
- IMAGE=centos:centos7 TASK=tests COMPONENTS=gram5

- stage: deploy
env:
- IMAGE=centos:centos7 TASK=srpms
sudo: required
services:
- docker

before_install:
- sudo apt-get update
- sleep 5
- sudo docker pull ${IMAGE}

script:
- travis-ci/setup_tasks.sh
deploy:
on:
tags: true
all_branches: false
skip_cleanup: true
file_glob: true
provider: releases
overwrite: true
# ^ this doesn't actually work but I'm leaving it in there in
# case it gets fixed later
api_key:
secure: ndqiULdDgGzxuFQmqDmgC6OmtXKLIowqOTJRPSoLCMBIPPbZf68bTcEjbWdwqnTKz9V/YyigWkQO55M/FH5ZzG8Y/olK3NObr/GebGkyCOEDdM4LHL1rt/1kmxENpFZidVO9bxMbkj+cgaJKU9pJ6VJ7jbXYpP6hj2imVm2KQZIAOvynGYFiSleZmgnmqMJw7yRXxaGOtXyHwV8mc17MPVM2dnMUXPEta7RIRJzLy/gInxHnZzQwZ4EDIDhUTxgeeqMVV6AInQJzsg7xUJsgv7IEvYm3bfqZJz5NkYh1izABDJBNDwJac8osaicllhVmLjwr9k2QSLCchyIiR/BzB0ciKqsxBzo6fpF03e1kkiqIxMdLWHLOiWV092OJLjqdrUZReLlnpYf45Uvwv0gQuX9sYAgR9xLunxmyTjXr5WUkqtIPSA8OchSuvbNOIHB9BqJ+rt4Ejt54ZYNtUUdHhqaB3q7PJSdUnbOesoaVqQYgPo6rDuh3wR16kahkhPAslkuTTbYw2b5ZUapaN1fiZpMQfqGdWvaNiIU6Esata05ANoKnu/QORSfZkTydIYEPtROGpDNkC94nTRcfWcxTOySft6cXjB5OyAelnaV6mq6h+lgz4NBNnIOh1yIMenjpgu118p2NmYgZejpf+DtmKpm6RpmJFkcW0AKwe9qcjDk=
file: travis_deploy/*

# vim:ft=yaml:sw=2:sts=2:et
44 changes: 44 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.define "gctbuild"
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.

# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "centos/7"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false


config.vm.network "private_network", type: "dhcp"

config.vm.provision "shell", inline: <<-SHELL
echo "gctbuild.vagrant" > /etc/hostname
yum install -y -d1 git wget
ln -s /vagrant /gct
echo '#!/bin/sh' > /usr/local/bin/run_task
echo 'exec sudo /gct/travis-ci/run_task_inside_docker.sh `id -u vagrant` "$@"' >> /usr/local/bin/run_task
chmod +x /usr/local/bin/run_task
echo 'Run "run_task $TASK [$COMPONENTS]" to do builds or tests.'
echo 'For example, to build binary RPMs, run'
echo ' run_task rpms'
echo 'To run tests for the default build + ssh + gram, run'
echo ' run_task tests ssh,gram'
echo 'See .travis.yml and travis-ci/run_task_inside_docker.sh for more'
echo 'details...'
SHELL
end

18 changes: 9 additions & 9 deletions travis-ci/build_and_test.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#!/bin/bash

IMAGE=$1
COMPONENTS=$2
set -e

id
env | sort
OS=$1
COMPONENTS=$2

cd /gct
root=$(git rev-parse --show-toplevel)
cd "$root"

set +e
args=(--prefix=/gct --enable-silent-rules)
args=(--prefix="$root" --enable-silent-rules)
if [[ $COMPONENTS != *ssh* ]]; then
rm -f prep-gsissh
args+=(--disable-gsi-openssh)
Expand All @@ -19,9 +18,10 @@ if [[ $COMPONENTS == *gram5* ]]; then
else
args+=(--disable-gram5)
fi
set +e
[[ $COMPONENTS == *myproxy* ]] && args+=(--enable-myproxy)
[[ $COMPONENTS == *udt* ]] && args+=(--enable-udt)
[[ $IMAGE == *fedora* ]] && args+=(LIBS='-ldl')
[[ $OS == fedora* ]] && args+=(LIBS='-ldl')
set -e

echo '================================================================================'
Expand All @@ -32,7 +32,7 @@ echo '==========================================================================
time make -j
echo '================================================================================'
time make -j install
export PATH=/gct/bin:$PATH LD_LIBRARY_PATH=/gct/lib:$LD_LIBRARY_PATH
export PATH="$root"/bin:$PATH LD_LIBRARY_PATH="$root"/lib:$LD_LIBRARY_PATH
echo '================================================================================'
time make -j check | tee check.out
echo '================================================================================'
Expand Down
23 changes: 19 additions & 4 deletions travis-ci/make_rpms.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
#!/bin/bash

set -e

usage()
{
echo "Usage: $0 [<options>]"
echo
echo "Options:"
echo " -h This message"
echo " -C Skip %check when building RPMs"
echo " -s Build SRPMs only"
echo " -d [dist] %dist tag"
}


umask 022


rootdir=$(git rev-parse --show-toplevel)
packagingdir=$rootdir/packaging
root=$(git rev-parse --show-toplevel)
packagingdir=$root/packaging

cd "$packagingdir"

fedoradir=$packagingdir/fedora
tarballdir=$rootdir/package-output
tarballdir=$root/package-output
topdir=$packagingdir/rpmbuild
globusversion=
nocheck=
srpmsonly=false
dist=.gct

if ! ls "$tarballdir"/*.tar.gz >/dev/null; then
echo >&2 "No tarballs found in package-output directory"
Expand All @@ -32,7 +37,7 @@ if ! ls "$tarballdir"/*.tar.gz >/dev/null; then
fi


while getopts hC i; do
while getopts hCsd: i; do
case "$i" in
h)
usage
Expand All @@ -41,6 +46,12 @@ while getopts hC i; do
C)
nocheck=1
;;
s)
srpmsonly=true
;;
d)
dist=$OPTARG
;;
esac
done

Expand All @@ -65,6 +76,7 @@ remove_installed_gct_rpms()
cat <<EOF >> "$topdir/.rpmmacros"
%_topdir $topdir
%_tmppath $topdir/tmp
%dist $dist
# Override this, as it breaks documentation dependencies in some of the builds
%_excludedocs 0
EOF
Expand All @@ -83,6 +95,9 @@ for rpmname in ${packages[*]}; do
rpmbuild -bs --nodeps "$fedoradir/$rpmname.spec";
done

if $srpmsonly; then
exit 0
fi

build_all_for_target()
{
Expand Down
5 changes: 2 additions & 3 deletions travis-ci/make_source_tarballs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ tmpfile=$(mktemp)
trap "rm -f $tmpfile" EXIT


set -x
if [[ ! -f Makefile ]]; then
if [[ ! -f configure ]]; then
echo '================================================================================'
Expand All @@ -37,11 +36,11 @@ rm -rf package-output
mkdir package-output
echo '================================================================================'
sed -i 's/gridftp_hdfs-dist//' Makefile
time make tarballs
time make -j1 tarballs

echo '================================================================================'
pushd "$root/myproxy/oauth/source"
time python setup.py sdist
mv dist/*.tar.gz $root/package-output/
mv dist/*.tar.gz "$root/package-output/"
popd

Loading

0 comments on commit ad1707c

Please sign in to comment.