Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Book
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MUDE
Book
Commits
e583d928
Commit
e583d928
authored
6 months ago
by
Kwangjin Lee
Browse files
Options
Downloads
Patches
Plain Diff
Update .gitlab-ci.yml file
parent
0f057e3b
No related branches found
Branches containing commit
No related tags found
1 merge request
!367
test publish build
Pipeline
#245566
passed
6 months ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+74
-29
74 additions, 29 deletions
.gitlab-ci.yml
with
74 additions
and
29 deletions
.gitlab-ci.yml
+
74
−
29
View file @
e583d928
image
:
python:3.10-bullseye
stages
:
-
test
-
build
-
deploy
...
...
@@ -13,39 +12,85 @@ cache:
-
.cache/pip
-
venv/
# Before running other jobs, setup Python
before_script
:
-
python -V
-
pip install virtualenv
-
virtualenv venv
-
source venv/bin/activate
-
pip install -r requirements.txt
# This job tests if the book compiles gracefully after a new addition
test-build
:
stage
:
test
build-draft
:
stage
:
build
script
:
-
echo "Building draft version"
-
teachbooks build book/ > >(tee stdout.log) 2> >(tee stderr.log >&2)
artifacts
:
paths
:
-
book/_build/html
-
stdout.log
-
stderr.log
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
-
if
:
$CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE == "push"
-
if
:
$CI_COMMIT_BRANCH == "publish" && $CI_PIPELINE_SOURCE == "push"
-
if
:
$CI_COMMIT_BRANCH == "main"
-
if
:
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"
when
:
always
build-production
:
stage
:
build
script
:
-
echo "Building production version"
-
teachbooks build --publish book/ > >(tee stdout.log) 2> >(tee stderr.log >&2)
artifacts
:
paths
:
-
book/_build/html
-
stdout.log
-
stderr.log
rules
:
-
if
:
$CI_COMMIT_BRANCH == "publish"
-
if
:
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "publish"
when
:
always
deploy-draft
:
stage
:
deploy
needs
:
[
"
build-draft"
]
script
:
-
pip install -r requirements.txt
-
jupyter-book clean book/
-
jupyter-book build book/
# This job commits the built HTML to the publish-html branch
# push-html:
# stage: deploy
# only:
# - publish
# before_script:
# - apt-get update -y
# - apt-get install rsync -y
# - git config --global user.name "$GITLAB_USER_NAME"
# - git config --global user.email "$GITLAB_USER_EMAIL"
# - git fetch origin publish-html
# - git checkout publish-html
# script:
# - rsync -av --delete-after --exclude=".git/" --exclude=".cache/" --exclude="venv/" ./book/_build/html/ .
# - git add --all -- ':!.cache/*'
# - git commit --allow-empty -m "$CI_COMMIT_MESSAGE"
# - git push https://gitlab-ci-token:$ACCESS_TOKEN@gitlab.tudelft.nl/$CI_PROJECT_PATH.git publish-html
-
|
curl -X POST https://mude.citg.tudelft.nl/hooks/book-deploy-draft \
-H "Content-Type: application/json" \
-H "X-Gitlab-Token: glpat-m4CzsDqHnXNn3Pf5Whyd" \
-d '{
"object_kind": "pipeline",
"object_attributes": {
"status": "success",
"ref": "main"
}
}'
environment
:
name
:
draft
url
:
https://mude.citg.tudelft.nl/2024/book/draft
rules
:
-
if
:
$CI_COMMIT_BRANCH == "main"
-
if
:
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"
when
:
always
deploy-production
:
stage
:
deploy
needs
:
[
"
build-production"
]
script
:
-
|
curl -X POST https://mude.citg.tudelft.nl/hooks/book-deploy \
-H "Content-Type: application/json" \
-H "X-Gitlab-Token: glpat-m4CzsDqHnXNn3Pf5Whyd" \
-d '{
"object_kind": "pipeline",
"object_attributes": {
"status": "success",
"ref": "publish"
}
}'
environment
:
name
:
production
url
:
https://mude.citg.tudelft.nl/2024/book
rules
:
-
if
:
$CI_COMMIT_BRANCH == "publish"
-
if
:
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "publish"
when
:
always
\ 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