Loading .gitlab-ci.yml +10 −13 Original line number Diff line number Diff line Loading @@ -5,6 +5,9 @@ stages: - test-package - deploy services: - docker:dind variables: DOCKER_DRIVER: overlay2 STATUS_CHECK_DELAY: 60 Loading @@ -14,8 +17,6 @@ docker-build-development: variables: PARENT_IMAGE_NAME: registry.gitlab.com/redmic-project/docker/index-pages PARENT_IMAGE_TAG: dev-latest services: - docker:dind only: - branches except: Loading @@ -32,8 +33,6 @@ docker-build-stable: variables: PARENT_IMAGE_NAME: registry.gitlab.com/redmic-project/docker/index-pages PARENT_IMAGE_TAG: latest services: - docker:dind only: - master script: Loading @@ -46,8 +45,6 @@ docker-build-stable: container-scanning: stage: test-package allow_failure: true services: - docker:stable-dind only: - branches script: Loading @@ -60,7 +57,9 @@ container-scanning: - mv clair-scanner_linux_amd64 clair-scanner - chmod +x clair-scanner - touch clair-whitelist.yml - ./clair-scanner -c http://docker:6060 --ip $(hostname -i) -r gl-sast-container-report.json -l clair.log -w clair-whitelist.yml ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA} || true - > ./clair-scanner -c http://docker:6060 --ip $(hostname -i) -r gl-sast-container-report.json -l clair.log -w clair-whitelist.yml ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA} || true artifacts: paths: [gl-sast-container-report.json] Loading @@ -74,12 +73,11 @@ deploy-development: IMAGE_NAME: ${CI_REGISTRY_IMAGE} IMAGE_TAG: ${CI_COMMIT_SHA} COMPOSE_FILE: docker-compose.tmpl.yml:docker-compose.dev.yml services: - docker:dind PUBLIC_HOSTNAME: ${DEV_PUBLIC_HOSTNAME} script: - > deploy.sh IMAGE_NAME=${IMAGE_NAME} IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE} PUBLIC_HOSTNAME=${DEV_PUBLIC_HOSTNAME} PUBLIC_HOSTNAME=${PUBLIC_HOSTNAME} environment: name: dev url: https://${DEV_PUBLIC_HOSTNAME} Loading @@ -99,12 +97,11 @@ deploy-stable: IMAGE_NAME: ${CI_REGISTRY_IMAGE} IMAGE_TAG: ${CI_COMMIT_SHA} COMPOSE_FILE: docker-compose.tmpl.yml:docker-compose.prod.yml services: - docker:dind PUBLIC_HOSTNAME: ${DEV_PUBLIC_HOSTNAME} script: - > deploy.sh IMAGE_NAME=${IMAGE_NAME} IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE} PUBLIC_HOSTNAME=${DEV_PUBLIC_HOSTNAME} PUBLIC_HOSTNAME=${PUBLIC_HOSTNAME} environment: name: pro url: https://${DEV_PUBLIC_HOSTNAME} Loading .env→deploy/.env +1 −0 Original line number Diff line number Diff line SITE_NAME=redmic-dev SITE_PORT=3000 SITE_SUBDOMAIN=index deploy/docker-compose.dev.yml 0 → 100644 +1 −0 Original line number Diff line number Diff line version: '3.5' deploy/docker-compose.prod.yml 0 → 100644 +1 −0 Original line number Diff line number Diff line version: '3.5' docker-compose.dev.yml→deploy/docker-compose.tmpl.yml +15 −7 Original line number Diff line number Diff line Loading @@ -2,23 +2,27 @@ version: '3.5' services: redmic-dev: ports: - target: ${SITE_PORT} published: ${SITE_PORT} mode: host image: ${IMAGE_NAME}:${IMAGE_TAG:-latest} networks: - traefik-net healthcheck: test: wget --spider -S -t 3 http://localhost:${SITE_PORT} interval: 30s timeout: 10s retries: 3 start_period: 1m deploy: mode: replicated replicas: 1 labels: traefik.port: "${SITE_PORT}" traefik.docker.network: traefik-net traefik.frontend.rule: Host:${PUBLIC_HOSTNAME} traefik.frontend.rule: Host:${SITE_SUBDOMAIN}.${PUBLIC_HOSTNAME} traefik.backend: ${SITE_NAME} placement: constraints: - node.role == manager restart_policy: condition: on-failure delay: 10s window: 30s resources: Loading @@ -27,3 +31,7 @@ services: memory: 64M reservations: memory: 52M networks: traefik-net: external: true Loading
.gitlab-ci.yml +10 −13 Original line number Diff line number Diff line Loading @@ -5,6 +5,9 @@ stages: - test-package - deploy services: - docker:dind variables: DOCKER_DRIVER: overlay2 STATUS_CHECK_DELAY: 60 Loading @@ -14,8 +17,6 @@ docker-build-development: variables: PARENT_IMAGE_NAME: registry.gitlab.com/redmic-project/docker/index-pages PARENT_IMAGE_TAG: dev-latest services: - docker:dind only: - branches except: Loading @@ -32,8 +33,6 @@ docker-build-stable: variables: PARENT_IMAGE_NAME: registry.gitlab.com/redmic-project/docker/index-pages PARENT_IMAGE_TAG: latest services: - docker:dind only: - master script: Loading @@ -46,8 +45,6 @@ docker-build-stable: container-scanning: stage: test-package allow_failure: true services: - docker:stable-dind only: - branches script: Loading @@ -60,7 +57,9 @@ container-scanning: - mv clair-scanner_linux_amd64 clair-scanner - chmod +x clair-scanner - touch clair-whitelist.yml - ./clair-scanner -c http://docker:6060 --ip $(hostname -i) -r gl-sast-container-report.json -l clair.log -w clair-whitelist.yml ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA} || true - > ./clair-scanner -c http://docker:6060 --ip $(hostname -i) -r gl-sast-container-report.json -l clair.log -w clair-whitelist.yml ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA} || true artifacts: paths: [gl-sast-container-report.json] Loading @@ -74,12 +73,11 @@ deploy-development: IMAGE_NAME: ${CI_REGISTRY_IMAGE} IMAGE_TAG: ${CI_COMMIT_SHA} COMPOSE_FILE: docker-compose.tmpl.yml:docker-compose.dev.yml services: - docker:dind PUBLIC_HOSTNAME: ${DEV_PUBLIC_HOSTNAME} script: - > deploy.sh IMAGE_NAME=${IMAGE_NAME} IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE} PUBLIC_HOSTNAME=${DEV_PUBLIC_HOSTNAME} PUBLIC_HOSTNAME=${PUBLIC_HOSTNAME} environment: name: dev url: https://${DEV_PUBLIC_HOSTNAME} Loading @@ -99,12 +97,11 @@ deploy-stable: IMAGE_NAME: ${CI_REGISTRY_IMAGE} IMAGE_TAG: ${CI_COMMIT_SHA} COMPOSE_FILE: docker-compose.tmpl.yml:docker-compose.prod.yml services: - docker:dind PUBLIC_HOSTNAME: ${DEV_PUBLIC_HOSTNAME} script: - > deploy.sh IMAGE_NAME=${IMAGE_NAME} IMAGE_TAG=${IMAGE_TAG} COMPOSE_FILE=${COMPOSE_FILE} PUBLIC_HOSTNAME=${DEV_PUBLIC_HOSTNAME} PUBLIC_HOSTNAME=${PUBLIC_HOSTNAME} environment: name: pro url: https://${DEV_PUBLIC_HOSTNAME} Loading
.env→deploy/.env +1 −0 Original line number Diff line number Diff line SITE_NAME=redmic-dev SITE_PORT=3000 SITE_SUBDOMAIN=index
deploy/docker-compose.dev.yml 0 → 100644 +1 −0 Original line number Diff line number Diff line version: '3.5'
deploy/docker-compose.prod.yml 0 → 100644 +1 −0 Original line number Diff line number Diff line version: '3.5'
docker-compose.dev.yml→deploy/docker-compose.tmpl.yml +15 −7 Original line number Diff line number Diff line Loading @@ -2,23 +2,27 @@ version: '3.5' services: redmic-dev: ports: - target: ${SITE_PORT} published: ${SITE_PORT} mode: host image: ${IMAGE_NAME}:${IMAGE_TAG:-latest} networks: - traefik-net healthcheck: test: wget --spider -S -t 3 http://localhost:${SITE_PORT} interval: 30s timeout: 10s retries: 3 start_period: 1m deploy: mode: replicated replicas: 1 labels: traefik.port: "${SITE_PORT}" traefik.docker.network: traefik-net traefik.frontend.rule: Host:${PUBLIC_HOSTNAME} traefik.frontend.rule: Host:${SITE_SUBDOMAIN}.${PUBLIC_HOSTNAME} traefik.backend: ${SITE_NAME} placement: constraints: - node.role == manager restart_policy: condition: on-failure delay: 10s window: 30s resources: Loading @@ -27,3 +31,7 @@ services: memory: 64M reservations: memory: 52M networks: traefik-net: external: true