Skip to content
Snippets Groups Projects
Commit 24767f7a authored by nimrod's avatar nimrod
Browse files

Allow setting the working directory.

In the Docker templates.
parent 70e6f84f
No related branches found
No related tags found
No related merge requests found
Pipeline #2691 passed
...@@ -7,6 +7,7 @@ foo: ...@@ -7,6 +7,7 @@ foo:
stage: .post stage: .post
image: &image registry.shore.co.il/ci-images:docker image: &image registry.shore.co.il/ci-images:docker
before_script: before_script:
- &WORKDIR cd "${WORKDIR:-.}"
- &TAG |- - &TAG |-
if [ -n "${CI_COMMIT_TAG:-}" ] if [ -n "${CI_COMMIT_TAG:-}" ]
then then
...@@ -56,6 +57,7 @@ foo: ...@@ -56,6 +57,7 @@ foo:
COMPOSE_DOCKER_CLI_BUILD: "1" COMPOSE_DOCKER_CLI_BUILD: "1"
DOCKER_BUILDKIT: "1" DOCKER_BUILDKIT: "1"
before_script: before_script:
- *WORKDIR
- *TAG - *TAG
script: script:
- docker-compose build --no-cache --parallel --pull - docker-compose build --no-cache --parallel --pull
...@@ -67,6 +69,7 @@ foo: ...@@ -67,6 +69,7 @@ foo:
DOCKER_BUILDKIT: "1" DOCKER_BUILDKIT: "1"
DOCKER_REGISTRY: registry.hub.docker.com/adarnimrod DOCKER_REGISTRY: registry.hub.docker.com/adarnimrod
before_script: before_script:
- *WORKDIR
- *TAG - *TAG
- *IMAGE - *IMAGE
script: &docker-build script: &docker-build
...@@ -89,6 +92,7 @@ foo: ...@@ -89,6 +92,7 @@ foo:
DOCKER_BUILDKIT: "1" DOCKER_BUILDKIT: "1"
DOCKER_REGISTRY: registry.shore.co.il DOCKER_REGISTRY: registry.shore.co.il
before_script: before_script:
- *WORKDIR
- *TAG - *TAG
- *IMAGE - *IMAGE
script: *docker-build script: *docker-build
...@@ -102,6 +106,7 @@ foo: ...@@ -102,6 +106,7 @@ foo:
COMPOSE_DOCKER_CLI_BUILD: "1" COMPOSE_DOCKER_CLI_BUILD: "1"
DOCKER_BUILDKIT: "1" DOCKER_BUILDKIT: "1"
before_script: before_script:
- *WORKDIR
- *TAG - *TAG
script: script:
- docker-compose pull --quiet - docker-compose pull --quiet
...@@ -117,6 +122,7 @@ foo: ...@@ -117,6 +122,7 @@ foo:
- branches - branches
- tags - tags
before_script: before_script:
- *WORKDIR
- *TAG - *TAG
- *hub-login - *hub-login
script: script:
...@@ -143,6 +149,7 @@ foo: ...@@ -143,6 +149,7 @@ foo:
rules: rules:
- when: manual - when: manual
before_script: before_script:
- *WORKDIR
- *TAG - *TAG
script: script:
- docker-compose up --detach --remove-orphans - docker-compose up --detach --remove-orphans
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment