Commit 90b5ac0e authored by nimrod's avatar nimrod
Browse files

Common gitlab-ci.yml.

- Disable the Docker pre-commit checks only in CI (the issue doesn't
happen locally).
- Pull images during the build stage.
parent 3a4c67c2
Loading
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -11,6 +11,9 @@ pre-commit:
  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:
@@ -20,15 +23,19 @@ pre-commit:
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

run:
  stage: run
  tags: ["ns4.shore.co.il"]
  when: manual
  script:
    - docker-compose up --detach --quiet-pull --remove-orphans
    - docker-compose up --detach --remove-orphans
    # yamllint disable rule:line-length
    - |
        for i in $(seq 12)
+5 −7
Original line number Diff line number Diff line
@@ -18,10 +18,8 @@ repos:
      - id: proselint
        types: [plain-text]
        exclude: LICENSE
  # Disabled until https://github.com/pre-commit/pre-commit/issues/1387 is
  # resolved.
  #- repo: https://git.shore.co.il/nimrod/docker-pre-commit.git
  #  rev: v0.3.0
  #  hooks:
  #    - id: hadolint
  #    - id: docker-compose
  - repo: https://git.shore.co.il/nimrod/docker-pre-commit.git
    rev: v0.3.0
    hooks:
      - id: hadolint
      - id: docker-compose
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ services:
    build:
      context: .
    hostname: workbench.shore.co.il
    image: adarnimrod/workbench
    #image: adarnimrod/workbench
    ports:
      - "2222:22"
    restart: always