Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pôle IS
Outillage
prezbuilder
Commits
bd0c3525
Commit
bd0c3525
authored
Jun 30, 2020
by
Guillaume Perréal
Browse files
Simplifie le workflow de CI.
parent
d4084c4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
bd0c3525
...
...
@@ -2,55 +2,43 @@ include:
-
local
:
'
prezbuilder-ci.yml'
default
:
tags
:
[
docker
]
retry
:
2
interruptible
:
true
stages
:
-
build
-
test
-
build
-
deploy
node_modules
:
stage
:
build
lint
:
stage
:
test
tags
:
[
docker
]
image
:
node:12-buster
variables
:
NPM_CONFIG_CACHE
:
"
$CI_PROJECT_DIR/.npm"
script
:
-
npm install
-
npm run lint
cache
:
key
:
"
$CI_COMMIT_REF_SLUG-$CI_JOB_NAME"
paths
:
-
"
$NPM_CONFIG_CACHE"
artifacts
:
expire_in
:
1 day
paths
:
-
node_modules/
docker-image
:
stage
:
build
tags
:
[
dind
]
variables
:
PUBLIC_IMAGE
:
"
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
PREZBUILDER_IMAGE
:
prezbuilder
PREZBUILDER_TAG
:
"
$CI_COMMIT_SHA"
LOCAL_IMAGE
:
"
$PREZBUILDER_IMAGE:$PREZBUILDER_TAG"
IMAGE
:
"
${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}"
PREZBUILDER_IMAGE
:
"
${CI_REGISTRY_IMAGE}"
PREZBUILDER_TAG
:
"
${CI_COMMIT_REF_NAME}"
script
:
-
set -x
-
docker pull "$
PUBLIC_
IMAGE" || exit
0
-
docker build --cache-from "node:buster-12,$
PUBLIC_
IMAGE" --tag "$
LOCAL_IMAGE" --tag "$PUBLIC_IMAGE
" .
-
docker run --rm "$
LOCAL_
IMAGE" build
-
docker pull "$
{
IMAGE
}
" || exit
0
-
docker build --cache-from "node:buster-12,$
{
IMAGE
}
" --tag "$
{IMAGE}
" .
-
docker run --rm "$
{
IMAGE
}
" build
-
bash -x bin/prezbuilder-docker build src public
-
"
[
-e
public/index.html
]"
-
docker push "$PUBLIC_IMAGE"
lint
:
stage
:
test
image
:
node:12-buster
needs
:
-
node_modules
script
:
-
npm run lint
-
docker push "${IMAGE}"
pages
:
extends
:
.prezbuilder
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment