Commit 5fcb35fe authored by Luigi Sbailo's avatar Luigi Sbailo
Browse files

Update .gitlab-ci.yml to use cache

parent cab8fc26
......@@ -18,9 +18,8 @@ build to staging:
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
- docker info
script:
# Use cache --cache-from ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}$ to speed up the build process
- docker pull ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} || true
- docker build --tag ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}${CI_COMMIT_SHORT_SHA} --tag ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} --build-arg CACHE_DATE=${CI_PIPELINE_CREATED_AT} .
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}$ --tag ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}${CI_COMMIT_SHORT_SHA} --tag ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} --build-arg CACHE_DATE=${CI_PIPELINE_CREATED_AT} .
- docker push ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}${CI_COMMIT_SHORT_SHA}
- docker push ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}
rules:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment