opennel-pymanager/.gitlab-ci.yml

125 lines
3.8 KiB
YAML
Raw Normal View History

2018-02-05 22:10:18 +00:00
# Configuration for Continous Integration
#
# Copyright (C) 2017 AleaJactaEst
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Example to execute locally:
# gitlab-runner exec docker linux_test
stages:
- build
- test
2018-02-07 23:39:40 +00:00
- deploy
2018-02-05 22:10:18 +00:00
## Build
linux_source_package:
stage: build
tags:
- Docker
image: amd64/debian:9
script:
# Prepare environment
- apt-get update
- apt-get -y upgrade
- apt-get install -y python3 python3-setuptools python3-virtualenv python3-stdeb python3-all python3-coverage python3-pep8 python3-sphinx python3-pip graphviz python3-bcrypt python3-wheel
2018-02-07 23:39:40 +00:00
# Action
2018-02-05 22:10:18 +00:00
- make sdist
2018-02-05 22:17:05 +00:00
artifacts:
2018-02-05 22:10:18 +00:00
name: "khanat-$(echo $CI_BUILD_REF | head -c 7 )-$CI_PIPELINE_ID-pymanager-package-src"
paths:
- dist
linux_package:
stage: build
tags:
- Docker
image: amd64/debian:9
script:
# Prepare environment
- apt-get update
- apt-get -y upgrade
- apt-get install -y python3 python3-setuptools python3-virtualenv python3-stdeb python3-all python3-coverage python3-pep8 python3-sphinx python3-pip graphviz python3-bcrypt python3-wheel
2018-02-07 23:39:40 +00:00
# Action
2018-02-05 22:10:18 +00:00
- make bdist
2018-02-05 22:17:05 +00:00
artifacts:
2018-02-05 22:10:18 +00:00
name: "khanat-$(echo $CI_BUILD_REF | head -c 7 )-$CI_PIPELINE_ID-pymanager-package"
paths:
- dist
linux_package_wheel:
stage: build
tags:
- Docker
image: amd64/debian:9
script:
# Prepare environment
- apt-get update
- apt-get -y upgrade
- apt-get install -y python3 python3-setuptools python3-virtualenv python3-stdeb python3-all python3-coverage python3-pep8 python3-sphinx python3-pip graphviz python3-bcrypt python3-wheel
2018-02-07 23:39:40 +00:00
# Action
2018-02-05 22:10:18 +00:00
- python3 setup.py bdist_wheel --universal
artifacts:
name: "khanat-$(echo $CI_BUILD_REF | head -c 7 )-$CI_PIPELINE_ID-pymanager-package-whl"
paths:
- dist
expire_in: 1 week
2018-02-07 23:39:40 +00:00
## Test
2018-02-05 22:10:18 +00:00
linux_test:
stage: test
tags:
- Docker
image: amd64/debian:9
script:
# Prepare environment
- apt-get update
- apt-get -y upgrade
2018-02-07 23:39:40 +00:00
- apt-get install -y python3 python3-setuptools python3-virtualenv python3-stdeb python3-all python3-coverage python3-pep8 python3-sphinx python3-pip graphviz python3-bcrypt python3-wheel
# Action
2018-02-05 22:10:18 +00:00
- make test
linux_coverage:
stage: test
tags:
- Docker
image: amd64/debian:9
script:
# Prepare environment
- apt-get update
- apt-get -y upgrade
- apt-get install -y python3 python3-setuptools python3-virtualenv python3-stdeb python3-all python3-coverage python3-pep8 python3-sphinx python3-pip graphviz python3-bcrypt python3-wheel
2018-02-07 23:39:40 +00:00
# Action
2018-02-05 22:10:18 +00:00
- make coverage
2018-02-08 22:54:06 +00:00
# codequality doesn't work
#codequality:
# image: docker:latest
# variables:
# DOCKER_DRIVER: overlay
# services:
# - docker:dind
# script:
# - docker pull codeclimate/codeclimate
# - docker run --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate:0.69.0 init
# - docker run --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate:0.69.0 analyze -f json > codeclimate.json || true
# artifacts:
# paths: [codeclimate.json]
2018-02-07 23:39:40 +00:00
## Deploy
2018-02-05 22:10:18 +00:00