Skip to content
Snippets Groups Projects
Commit 9e368321 authored by MARTIN Pierre-Alexandre's avatar MARTIN Pierre-Alexandre
Browse files

Ajout d'une étape de build d'image docker à la pipeline

parent 2b1c4c9c
No related branches found
No related tags found
1 merge request!3Ajout d'une étape de build d'image docker à la pipeline
......@@ -4,6 +4,7 @@ image: node:22
stages:
- build
- test
- docker
cache:
- &global_cache_node_mods
......@@ -34,7 +35,6 @@ install:
build:
stage: build
script:
- npm ci
- npm run build
artifacts:
paths:
......@@ -59,6 +59,29 @@ lint:
stage: test
needs:
- job: build
artifacts: true
artifacts: true
script:
- npm run lint
build-image:
stage: docker
rules:
- if: $CI_COMMIT_BRANCH == "main" ||
$CI_COMMIT_BRANCH == "dev"
image:
name: gcr.io/kaniko-project/executor:v1.23.2-debug
entrypoint: [""]
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "main" ]]; then
TAG="latest"
else
TAG="dev"
fi
echo "Branch: $CI_COMMIT_BRANCH"
echo "Tag to be used: ${CI_REGISTRY_IMAGE}:$TAG"
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/dockerfile"
--destination "${CI_REGISTRY_IMAGE}:${TAG}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment