Commit bd0c3525 authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Simplifie le workflow de CI.

No related merge requests found
Showing with 12 additions and 24 deletions
+12 -24
...@@ -2,55 +2,43 @@ include: ...@@ -2,55 +2,43 @@ include:
- local: 'prezbuilder-ci.yml' - local: 'prezbuilder-ci.yml'
default: default:
tags: [docker]
retry: 2 retry: 2
interruptible: true interruptible: true
stages: stages:
- build
- test - test
- build
- deploy - deploy
node_modules: lint:
stage: build stage: test
tags: [docker]
image: node:12-buster image: node:12-buster
variables: variables:
NPM_CONFIG_CACHE: "$CI_PROJECT_DIR/.npm" NPM_CONFIG_CACHE: "$CI_PROJECT_DIR/.npm"
script: script:
- npm install - npm install
- npm run lint
cache: cache:
key: "$CI_COMMIT_REF_SLUG-$CI_JOB_NAME" key: "$CI_COMMIT_REF_SLUG-$CI_JOB_NAME"
paths: paths:
- "$NPM_CONFIG_CACHE" - "$NPM_CONFIG_CACHE"
artifacts:
expire_in: 1 day
paths:
- node_modules/
docker-image: docker-image:
stage: build stage: build
tags: [dind] tags: [dind]
variables: variables:
PUBLIC_IMAGE: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME" IMAGE: "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}"
PREZBUILDER_IMAGE: prezbuilder PREZBUILDER_IMAGE: "${CI_REGISTRY_IMAGE}"
PREZBUILDER_TAG: "$CI_COMMIT_SHA" PREZBUILDER_TAG: "${CI_COMMIT_REF_NAME}"
LOCAL_IMAGE: "$PREZBUILDER_IMAGE:$PREZBUILDER_TAG"
script: script:
- set -x - set -x
- docker pull "$PUBLIC_IMAGE" || exit 0 - docker pull "${IMAGE}" || exit 0
- docker build --cache-from "node:buster-12,$PUBLIC_IMAGE" --tag "$LOCAL_IMAGE" --tag "$PUBLIC_IMAGE" . - docker build --cache-from "node:buster-12,${IMAGE}" --tag "${IMAGE}" .
- docker run --rm "$LOCAL_IMAGE" build - docker run --rm "${IMAGE}" build
- bash -x bin/prezbuilder-docker build src public - bash -x bin/prezbuilder-docker build src public
- "[ -e public/index.html ]" - "[ -e public/index.html ]"
- docker push "$PUBLIC_IMAGE" - docker push "${IMAGE}"
lint:
stage: test
image: node:12-buster
needs:
- node_modules
script:
- npm run lint
pages: pages:
extends: .prezbuilder extends: .prezbuilder
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment