From 407449158fab56943da95af5172db4e464588d0e Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 17 Dec 2019 18:24:16 +0300 Subject: CI: Add a cache policy for test jobs and fix rum tests recompiling everything --- .gitlab-ci.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 88789035d..dc85eaba2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,13 @@ image: elixir:1.8.1 -variables: +variables: &global_variables POSTGRES_DB: pleroma_test POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres DB_HOST: postgres MIX_ENV: test -cache: +cache: &global_cache_policy key: ${CI_COMMIT_REF_SLUG} paths: - deps @@ -46,6 +46,10 @@ benchmark: unit-testing: stage: test + cache: &testing_cache_policy + <<: *global_cache_policy + policy: pull + services: - name: postgres:9.6 alias: postgres @@ -58,6 +62,7 @@ unit-testing: federated-testing: stage: test + cache: *testing_cache_policy services: - name: minibikini/postgres-with-rum:12 alias: postgres @@ -71,11 +76,13 @@ federated-testing: unit-testing-rum: stage: test + cache: *testing_cache_policy services: - name: minibikini/postgres-with-rum:12 alias: postgres command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] variables: + <<: *global_variables RUM_ENABLED: "true" script: - mix deps.get @@ -86,17 +93,20 @@ unit-testing-rum: lint: stage: test + cache: *testing_cache_policy script: - mix format --check-formatted analysis: stage: test + cache: *testing_cache_policy script: - mix deps.get - mix credo --strict --only=warnings,todo,fixme,consistency,readability docs-deploy: stage: deploy + cache: *testing_cache_policy image: alpine:latest only: - stable@pleroma/pleroma -- cgit v1.2.3 From 2ef8f0be6c1d852be1b91690e0702c69a225c147 Mon Sep 17 00:00:00 2001 From: jp Date: Fri, 10 Jan 2020 14:09:14 -0500 Subject: Update Dockerfile with labels. Update gitlab-ci for registry usage --- .gitlab-ci.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dc85eaba2..b34c7e98d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,18 +6,24 @@ variables: &global_variables POSTGRES_PASSWORD: postgres DB_HOST: postgres MIX_ENV: test + DOCKER_DRIVER: overlay2 + DOCKER_HOST: unix:///var/run/docker.sock + DOCKER_IMAGE: $CI_REGISTRY_IMAGE:latest + DOCKER_IMAGE_SHA: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA cache: &global_cache_policy key: ${CI_COMMIT_REF_SLUG} paths: - - deps - - _build + - deps + - _build + stages: - build - test - benchmark - deploy - release + - docker before_script: - mix local.hex --force @@ -264,3 +270,20 @@ arm64-musl: variables: *release-variables before_script: *before-release-musl script: *release + +docker: + stage: docker + image: docker:latest + tags: + - dind + before_script: &before-docker + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - export CI_JOB_TIMESTAMP=$(date --utc -Iseconds) + - export CI_VCS_REF=$CI_COMMIT_SHORT_SHA + script: + - docker pull $DOCKER_IMAGE || true + - docker build --cache-from $DOCKER_IMAGE --build-arg VCS_REF=$CI_VCS_REF --build-arg BUILD_DATE=$CI_JOB_TIMESTAMP -t $DOCKER_IMAGE_SHA -t $DOCKER_IMAGE . + - docker push $DOCKER_IMAGE_SHA + - docker push $DOCKER_IMAGE + only: + - develop -- cgit v1.2.3