Skip to content

Commit

Permalink
Merge pull request #2 from kiwicom/aexvir/gitlab-ci
Browse files Browse the repository at this point in the history
Move CI to GitLab.com
  • Loading branch information
aexvir committed Nov 23, 2018
2 parents 8902842 + 73b20d6 commit 2bc8094
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 66 deletions.
78 changes: 54 additions & 24 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,61 @@
stages:
- build
- test
- release
- build
- test
- release

variables:
GIT_DEPTH: "3"
PYLINT_TARGET: phoenix
GIT_DEPTH: "3"
PYLINT_TARGET: phoenix
IMAGE_LABELS: >
--label vcs-url=$CI_PROJECT_URL
--label com.skypicker.gitlab.ci.builder=$GITLAB_USER_EMAIL
--label com.skypicker.gitlab.ci.pipeline=$CI_PROJECT_URL/pipelines/$CI_PIPELINE_ID
--label com.skypicker.gitlab.ci.ref=$CI_BUILD_REF_NAME
--label com.skypicker.gitlab.ci.build=$CI_PROJECT_URL/builds/$CI_BUILD_ID
image: docker:18.06
services:
- docker:dind

before_script:
- export CI_BUILD_REF_SLUG=${CI_BUILD_REF_NAME/\//-}
- docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY || true

include:
- 'https://ci-files.skypicker.com/templates/build/docker_build.yml'
- 'https://ci-files.skypicker.com/templates/build/zoo.yml'
- 'https://ci-files.skypicker.com/templates/build/coala.yml'
- 'https://ci-files.skypicker.com/templates/test/pylint.yml'
- 'https://ci-files.skypicker.com/templates/release/release_latest.yml'
- 'https://ci-files.skypicker.com/templates/build/coala.yml'
- 'https://ci-files.skypicker.com/templates/test/pylint.yml'
- 'https://ci-files.skypicker.com/templates/release/release_latest.yml'

docker_build:
stage: build
dependencies: []
script:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG || true
- docker pull $CI_REGISTRY_IMAGE:master || true
- >
docker build .
--cache-from $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
--cache-from $CI_REGISTRY_IMAGE:master
--build-arg package_version=git-$CI_COMMIT_SHA
--label build-date=`date -Iseconds`
$IMAGE_LABELS
--tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
--tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG

pytest:
stage: test
variables:
GIT_STRATEGY: none
services:
- postgres:10.0
- redis:latest
script:
- 'https://ci-files.skypicker.com/templates/build/docker_build.yml'
- >
docker run
-e TEST_DATABASE_URL=postgres://postgres:postgres@$POSTGRES_PORT_5432_TCP_ADDR:5432/postgres
-e REDIS_URL=redis://$REDIS_PORT_6379_TCP_ADDR:6379/0
$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
pytest -v --cov phoenix
stage: test
variables:
GIT_STRATEGY: none
services:
- postgres:10.0
- redis:latest
- docker:dind
script:
- >
docker run
-e TEST_DATABASE_URL=postgres://postgres:postgres@$POSTGRES_PORT_5432_TCP_ADDR:5432/postgres
-e REDIS_URL=redis://$REDIS_PORT_6379_TCP_ADDR:6379/0
$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
pytest -v --cov phoenix
3 changes: 1 addition & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[MASTER]
# jobs=0 means 'use all CPUs'
jobs=0
jobs=2

[MESSAGES CONTROL]
disable =
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

A system for managing outage announcements on Slack.

[![Python: 3.7](https://img.shields.io/badge/python-3.7-blue.svg)](https://python.org)
[![Code style: black](https://img.shields.io/badge/code%20style-black-black.svg)](https://github.com/ambv/black)
[![Discord](https://img.shields.io/discord/427417507276783616.svg)](https://discord.gg/2FXqeha)
[![Gitlab pipeline status (branch)](https://img.shields.io/gitlab/pipeline/kiwicom/phoenix/master.svg)](https://gitlab.com/kiwicom/phoenix/pipelines)

## Example announcement
![phoenix example announcement](example_announcement.png)

Expand Down
58 changes: 29 additions & 29 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,53 @@
#
# pip-compile --output-file requirements.txt requirements.in
#
amqp==2.2.2 # via kombu
amqp==2.3.2 # via kombu
arrow==0.12.1
billiard==3.5.0.3 # via celery
cachetools==2.1.0 # via google-auth
billiard==3.5.0.4 # via celery
cachetools==3.0.0 # via google-auth
celery==4.2.1
certifi==2018.4.16 # via requests
certifi==2018.10.15 # via requests
chardet==3.0.4 # via requests
colorama==0.3.9 # via structlog
datadog==0.21.0
ddtrace==0.12.1
colorama==0.4.0 # via structlog
datadog==0.24.0
ddtrace==0.16.0
decorator==4.3.0 # via datadog
defusedxml==0.5.0 # via python3-openid
django-allauth==0.36.0
django-allauth==0.38.0
django-celerybeat-status==0.0.10
django-environ==0.4.4
django-environ==0.4.5
django-stronghold==0.3.0
django==2.0.5
djangorestframework==3.8.2
django==2.1.3
djangorestframework==3.9.0
google-api-python-client==1.7.4
google-auth-httplib2==0.0.3 # via google-api-python-client
google-auth==1.5.0
gunicorn==19.8.1
httplib2==0.11.3 # via google-api-python-client, google-auth-httplib2
idna==2.6 # via requests
google-auth==1.6.1
gunicorn==19.9.0
httplib2==0.12.0 # via google-api-python-client, google-auth-httplib2
idna==2.7 # via requests
kiwi-structlog-config==0.1.2
kombu==4.2.1 # via celery
msgpack-python==0.5.6 # via ddtrace
oauthlib==2.1.0 # via requests-oauthlib
psycopg2==2.7.4
psycopg2==2.7.6.1
pyasn1-modules==0.2.2 # via google-auth
pyasn1==0.4.4 # via pyasn1-modules, rsa
python-dateutil==2.7.3 # via arrow
python-dateutil==2.7.5 # via arrow
python-gitlab==1.6.0
python3-openid==3.1.0 # via django-allauth
pytz==2018.4 # via celery, django
pytz==2018.7 # via celery, django
raven==6.9.0
redis==2.10.6
requests-oauthlib==0.8.0 # via django-allauth
requests==2.18.4
rsa==3.4.2 # via google-auth
simplejson==3.15.0 # via datadog, kiwi-structlog-config
six==1.11.0 # via django-environ, google-api-python-client, google-auth, python-dateutil, python-gitlab, slackclient, structlog, websocket-client
slackclient==1.2.1
structlog[dev]==18.1.0 # via kiwi-structlog-config
redis==3.0.1
requests-oauthlib==1.0.0 # via django-allauth
requests==2.20.1
rsa==4.0 # via google-auth
simplejson==3.16.0 # via kiwi-structlog-config
six==1.11.0 # via google-api-python-client, google-auth, python-dateutil, python-gitlab, slackclient, structlog, websocket-client
slackclient==1.3.0
structlog[dev]==18.2.0 # via kiwi-structlog-config
uritemplate==3.0.0 # via google-api-python-client
urllib3==1.22 # via requests
urllib3==1.24.1 # via requests
vine==1.1.4 # via amqp
websocket-client==0.47.0 # via slackclient
whitenoise==3.3.1
websocket-client==0.54.0 # via slackclient
whitenoise==4.1.2
wrapt==1.10.11 # via ddtrace
24 changes: 13 additions & 11 deletions tests-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,26 @@
# pip-compile --output-file tests-requirements.txt tests-requirements.in
#
astroid==2.0.4 # via pylint
atomicwrites==1.2.0 # via pytest
attrs==18.1.0 # via pytest
coverage==5.0a1 # via pytest-cov
atomicwrites==1.2.1 # via pytest
attrs==18.2.0 # via pytest
coverage==4.5.2 # via pytest-cov
filelock==3.0.10 # via tox
isort==4.3.4 # via pylint
lazy-object-proxy==1.3.1 # via astroid
mccabe==0.6.1 # via pylint
more-itertools==4.3.0 # via pytest
pg8000==1.12.3 # via testing-postgresql
pluggy==0.7.1 # via pytest, tox
py==1.6.0 # via pytest, tox
pluggy==0.8.0 # via pytest, tox
py==1.7.0 # via pytest, tox
pylint==2.1.1
pytest-cov==2.5.1
pytest-django==3.4.2
pytest==3.7.3 # via pytest-cov, pytest-django
python-box==3.2.0
pytest-cov==2.6.0
pytest-django==3.4.4
pytest==4.0.0 # via pytest-cov, pytest-django
python-box==3.2.3
six==1.11.0 # via astroid, more-itertools, pg8000, pytest, tox
testing-postgresql==1.3.0
testing.common.database==2.0.3 # via testing-postgresql
tox==3.2.1
virtualenv==16.0.0 # via tox
toml==0.10.0 # via tox
tox==3.5.3
virtualenv==16.1.0 # via tox
wrapt==1.10.11 # via astroid

0 comments on commit 2bc8094

Please sign in to comment.