Remove image caching as artifacts due to size limitations, introduce separate master / feature jobs instead
This commit is contained in:
parent
76027dea9c
commit
866bf7b552
@ -12,6 +12,10 @@ stages:
|
||||
services:
|
||||
- docker:dind
|
||||
|
||||
.docker_build: &docker_build
|
||||
script:
|
||||
- docker build -t $LIGO_REGISTRY_IMAGE:latest -f ./docker/Dockerfile .
|
||||
|
||||
.before_script: &before_script
|
||||
before_script:
|
||||
# Install dependencies
|
||||
@ -77,27 +81,23 @@ remote-repo-job:
|
||||
|
||||
# Run a docker build on the ligo image, to see if the current
|
||||
# commit does not break it
|
||||
build-current-docker-image:
|
||||
stage: build
|
||||
<<: *docker
|
||||
script:
|
||||
- docker build -t $LIGO_REGISTRY_IMAGE:latest -f ./docker/Dockerfile .
|
||||
- docker save $LIGO_REGISTRY_IMAGE:latest > image
|
||||
artifacts:
|
||||
paths:
|
||||
- image
|
||||
# build-current-docker-image:
|
||||
# stage: build
|
||||
# <<: *docker
|
||||
# <<: *docker_build
|
||||
# except:
|
||||
# - master
|
||||
|
||||
# When a MR/PR is merged to master
|
||||
# take the previous build and publish it to Docker Hub
|
||||
build-and-publish-latest-docker-image:
|
||||
stage: deploy
|
||||
<<: *docker
|
||||
<<: *docker_build
|
||||
dependencies:
|
||||
- build-current-docker-image
|
||||
before_script:
|
||||
post_script:
|
||||
- docker login -u $LIGO_REGISTRY_USER -p $LIGO_REGISTRY_PASSWORD
|
||||
script:
|
||||
- docker load -i image
|
||||
- docker push $CI_REGISTRY_IMAGE:latest
|
||||
only:
|
||||
- master
|
||||
- docker push $LIGO_REGISTRY_IMAGE:latest
|
||||
# only:
|
||||
# - master
|
||||
|
Loading…
Reference in New Issue
Block a user