diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3f1b0bac9d6c6462406627689b98e7e3f8a1c73c..135eb4422f5973b3fd39661a09c1caafffedb2d2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,16 +1,19 @@ --- include: + - project: shore/ci-templates + file: templates/pre-commit.yml - project: shore/ci-templates file: templates/docker.yml -build-host01: - extends: .compose-build - tags: [host01.shore.co.il] +stages: + - test + - build + - deploy -build-ns4: +build: extends: .compose-build tags: [ns4.shore.co.il] -build-kodi: - extends: .compose-build - tags: [kodi.shore.co.il] +push: + extends: .compose-push + tags: [ns4.shore.co.il] diff --git a/crond/Dockerfile b/crond/Dockerfile index 994fbce7b5c680497c7a0744376b361f2404b2a6..1c782c23aa61df32151c4361d1f06b0bd3148ee9 100644 --- a/crond/Dockerfile +++ b/crond/Dockerfile @@ -1,7 +1,7 @@ FROM docker:19.03 as docker # hadolint ignore=DL3006 -FROM adarnimrod/cron as supersonic +FROM registry.shore.co.il/cron as supersonic COPY --from=docker /usr/local/bin/docker /usr/local/bin/ COPY --chown=root:root crontab /crontab # hadolint ignore=DL3002 diff --git a/deploy b/deploy index 4c175e162f9c3c302980698726231a9dccde399d..d7b555adf78a3ed4cfbe03c8bfb56659e85171b6 100755 --- a/deploy +++ b/deploy @@ -11,6 +11,7 @@ _deploy() { echo "Deploying to $1" >&2 export DOCKER_HOST="ssh://$1" export RUNNER_NAME="$1" + until docker-compose pull --quiet; do true; done until docker-compose up --detach --remove-orphans ; do true; done # shellcheck disable=SC2034 for i in $(seq 12) diff --git a/docker-compose.yml b/docker-compose.yml index 604620099b3d313c053d2d4c70d4867cb88901ac..5e16ebb243f0cf7a19c4be1ffff2911824fa29c1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,13 +6,13 @@ services: context: runner/ environment: CI_SERVER_URL: "${CI_SERVER_URL:-https://git.shore.co.il}" - DOCKER_IMAGE: docker:19.03 + DOCKER_IMAGE: registry.shore.co.il/ci-images:docker DOCKER_NETWORK_MODE: &network gitlab-runner REGISTRATION_TOKEN: "${REGISTRATION_TOKEN}" RUNNER_NAME: "${RUNNER_NAME}" REGISTER_RUN_UNTAGGED: "${RUN_UNTAGGED:-true}" RUNNER_TAG_LIST: "${RUNNER_NAME}" - image: adarnimrod/gitlab-runner + image: registry.shore.co.il/gitlab-runner restart: always volumes: - "${BUILDS:-builds}:/builds" @@ -21,6 +21,7 @@ services: crond: build: context: crond/ + image: registry.shore.co.il/gitlab-runner-cron volumes: - /run/docker.sock:/run/docker.sock