Publish Docker image for each master commit on local registry
This commit is contained in:
parent
dd9d6c1660
commit
c6cab13e6a
|
@ -2,6 +2,7 @@ image: "node:12-slim"
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
|
- package
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
|
@ -21,3 +22,20 @@ test:
|
||||||
- npm ci
|
- npm ci
|
||||||
- npm run lint
|
- npm run lint
|
||||||
- npm test
|
- npm test
|
||||||
|
|
||||||
|
package-docker:
|
||||||
|
stage: package
|
||||||
|
image: docker:latest
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
script:
|
||||||
|
- export IMG_NAME=registry.gitlab.com/timvisee/send:master-$CI_COMMIT_SHA
|
||||||
|
|
||||||
|
# Login in to registry
|
||||||
|
- 'docker login registry.gitlab.com -u $DOCKER_USER -p $DOCKER_PASS'
|
||||||
|
|
||||||
|
# build and push image
|
||||||
|
- docker build -t $IMG_NAME .
|
||||||
|
- docker push $IMG_NAME
|
||||||
|
|
Loading…
Reference in New Issue