Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
2024-website
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
2024-website
Merge requests
!5
Revert "Update .gitlab-ci.yml file"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Revert "Update .gitlab-ci.yml file"
revert-0d58cc48
into
main
Overview
0
Commits
1
Pipelines
1
Changes
1
Merged
Robert Lanzafame
requested to merge
revert-0d58cc48
into
main
6 months ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
This reverts commit
0d58cc48
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
4c552027
1 commit,
6 months ago
1 file
+
31
−
40
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
.gitlab-ci.yml
+
31
−
40
Options
image
:
python:3.10-bullseye
image
:
ruby:3.2.2-bookworm
stages
:
-
build
-
deploy
variables
:
PIP_CACHE_DIR
:
"
$CI_PROJECT_DIR/.cache/pip"
LC_ALL
:
C.UTF-8
cache
:
paths
:
-
.cache/pip
-
venv/
before_script
:
-
python -V
-
pip install virtualenv
-
virtualenv venv
-
source venv/bin/activate
-
pip install -r requirements.txt
-
apt-get update && apt-get install -y jq
# Install jq
build-book
:
build-page
:
stage
:
build
variables
:
JEKYLL_ENV
:
${{ CI_COMMIT_BRANCH == "publish" && "production" || "development" }}
before_script
:
-
gem install bundler
-
bundle install
-
chmod +x ./build-page.sh
script
:
-
|
if [ "$CI_COMMIT_BRANCH" == "publish" ]; then
echo "Building production version"
teachbooks build --publish book/ > >(tee stdout.log) 2> >(tee stderr.log >&2)
echo "Running on publish branch"
./build-page.sh "/" true
elif [ "$CI_COMMIT_BRANCH" == "main" ]; then
echo "Running on main branch"
./build-page.sh "/2024/draft" false
else
echo "
Building draft version
"
teachbooks build book/ > >(tee stdout.log) 2> >(tee stderr.log >&2)
echo "
Running on other branches
"
./build-page.sh "/draft" false
fi
artifacts
:
paths
:
-
book/_build/html
-
stdout.log
-
stderr.log
expire_in
:
1 week
-
public
rules
:
-
if
:
$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "publish"
-
if
:
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "publish"
@@ -44,46 +37,44 @@ build-book:
deploy-draft
:
stage
:
deploy
needs
:
[
"
build-
book
"
]
needs
:
[
"
build-
page
"
]
script
:
-
|
BUILD_JOB_ID=$(curl -s -H "PRIVATE-TOKEN: $CI_JOB_TOKEN" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/jobs?scope[]=success" | jq '.[] | select(.name=="build-book") | .id')
curl -X POST https://mude.citg.tudelft.nl/hooks/book-deploy-draft \
curl -X POST https://mude.citg.tudelft.nl/hooks/website-deploy-draft \
-H "Content-Type: application/json" \
-H "X-Gitlab-Token: glpat-
m4CzsDqHnXNn3Pf5Whyd
" \
-H "X-Gitlab-Token: glpat-
sQ82fiSMo1kCi2TpgSfr
" \
-d '{
"object_kind": "pipeline",
"object_attributes": {
"status": "success",
"ref": "main"
},
"build_job_id": "'$BUILD_JOB_ID'"
}
}'
environment
:
name
:
draft
url
:
https://mude.citg.tudelft.nl/2024/
book/
draft
url
:
https://mude.citg.tudelft.nl/2024/draft
rules
:
-
if
:
$CI_COMMIT_BRANCH == "main"
-
if
:
$CI_COMMIT_BRANCH == "main" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"
when
:
always
deploy-production
:
stage
:
deploy
needs
:
[
"
build-
book
"
]
needs
:
[
"
build-
page
"
]
script
:
-
|
BUILD_JOB_ID=$(curl -s -H "PRIVATE-TOKEN: $CI_JOB_TOKEN" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/jobs?scope[]=success" | jq '.[] | select(.name=="build-book") | .id')
curl -X POST https://mude.citg.tudelft.nl/hooks/book-deploy-production \
curl -X POST https://mude.citg.tudelft.nl/hooks/website-deploy \
-H "Content-Type: application/json" \
-H "X-Gitlab-Token: glpat-
m4CzsDqHnXNn3Pf5Whyd
" \
-H "X-Gitlab-Token: glpat-
sQ82fiSMo1kCi2TpgSfr
" \
-d '{
"object_kind": "pipeline",
"object_attributes": {
"status": "success",
"ref": "publish"
},
"build_job_id": "'$BUILD_JOB_ID'"
}
}'
environment
:
name
:
production
url
:
https://mude.citg.tudelft.nl/2024
/book
url
:
https://mude.citg.tudelft.nl/2024
rules
:
-
if
:
$CI_COMMIT_BRANCH == "publish"
\ No newline at end of file
-
if
:
$CI_COMMIT_BRANCH == "publish" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "publish"
when
:
always
\ No newline at end of file
Loading