Merge branch 'updateCI' into 'main'
update ci to push version and latest See merge request v3/service/territory!17
This commit is contained in:
commit
48b9727017
|
@ -37,10 +37,18 @@ build:
|
||||||
services:
|
services:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
before_script:
|
before_script:
|
||||||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
- echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
|
||||||
script:
|
script:
|
||||||
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
|
- export VERSION=$(docker run --rm -v "$PWD":/usr/src/app:ro -w /usr/src/app node:slim node -p "require('./package.json').version")
|
||||||
- docker push "$CI_REGISTRY_IMAGE"
|
- docker pull $CI_REGISTRY_IMAGE:latest || true
|
||||||
|
- >
|
||||||
|
docker build
|
||||||
|
--pull
|
||||||
|
--cache-from $CI_REGISTRY_IMAGE:latest
|
||||||
|
--tag $CI_REGISTRY_IMAGE:$VERSION
|
||||||
|
--tag $CI_REGISTRY_IMAGE:latest
|
||||||
|
.
|
||||||
|
- docker push $CI_REGISTRY_IMAGE:$VERSION
|
||||||
|
- docker push $CI_REGISTRY_IMAGE:latest
|
||||||
only:
|
only:
|
||||||
- main
|
- main
|
||||||
when: manual
|
|
||||||
|
|
Loading…
Reference in New Issue