Skip to content
Snippets Groups Projects
Unverified Commit ed7056f5 authored by Tiago Grego's avatar Tiago Grego Committed by GitHub
Browse files

Merge pull request #443 from Ensembl/gitlabci_dependents_on_travis

Gitlab CI: enable triggering of dependent builds on Travis
parents ce57e0d5 a79e9846
No related branches found
No related tags found
No related merge requests found
stages: #
- test # Test-job template
- posttest #
services: .ensembl_test_template:
- mysql:5.6 image: dockerhub.ebi.ac.uk/ensembl-infrastructure/ensembl-ci-docker-images:${PERL_VERSION}
variables: services:
# FIXME: set some password for both users - mysql:5.6
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_USER: "travis"
MYSQL_PASSWORD: ""
USER: "gitlabci"
# Run before each job not defining its own before_script variables:
before_script: # FIXME: set some password for both users
- apt-get update MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
- apt-get install -y build-essential cpanminus git MYSQL_USER: "travis"
- apt-get install -y libmysqlclient-dev mysql-client || apt-get install -y default-libmysqlclient-dev default-mysql-client MYSQL_PASSWORD: ""
- apt-get install -y libssl-dev sqlite3 USER: "gitlabci"
- git clone --branch=master --depth=1 https://github.com/Ensembl/ensembl-test.git
- git clone --branch=master --depth=1 https://github.com/Ensembl/ensembl-io.git before_script:
- git clone --branch=master --depth=1 https://github.com/Ensembl/ensembl-variation.git - apt-get update
- git clone --branch=master --depth=1 https://github.com/Ensembl/ensembl-compara.git - apt-get install -y build-essential cpanminus git
- git clone --branch=release-1-6-924 --depth=1 https://github.com/bioperl/bioperl-live.git - apt-get install -y default-libmysqlclient-dev default-mysql-client
- cpanm -v --installdeps --notest . - apt-get install -y libssl-dev sqlite3
- ( cd ensembl-test && cpanm -v --installdeps --notest . ) - git clone --branch=master --depth=1 https://github.com/Ensembl/ensembl-test.git
# - ( cd ensembl-io && cpanm -v --installdeps --notest . ) - git clone --branch=master --depth=1 https://github.com/Ensembl/ensembl-io.git
# - ( cd ensembl-variation && cpanm -v --installdeps --notest . ) - git clone --branch=master --depth=1 https://github.com/Ensembl/ensembl-variation.git
- ( cd ensembl-compara && cpanm -v --installdeps --notest . ) - git clone --branch=master --depth=1 https://github.com/Ensembl/ensembl-compara.git
- ( cd misc-scripts/xref_mapping && cpanm -v --installdeps --notest . ) - git clone --branch=release-1-6-924 --depth=1 https://github.com/bioperl/bioperl-live.git
- cpanm -n Devel::Cover::Report::Coveralls - cpanm -v --installdeps --notest .
- cpanm -n DBD::SQLite - ( cd ensembl-test && cpanm -v --installdeps --notest . )
- cp travisci/MultiTestDB.conf.gitlabci.mysql modules/t/MultiTestDB.conf.mysql # - ( cd ensembl-io && cpanm -v --installdeps --notest . )
- cp travisci/MultiTestDB.conf.travisci.SQLite modules/t/MultiTestDB.conf.SQLite # - ( cd ensembl-variation && cpanm -v --installdeps --notest . )
- mysql -u root -h mysql -e 'GRANT ALL PRIVILEGES ON *.* TO "travis"@"%"' - ( cd ensembl-compara && cpanm -v --installdeps --notest . )
- ( cd misc-scripts/xref_mapping && cpanm -v --installdeps --notest . )
- cpanm -n Devel::Cover::Report::Coveralls
- cpanm -n DBD::SQLite
- cp travisci/MultiTestDB.conf.gitlabci.mysql modules/t/MultiTestDB.conf.mysql
- cp travisci/MultiTestDB.conf.travisci.SQLite modules/t/MultiTestDB.conf.SQLite
- mysql -u root -h mysql -e 'GRANT ALL PRIVILEGES ON *.* TO "travis"@"%"'
# #
# Test jobs # Test jobs
...@@ -41,8 +43,9 @@ before_script: ...@@ -41,8 +43,9 @@ before_script:
test:perl5.14-sqlite: test:perl5.14-sqlite:
stage: test stage: test
image: perl:5.14-threaded extends: .ensembl_test_template
variables: variables:
PERL_VERSION: "5.14"
COVERALLS: "false" COVERALLS: "false"
DB: "sqlite" DB: "sqlite"
script: script:
...@@ -50,8 +53,9 @@ test:perl5.14-sqlite: ...@@ -50,8 +53,9 @@ test:perl5.14-sqlite:
test:perl5.30-mysql: test:perl5.30-mysql:
stage: test stage: test
image: perl:5.30-threaded extends: .ensembl_test_template
variables: variables:
PERL_VERSION: "5.30"
# Note: relies on the secret variable COVERALLS_REPO_TOKEN for report uploads to work # Note: relies on the secret variable COVERALLS_REPO_TOKEN for report uploads to work
COVERALLS: "true" COVERALLS: "true"
DB: "mysql" DB: "mysql"
...@@ -62,24 +66,45 @@ test:perl5.30-mysql: ...@@ -62,24 +66,45 @@ test:perl5.30-mysql:
# Triggers for dependent builds # Triggers for dependent builds
# #
# FIXME: # The template. It doesn't presently support PRs before they are
# - only partly tested so far # merged (would need extended run condition and better selection of
# - doesn't support PRs before they are merged # downstream branches) - but then again, we do not trigger dependent
# (would need extended run condition and better selection of downstream branches) # builds for PRs on Travis either.
.dependent_template: .dependent_template:
stage: posttest stage: test
# We want this to run even if any test jobs fail
when: always
only: only:
- master - master
- /^release/\d+$/ - /^release/\d+$/
# Actual trigger jobs
# ensembl-rest; disabled for now because that repo a) hasn't got
# GitLab-CI config yet, and b) is still on the list in
# trigger-dependent-build.sh.
.test:trigger_rest:
extends: .dependent_template
trigger: trigger:
project: $DEPENDENT_PROJECT project: ensembl-gh-mirror/ensembl-rest
# Use the same branch as in this project # Use the same branch as in this project
branch: $CI_COMMIT_REF_NAME branch: ${CI_COMMIT_REF_NAME}
# Example trigger job using the above, disabled for obvious reasons # Dependent builds on Travis
.post:trigger_foo: # Relies on the secret variable TRAVIS_AUTH_TOKEN to actually work,
# moreover the account associated with the token must have write
# access to *all* dependent repositories; to be exact what it needs
# is the Travis 'create_request' permission but Travis permissions are
# generated from GitHub ones and it seems that in order to have
# 'create_request' on the latter one requires 'write' on the former.
test:trigger_travis:
extends: .dependent_template extends: .dependent_template
image: alpine:3.10
variables: variables:
DEPENDENT_PROJECT: ensembl-gh-mirror/ensembl-foo AUTH_TOKEN: ${TRAVIS_AUTH_TOKEN}
TRAVIS_REPO_SLUG: ${CI_PROJECT_PATH}
TRAVIS_BRANCH: ${CI_COMMIT_REF_NAME}
TRAVIS_COMMIT: ${CI_COMMIT_SHA}
# Safe as long as run conditions above do not include merge requests
TRAVIS_PULL_REQUEST: "false"
script:
- apk add --no-cache bash curl python3
- ${CI_PROJECT_DIR}/travisci/trigger-dependent-build.sh
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment