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
!3
Main
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Main
main
into
publish
Overview
0
Commits
15
Pipelines
1
Changes
5
Merged
Kwangjin Lee
requested to merge
main
into
publish
7 months ago
Overview
0
Commits
15
Pipelines
1
Changes
5
Expand
0
0
Merge request reports
Compare
publish
publish (base)
and
latest version
latest version
299dbce8
15 commits,
7 months ago
5 files
+
193
−
413
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
.gitlab-ci.yml
+
69
−
41
Options
image
:
alpine
:latest
image
:
ruby
:latest
stages
:
-
build
-
deploy
deploy-to-2024-website
:
variables
:
GEM_HOME
:
$CI_PROJECT_DIR/vendor/bundle
cache
:
paths
:
-
vendor/bundle
before_script
:
-
bundle config set --local path 'vendor/bundle'
-
bundle install
build-page
:
stage
:
build
script
:
-
|
if [[ "$CI_COMMIT_BRANCH" == "main" ]]; then
JEKYLL_ENV=production bundle exec jekyll build --config _config_draft.yml --destination public
elif [[ "$CI_COMMIT_BRANCH" == "publish" ]]; then
JEKYLL_ENV=production bundle exec jekyll build --config _config.yml --destination public
else
echo "Branch is neither main nor publish. Skipping build."
exit 1
fi
-
echo "Listing contents of public directory:"
-
ls -laR public
artifacts
:
paths
:
-
public
expire_in
:
1 week
rules
:
-
if
:
$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "publish"
deploy-draft
:
stage
:
deploy
needs
:
[
"
build-page"
]
rules
:
-
if
:
$CI_COMMIT_BRANCH == "main"
script
:
-
|
curl -X POST https://mude.citg.tudelft.nl/hooks/website-deploy-draft \
-H "Content-Type: application/json" \
-H "X-Gitlab-Token: glpat-sQ82fiSMo1kCi2TpgSfr" \
-d '{
"object_kind": "pipeline",
"object_attributes": {
"status": "success",
"ref": "main"
}
}'
environment
:
name
:
draft
url
:
https://mude.citg.tudelft.nl/2024/draft
deploy-production
:
stage
:
deploy
needs
:
[
"
build-page"
]
rules
:
-
if
:
$CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE == "push"
before_script
:
# Install rsync and SSH client, set up SSH agent, and configure SSH
-
apk update && apk add --no-cache rsync openssh
-
eval $(ssh-agent -s)
-
echo "$MUDE_DEPLOYER_SSH_KEY" | tr -d '\r' | ssh-add -
-
mkdir -p ~/.ssh
-
chmod 700 ~/.ssh
-
echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
-
if
:
$CI_COMMIT_BRANCH == "publish"
script
:
# Debug information: show current directory and list files
-
'
echo
"Current
directory:
$PWD"'
-
ls -la
# Create and set permissions on the target directory on the remote server
-
ssh $MUDE_SERVER_USER@$MUDE_SERVER_ADDRESS "sudo mkdir -p /var/web_server/htdocs/2024-website"
-
ssh $MUDE_SERVER_USER@$MUDE_SERVER_ADDRESS "sudo chown -R $MUDE_SERVER_USER:$MUDE_SERVER_USER /var/web_server/htdocs/2024-website"
# Sync files to the remote server, excluding unnecessary directories
-
rsync -avz --delete-after --exclude=".git/" --exclude=".cache/" ./ $MUDE_SERVER_USER@$MUDE_SERVER_ADDRESS:/var/web_server/htdocs/2024-website/
# Install Jekyll and build the site on the remote server
-
|
ssh $MUDE_SERVER_USER@$MUDE_SERVER_ADDRESS "
# Update package lists
sudo apt-get update
# Install Ruby and other dependencies
sudo apt-get install -y ruby-full build-essential zlib1g-dev
# Set up Ruby Gems to install to the user's home directory
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME=\"\$HOME/gems\"' >> ~/.bashrc
echo 'export PATH=\"\$HOME/gems/bin:\$PATH\"' >> ~/.bashrc
source ~/.bashrc
# Install Jekyll and Bundler
gem install jekyll bundler
# Navigate to the project directory and build the site
cd /var/web_server/htdocs/2024-website
bundle install
JEKYLL_ENV=production bundle exec jekyll build --destination _site
# Ensure correct permissions for the _site directory
sudo chown -R $MUDE_SERVER_USER:$MUDE_SERVER_USER _site
sudo chmod -R 755 _site
"
curl -X POST https://mude.citg.tudelft.nl/hooks/website-deploy \
-H "Content-Type: application/json" \
-H "X-Gitlab-Token: glpat-sQ82fiSMo1kCi2TpgSfr" \
-d '{
"object_kind": "pipeline",
"object_attributes": {
"status": "success",
"ref": "publish"
}
}'
environment
:
name
:
production
url
:
https://mude.citg.tudelft.nl/2024-website
\ No newline at end of file
url
:
https://mude.citg.tudelft.nl/2024
\ No newline at end of file
Loading