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
43eef28b
Commit
43eef28b
authored
May 04, 2020
by
Guillaume Perréal
Browse files
Tente de construire et d'utiliser une image Docker en CI.
parent
1235a977
Changes
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
43eef28b
default
:
tags
:
[
docker
]
image
:
node:14
retry
:
2
interruptible
:
true
stages
:
-
test
-
build
-
deploy
lint
:
stage
:
test
tags
:
[
docker
]
image
:
node:12-buster-slim
variables
:
NPM_CONFIG_CACHE
:
"
$CI_PROJECT_DIR/.npm"
before_script
:
...
...
@@ -18,23 +19,30 @@ lint:
-
npm install
script
:
-
npm run lint
artifacts
:
name
:
node_modules
expire_in
:
1 day
paths
:
-
node_modules/
cache
:
key
:
"
$CI_COMMIT_REF_
NAME
-$CI_JOB_NAME"
key
:
"
$CI_COMMIT_REF_
SLUG
-$CI_JOB_NAME"
paths
:
-
"
$NPM_CONFIG_CACHE"
docker
:
stage
:
build
tags
:
[
dind
]
variables
:
-
IMAGE
:
"
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
script
:
-
docker build --tag "$IMAGE" .
-
docker run --rm "$IMAGE" build
-
docker push "$IMAGE"
pages
:
stage
:
deploy
need
s
:
[
l
in
t
]
tag
s
:
[
d
in
d
]
rules
:
-
if
:
$CI_COMMIT_BRANCH == "master"
variables
:
-
IMAGE
:
"
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
script
:
-
npm run
build
-
docker run --rm -v "$PWD/src:/src/ro" -v "$PWD/public:/public" "$IMAGE"
build
artifacts
:
name
:
pages
paths
:
...
...
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