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
Commits
59235b07
Commit
59235b07
authored
7 months ago
by
Kwangjin Lee
Browse files
Options
Downloads
Patches
Plain Diff
revert
parent
e5664cd1
No related branches found
Branches containing commit
No related tags found
1 merge request
!10
merge for publish
Pipeline
#245067
passed
7 months ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+9
-10
9 additions, 10 deletions
.gitlab-ci.yml
build-page.sh
+16
-5
16 additions, 5 deletions
build-page.sh
with
25 additions
and
15 deletions
.gitlab-ci.yml
+
9
−
10
View file @
59235b07
...
...
@@ -10,6 +10,8 @@ variables:
build-page
:
stage
:
build
variables
:
JEKYLL_ENV
:
production
before_script
:
-
gem install bundler
-
bundle install
...
...
@@ -18,15 +20,12 @@ build-page:
-
chmod +x ./build-page.sh
script
:
-
|
if [ "$CI_COMMIT_BRANCH" == "publish" ]; then
echo "Running production build for publish branch"
./build-page.sh "/" "_config.yml"
elif [ "$CI_COMMIT_BRANCH" == "main" ]; then
echo "Running draft build for main branch"
./build-page.sh "/draft" "_config_draft.yml"
if [ "$CI_COMMIT_BRANCH" == "publish" ] || [ "$CI_COMMIT_BRANCH" == "main" ]; then
echo "Running on branch $CI_COMMIT_BRANCH"
./build-page.sh "/" true
else
echo "
Branch $CI_COMMIT_BRANCH is not configured for building.
"
exit 1
echo "
Running on other branches
"
./build-page.sh /draft false
fi
artifacts
:
paths
:
...
...
@@ -43,7 +42,7 @@ deploy-draft:
-
|
curl -X POST https://mude.citg.tudelft.nl/hooks/website-deploy-draft \
-H "Content-Type: application/json" \
-H "X-Gitlab-Token:
YOUR_TOKEN_HERE
" \
-H "X-Gitlab-Token:
glpat-sQ82fiSMo1kCi2TpgSfr
" \
-d '{
"object_kind": "pipeline",
"object_attributes": {
...
...
@@ -65,7 +64,7 @@ deploy-production:
-
|
curl -X POST https://mude.citg.tudelft.nl/hooks/website-deploy \
-H "Content-Type: application/json" \
-H "X-Gitlab-Token:
YOUR_TOKEN_HERE
" \
-H "X-Gitlab-Token:
glpat-sQ82fiSMo1kCi2TpgSfr
" \
-d '{
"object_kind": "pipeline",
"object_attributes": {
...
...
This diff is collapsed.
Click to expand it.
build-page.sh
+
16
−
5
View file @
59235b07
#!/bin/bash
PAGE_ROOT
=
${
1
:-
"/"
}
CONFIG_FILE
=
${
2
:-
"_config.yml"
}
IS_PUBLISH_DEPLOYMENT
=
${
2
:-
false
}
PAGE_ROOT
=
$(
echo
"
$PAGE_ROOT
"
|
sed
's:/*$::'
)
echo
"Using configuration file:
$CONFIG_FILE
"
echo
"Publishing to page root:
\"
$PAGE_ROOT
\"
"
if
[
"
$IS_PUBLISH_DEPLOYMENT
"
=
true
]
;
then
echo
"Using publish deployment strategy"
# Remove the baner which identifies the book as a draft
if
!
command
-v
yq &>/dev/null
;
then
echo
"yq could not be found, the draft banner cannot be removed"
echo
"Please install yq (with APT or via https://github.com/mikefarah/yq#install) and try again"
else
cp
_config.yml _config.yml.bak
yq
-i
'.is_draft = false'
_config.yml
fi
else
echo
"Using draft deployment strategy"
fi
# Execute the Jekyll build command with the selected config file
bundle
exec
jekyll build
-d
public
-b
"
$PAGE_ROOT
"
--config
"
$CONFIG_FILE
"
echo
"Publishing to page root:
\"
$PAGE_ROOT
\"
"
bundle
exec
jekyll build
-d
public
-b
"
$PAGE_ROOT
"
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