docker build
This commit is contained in:
+25
-12
@@ -1,17 +1,30 @@
|
||||
stages:
|
||||
- lint
|
||||
- build
|
||||
- push
|
||||
|
||||
variables:
|
||||
NODE_OPTIONS: "--openssl-legacy-provider"
|
||||
DOCKER_DRIVER: overlay2
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
DOCKER_HOST: tcp://docker:2375/
|
||||
|
||||
lint_frontend:
|
||||
stage: lint
|
||||
image: node:18-slim
|
||||
before_script:
|
||||
- npm config set strict-ssl false
|
||||
services:
|
||||
- docker:dind
|
||||
|
||||
before_script:
|
||||
- docker info
|
||||
|
||||
build_container:
|
||||
stage: build
|
||||
image: docker:19.03.12
|
||||
script:
|
||||
- cd notes-app
|
||||
- npm cache clean --force
|
||||
- npm ci
|
||||
- npm install eslint
|
||||
- npx eslint .
|
||||
- docker build -t $CI_REGISTRY_IMAGE/my-container:latest .
|
||||
- docker tag $CI_REGISTRY_IMAGE/my-container:latest $CI_REGISTRY_IMAGE/my-container:$CI_COMMIT_SHORT_SHA
|
||||
|
||||
push_container:
|
||||
stage: push
|
||||
image: docker:19.03.12
|
||||
script:
|
||||
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
|
||||
- docker push $CI_REGISTRY_IMAGE/my-container:latest
|
||||
- docker push $CI_REGISTRY_IMAGE/my-container:$CI_COMMIT_SHORT_SHA
|
||||
|
||||
|
||||
Reference in New Issue
Block a user