Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
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
No related tags found
1 merge request
!7
K8s deploy
Pipeline
#111310
failed
1 year ago
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:
...
@@ -10,28 +10,52 @@ stages:
-
build
-
build
-
deploy
-
deploy
build
:
.build
:
stage
:
build
stage
:
build
image
:
docker:24
variables
:
CONTEXT
:
"
."
before_script
:
before_script
:
-
npm ci
-
i=0; while [ "$i" -lt 12 ]; do docker info && break; sleep 5; i=$(( i + 1 )) ; done
script
:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
-
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
script
:
script
:
-
NUXT_APP_BASE_URL=/wiki npm run generate
-
docker build --pull -t "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA" --build-arg="BUILD_OPTIONS=$OPTIONS" -f $DOCKERFILE $CONTEXT
-
rm -rf public
-
docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA"
-
mv .output/public public
artifacts
:
paths
:
# build:
# The folder that contains the files to be exposed at the Page URL
# stage: build
-
public
# 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 ###
### Stage Install ###
FROM
node:19.5-bullseye-slim
as
install
FROM
node:19.5-bullseye-slim
as
install
RUN
mkdir
/usr/src/app
WORKDIR
/usr/src/app
WORKDIR
/usr/src/app
ENV
PATH /usr/src/app/node_modules/.bin:$PATH
ENV
PATH /usr/src/app/node_modules/.bin:$PATH
COPY
package*.json ./
COPY
package*.json ./
...
@@ -22,13 +21,32 @@ CMD ["npm", "run", "dev"]
...
@@ -22,13 +21,32 @@ CMD ["npm", "run", "dev"]
### STAGE: Build ###
### STAGE: Build ###
FROM
node:19.5-bullseye-slim
as
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
WORKDIR
/usr/src/app
COPY
--from=install /usr/src/app ./
COPY
--from=install /usr/src/app ./
COPY
. /usr/src/app
COPY
. /usr/src/app
RUN
npm run generate
RUN
npm run generate
### STAGE: NGINX ###
### STAGE: NGINX ###
FROM
nginx
:stable-alpine
FROM
nginx
inc/nginx-unprivileged:1.25
COPY
--from=build /usr/src/app/dist
/usr/share/nginx/html
# RUN rm -rf
/usr/share/nginx/html
/*
EXPOSE
80
COPY
--from=generate /usr/src/app/.output/public /usr/share/nginx/html
CMD
["nginx", "-g", "daemon off;"]
CMD
["nginx", "-g", "daemon off;"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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