Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wiki
Manage
Activity
Members
Labels
Plan
Issues
53
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MDM Lab
Wiki
Commits
cab588c8
Commit
cab588c8
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
build wiki server
parent
ad4e1aed
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!7
K8s deploy
Pipeline
#111310
failed
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+46
-22
46 additions, 22 deletions
.gitlab-ci.yml
Dockerfile
+22
-4
22 additions, 4 deletions
Dockerfile
with
68 additions
and
26 deletions
.gitlab-ci.yml
+
46
−
22
View file @
cab588c8
...
...
@@ -10,28 +10,52 @@ stages:
-
build
-
deploy
build
:
.build
:
stage
:
build
image
:
docker:24
variables
:
CONTEXT
:
"
."
before_script
:
-
npm ci
script
:
-
NUXT_APP_BASE_URL=/wiki/ npm run generate
artifacts
:
paths
:
-
.output/public
untracked
:
false
when
:
on_success
expire_in
:
"
30
days"
pages
:
stage
:
deploy
only
:
-
main
-
i=0; while [ "$i" -lt 12 ]; do docker info && break; sleep 5; i=$(( i + 1 )) ; done
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script
:
-
NUXT_APP_BASE_URL=/wiki npm run generate
-
rm -rf public
-
mv .output/public public
artifacts
:
paths
:
# The folder that contains the files to be exposed at the Page URL
-
public
-
docker build --pull -t "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA" --build-arg="BUILD_OPTIONS=$OPTIONS" -f $DOCKERFILE $CONTEXT
-
docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA"
# build:
# stage: build
# before_script:
# - npm ci
# script:
# - NUXT_APP_BASE_URL=/wiki/ npm run generate
# artifacts:
# paths:
# - .output/public
# untracked: false
# when: on_success
# expire_in: "30 days"
build:dev:nuxt
:
extends
:
.build-nuxt
variables
:
DOCKERFILE
:
"
Dockerfile"
IMAGE_NAME
:
"
df-wiki"
CONTEXT
:
"
./"
rules
:
-
if
:
$CI_COMMIT_BRANCH != "main"
# pages:
# stage: deploy
# only:
# - main
# script:
# - NUXT_APP_BASE_URL=/wiki npm run generate
# - rm -rf public
# - mv .output/public public
# artifacts:
# paths:
# # The folder that contains the files to be exposed at the Page URL
# - public
This diff is collapsed.
Click to expand it.
Dockerfile
+
22
−
4
View file @
cab588c8
### Stage Install ###
FROM
node:19.5-bullseye-slim
as
install
RUN
mkdir
/usr/src/app
WORKDIR
/usr/src/app
ENV
PATH /usr/src/app/node_modules/.bin:$PATH
COPY
package*.json ./
...
...
@@ -22,13 +21,32 @@ CMD ["npm", "run", "dev"]
### STAGE: Build ###
FROM
node:19.5-bullseye-slim
as
build
WORKDIR
/usr/src/app
COPY
--from=install /usr/src/app ./
COPY
. /usr/src/app
RUN
npm run build
### STAGE: serve ###
FROM
node:19.5-bullseye-slim
as
serve
WORKDIR
/usr/src/app
COPY
--from=build /usr/src/app/.output ./
RUN
ls
-al
./
CMD
[ "node", "server/index.mjs"]
### STAGE: Generate ###
FROM
node:19.5-bullseye-slim
as
generate
WORKDIR
/usr/src/app
COPY
--from=install /usr/src/app ./
COPY
. /usr/src/app
RUN
npm run generate
### STAGE: NGINX ###
FROM
nginx
:stable-alpine
COPY
--from=build /usr/src/app/dist
/usr/share/nginx/html
EXPOSE
80
FROM
nginx
inc/nginx-unprivileged:1.25
# RUN rm -rf
/usr/share/nginx/html
/*
COPY
--from=generate /usr/src/app/.output/public /usr/share/nginx/html
CMD
["nginx", "-g", "daemon off;"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment