aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorgabrielgio <gabriel.giovanini@pm.me>2021-07-03 21:24:15 +0200
committergabrielgio <gabriel.giovanini@pm.me>2021-07-03 21:24:15 +0200
commite04d89a1278f66c15be9cadb6ab524dbb878efd8 (patch)
tree5049f3e71880dedac3bfc0f94d35606e64aa2482 /.gitlab-ci.yml
downloadreddit-nextcloud-importer-e04d89a1278f66c15be9cadb6ab524dbb878efd8.tar.gz
reddit-nextcloud-importer-e04d89a1278f66c15be9cadb6ab524dbb878efd8.tar.bz2
reddit-nextcloud-importer-e04d89a1278f66c15be9cadb6ab524dbb878efd8.zip
Initial commit
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml45
1 files changed, 45 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..795dbfb
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,45 @@
+stages:
+ - test
+ - build
+
+docker-build-master:
+ image: docker:latest
+ stage: build
+ services:
+ - docker:dind
+ before_script:
+ - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
+ script:
+ - docker build --pull -t "$CI_REGISTRY_IMAGE" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" .
+ - docker push "$CI_REGISTRY_IMAGE"
+ - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
+ only:
+ - master
+
+docker-build:
+ image: docker:latest
+ stage: build
+ services:
+ - docker:dind
+ before_script:
+ - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
+ script:
+ - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" .
+ - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
+ - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
+ except:
+ - master
+
+
+test:
+ image: python:3-alpine
+ stage: test
+ script:
+ - pip install -r dev-requirements.txt
+ - pytest -n 4 --junitxml=report.xml
+ - coverage run -m pytest
+ - coverage xml -o cobertura.xml
+ artifacts:
+ reports:
+ cobertura: cobertura.xml
+ junit: report.xml