From 8107a31c4466d17134906e6f1c14a41e94b84c8e Mon Sep 17 00:00:00 2001 From: Adar Nimrod Date: Sun, 27 Dec 2020 18:29:38 +0200 Subject: [PATCH] Use CI templates. --- .gitlab-ci.yml | 49 +++++++++---------------------------------------- 1 file changed, 9 insertions(+), 40 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cadb998..793dd4a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,46 +1,15 @@ --- -image: adarnimrod/ci-images:docker +include: + - project: shore/ci-templates + file: templates/pre-commit.yml + - project: shore/ci-templates + file: templates/docker-compose.yml -stages: - - test - - build - - run - -pre-commit: - stage: test - image: adarnimrod/ci-images:pre-commit - variables: - XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache" - # Disabled until https://github.com/pre-commit/pre-commit/issues/1387 is - # resolved. - SKIP: "hadolint,docker-compose" - script: - - pre-commit run --all-files - cache: - paths: - - .cache/ build: - stage: build - tags: ["ns4.shore.co.il"] - variables: - COMPOSE_DOCKER_CLI_BUILD: "1" - DOCKER_BUILDKIT: "1" - script: - - docker-compose build --no-cache --pull - - docker-compose pull --quiet + extends: .compose-build + tags: [ns4.shore.co.il] run: - stage: run - tags: ["ns4.shore.co.il"] - when: manual - script: - - docker-compose up --detach --remove-orphans - # yamllint disable rule:line-length - - | - for i in $(seq 12) - do - docker container inspect --format '{{ .State.Health.Status }}' $(docker-compose ps -q) | grep -v '^healthy$' || break - sleep 10 - done - ! docker container inspect --format '{{ .State.Health.Status }}' $(docker-compose ps -q) | grep -v '^healthy$' + extends: .compose-run + tags: [ns4.shore.co.il] -- GitLab