1
0
Fork 0
satnogs-db/.gitlab-ci.yml

88 lines
1.9 KiB
YAML
Raw Normal View History

stages:
- static
- build
- test
- deploy
- trigger
static_js_css:
stage: static
image: node
script:
- npm install -g eslint stylelint
- eslint 'db/static/js/*.js'
- stylelint 'db/static/css/*.css'
static_python:
stage: static
image: python:2.7
before_script:
- pip install tox
script:
- tox -e flake8
build:
stage: build
image: python:2.7
script:
- rm -rf dist
- python setup.py sdist bdist_wheel
artifacts:
expire_in: 1 week
when: always
paths:
- dist
build3:
stage: build
image: python:3.6
script:
- rm -rf dist
- python setup.py sdist bdist_wheel
artifacts:
expire_in: 1 week
when: always
paths:
- dist
test:
stage: test
image: python:2.7
before_script:
- pip install tox
script:
- tox -e deps,pytest
docker:
stage: deploy
image: docker:latest
services:
- docker:dind
before_script:
- apk --update add py-pip
- pip install docker-compose
script:
- docker-compose build --no-cache --pull
- |
[ -z "$CI_REGISTRY_IMAGE" ] || {
docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY
docker tag satnogs-db:latest $CI_REGISTRY_IMAGE/satnogs-db:$CI_COMMIT_REF_NAME
docker push $CI_REGISTRY_IMAGE/satnogs-db:$CI_COMMIT_REF_NAME
}
[ -z "$DOCKERHUB_PASSWORD" ] || {
docker login -u $DOCKERHUB_USER -p $DOCKERHUB_PASSWORD
docker tag satnogs-db:latest librespace/satnogs-db:$CI_COMMIT_REF_NAME
docker push librespace/satnogs-db:$CI_COMMIT_REF_NAME
}
only:
refs:
- master
- dev
trigger:
stage: trigger
image: alpine
before_script:
- apk add --no-cache curl
script:
- for trigger in $PIPELINE_TRIGGERS; do curl -X POST "$trigger"; done
only:
refs:
- master
- dev
variables:
- $PIPELINE_TRIGGERS