Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
buildgrid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
Show more breadcrumbs
BuildGrid
buildgrid
Commits
b31ce79c
Commit
b31ce79c
authored
6 years ago
by
Martin Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
.gitlab-ci.yml: Fix and refactor the whole pipeline
parent
e21366e1
No related branches found
No related tags found
No related merge requests found
Pipeline
#49079719
failed
6 years ago
Stage: test
Stage: post
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+56
-52
56 additions, 52 deletions
.gitlab-ci.yml
with
56 additions
and
52 deletions
.gitlab-ci.yml
+
56
−
52
View file @
b31ce79c
# Use a debian image with python 3.5 (and pip3) pre-installed
# Debian Stretch base image with python 3.5:
#
image
:
python:3.5-stretch
variables
:
BGD
:
bgd
stages
:
-
test
-
post
-
deploy
before_script
:
-
python3 -m pip install --upgrade setuptools pip
-
export PATH=~/.local/bin:${PATH}
-
python3 -m pip install --user --editable ".[tests]"
# Templates and global variables.
#
variables
:
BGD
:
"
${CI_PROJECT_DIR}/env/bin/bgd"
PYTHON
:
"
${CI_PROJECT_DIR}/env/bin/python"
.build-template
:
before_script
:
&install-base
-
/usr/bin/python3 -m venv env
# Creates a virtual environment
-
${PYTHON} -m pip --cache-dir=.pip install --upgrade setuptools pip wheel
-
${PYTHON} -m pip --cache-dir=.pip install --editable ".[auth,docs,tests]"
cache
:
paths
:
-
.pip
.tests-template
:
&linux-tests
# Test stage, build and test the code.
#
unit-tests
:
stage
:
test
variables
:
PYTEST_ADDOPTS
:
"
--color=yes"
extends
:
.build-template
script
:
-
python3 -m pip install --user --editable ".[auth]"
-
python3 setup.py test
-
${PYTHON} setup.py test
after_script
:
-
mkdir -p coverage/
-
cp .coverage coverage/coverage."${CI_JOB_NAME}"
variables
:
PYTEST_ADDOPTS
:
"
--color=yes"
artifacts
:
paths
:
-
coverage/
-
coverage/
.run-
dummy-
job-template
:
&dummy-job
dummy-
tests
:
stage
:
test
extends
:
.build-template
script
:
-
${BGD} server start data/config/default.conf &
-
sleep
1
# Allow server to boot
-
sleep
1
# Allow
s
server to boot
-
${BGD} bot dummy &
-
${BGD} cas upload-dummy
-
${BGD} execute request-dummy --wait-for-completion
# Test stage, build and test the code.
#
tests-debian-stretch
:
<<
:
*linux-tests
run-dummy-job-debian
:
<<
:
*dummy-job
buildbox-e2e
:
image
:
registry.gitlab.com/buildgrid/buildbox/buildbox-e2e:latest
e2e-tests
:
stage
:
test
before_script
:
[]
image
:
registry.gitlab.com/buildgrid/buildbox/buildbox-e2e:latest
script
:
-
BUILDGRID_SOURCE_ROOT=`pwd` end-to-end-test.sh
# Post-build stage, documentation, coverage report...
#
documentation
:
stage
:
post
extends
:
.build-template
script
:
-
apt-get update && apt-get install -y graphviz
-
python3 -m pip install --user --editable ".[docs]"
-
make -C docs html
-
mkdir -p documentation/
-
cp -a docs/build/html/. documentation/
artifacts
:
paths
:
-
documentation/
-
documentation/
coverage
:
stage
:
post
extends
:
.build-template
dependencies
:
-
tests-debian-stretch
-
unit-tests
coverage
:
'
/TOTAL
+\d+
+\d+
+(\d+\.\d+)%/'
script
:
-
python3 -m pip install --user --editable ".[tests]"
-
cd coverage/
-
ls -l .
-
python3 -m coverage combine --rcfile=../.coveragerc --append coverage.*
-
python3 -m coverage html --rcfile=../.coveragerc --directory .
-
python3 -m coverage report --rcfile=../.coveragerc --show-missing
-
python3 -m coverage erase --rcfile=../.coveragerc
-
cd coverage/ && ls -la .
-
${PYTHON} -m coverage combine --rcfile=../.coveragerc --append coverage.*
-
${PYTHON} -m coverage html --rcfile=../.coveragerc --directory .
-
${PYTHON} -m coverage report --rcfile=../.coveragerc --show-missing
-
${PYTHON} -m coverage erase --rcfile=../.coveragerc
artifacts
:
paths
:
-
coverage/
-
coverage/
# Deployement stage, only for merges which land on master branch.
#
pages
:
stage
:
deploy
dependencies
:
-
coverage
-
documentation
-
coverage
-
documentation
script
:
-
mkdir -p public/coverage/
-
cp -a coverage/* public/coverage/
-
ls -la public/coverage/
-
cp -a documentation/* public/
-
ls -la public/
-
mkdir -p public/coverage/
-
cp -a coverage/* public/coverage/
-
ls -la public/coverage/
-
cp -a documentation/* public/
-
ls -la public/
artifacts
:
paths
:
-
public/
-
public/
only
:
-
master
-
master
trigger
-buildbox-e2e-rebuild
:
trigger
s
:
stage
:
deploy
variables
:
GIT_STRATEGY
:
none
script
:
before_script
:
-
apt-get update && apt-get install -y curl
script
:
-
curl --request POST --form "token=$CI_JOB_TOKEN" --form ref=master https://gitlab.com/api/v4/projects/buildgrid%2Fbuildbox%2Fbuildbox-e2e/trigger/pipeline
variables
:
GIT_STRATEGY
:
none
only
:
-
master
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment