Skip to content

Commit

Permalink
Update .travis.yml with deployment stage
Browse files Browse the repository at this point in the history
  • Loading branch information
emi80 committed Jul 21, 2020
1 parent 8ffdfa8 commit 8640ffb
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 35 deletions.
73 changes: 38 additions & 35 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,46 @@
language: python
dist: bionic

python:
- "2.7"
- "3.5"
- "3.6"
- "3.7"
- "3.8"

- '2.7'
- '3.5'
- '3.6'
- '3.7'
- '3.8'
jobs:
include:
- stage: release
env:
- secure: Q51zmekFkaAc52qj4PJusD8ovl72rkrzCxNgD4SdYtJTpYesi/ZXDKD7bSjjZeV288nM4GGYdEz1DH1VhRm+6BltpdYa+Hx8niTZGR/scBUcO9O/99AlVokpVbaHZ45XbkpqshUjhHL3HN2jZvzoPC70vr5sWqNOOMm7d9DkBw89M+UGQ45t9aUVt2bswNmCHekApOowUw/3COJ1ILA04nIBX/fyqCRc86fQHp5ggbMDY67R5k9TJ8Id+NWyael5mcomCo9kJDgMzJRDdRYUqyTMqF7awqew1HUXCb19LKFJufM/m5Mewdkq43oM/lYzQtO/3X4Gjjzq1vqWPF80d+6mW55c38axZZv7KcnWCz2h52To+OQCvpQJdKxCcZFlegO26nDh/RNAaVhIP4dsQtQ8Bm6yzgocC2qgauBAXrLI+xR37GdqZF4LKcXxoTnZDOpRV84lb4gvbzWUQr+01sZvw1K0gkr/P3OTHeYTHDihXc0YmX/pB/99/gTwtgljTQ1abJwq7H9O8NaNUcO51szsAHsbCxkEgG4azL7RTCBO5ZYFGjZqUmpHI7D0xZlMAWjz3iOmJXeVBMNIIa99SO2EaQM3d7bmJ0LhtAhXii/AMkrj7ovnElhJEOUwDpvEKWZQi06NTSww8M0PlImrBEyp7o0uXsCoXNcUpuQiVhc=
- secure: koAlSZJ860rJhlnPhoxYLbLdPNeIs+9fAL+4UYRYL/694VclQHgknkFcrItSDWDWDHfokVo1GUi1uywNXr5jahy4oQ9vB0N5jUn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KwCzIculC3Mz7ShW2dw5UgImxTUl3nqDE219EusvIUgTdL3uRBaUYU91AjZEj766Ve5vO+2Nx2crUci44bJOyrodRsWJX1Qr0JuSCa/PgG9GLHQxMeqIO4+OH3h6+1y1o3wM1jqn/WapzYZzcWKrr0QjVsr5rX6O4pYUg9Gj1EKX0Hm55xCeFTkgbkpKs9zw=
install:
- go get github.com/github-release/github-release
script:
- bash ci/release.sh
if: tag =~ ^v
env:
global:
- SAMTOOLS_VER=1.3.1
- SAMTOOLS_VER=1.3.1
jobs:
- R_VER=3.3.2 GGPLOT_VER=2.2.1

- R_VER=3.3.2 GGPLOT_VER=2.2.1
install:
- sudo apt update
# Better to have same version as the env python
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- source "$HOME/miniconda/etc/profile.d/conda.sh"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda config --add channels defaults
- conda config --add channels bioconda
- conda config --add channels conda-forge

# For debugging
- conda info -a

- conda create -q -n test-env samtools=$SAMTOOLS_VER r-base=$R_VER r-ggplot2=$GGPLOT_VER r-gridextra r-data.table r-svglite
- conda activate test-env
- pip install tox-travis

- sudo apt update
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
-O miniconda.sh; else wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
-O miniconda.sh; fi
- bash miniconda.sh -b -p $HOME/miniconda
- source "$HOME/miniconda/etc/profile.d/conda.sh"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda config --add channels defaults
- conda config --add channels bioconda
- conda config --add channels conda-forge
- conda info -a
- conda create -q -n test-env samtools=$SAMTOOLS_VER r-base=$R_VER r-ggplot2=$GGPLOT_VER
r-gridextra r-data.table r-svglite
- conda activate test-env
- pip install tox-travis
script:
- tox
- bash ci/run.sh
- tox
- bash ci/run.sh
35 changes: 35 additions & 0 deletions ci/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
set -e
set -u

TAG=$(git describe)
CURRENT_VERSION=$(git describe | sed 's/^v//')
PREVIOUS_VERSION=$(git describe --abbrev=0 HEAD^)

# Build Docker image and tag
#
docker build -t guigolab/ggsashimi:$CURRENT_VERSION -f docker/Dockerfile .

# Run ci script in Docker container
#
docker run --entrypoint '/bin/bash' -v $PWD:$PWD -w $PWD guigolab/ggsashimi:$CURRENT_VERSION ci/run.sh

# Login to Docker Hub and push released versions
#
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker tag guigolab/ggsashimi:$CURRENT_VERSION guigolab/ggsashimi:latest
for t in latest $CURRENT_VERSION; do
docker push "guigolab/ggsashimi:${t}"
done

# Get changelog and make release
#
git log --oneline --pretty="- %s" ...$PREVIOUS_VERSION | \
github-release release \
--user guigolab \
--repo ggsashimi \
--tag $TAG \
--name "Version $CURRENT_VERSION" \
--description - \
--draft \
--pre-release

0 comments on commit 8640ffb

Please sign in to comment.