***
Wartungsfenster jeden ersten Mittwoch vormittag im Monat
***
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CRDM Logging Setup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
Center for Research Data Management
CRDM Logging Setup
Merge requests
!8
Various improvements
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Various improvements
st/dev
into
main
Overview
1
Commits
5
Pipelines
0
Changes
15
Merged
Tsepelakis, Sotirios
requested to merge
st/dev
into
main
7 months ago
Overview
1
Commits
5
Pipelines
0
Changes
15
Expand
Setup: adjust for OpenSearch v2
️ Services: add Certbot with auto SSL renewal
️ Update License information
CI/CD: create pipeline
Global: restructure files
closes
#3 (closed)
0
0
Merge request reports
Compare
main
version 1
3a4f8fcd
7 months ago
main (base)
and
latest version
latest version
732019ed
5 commits,
7 months ago
version 1
3a4f8fcd
5 commits,
7 months ago
15 files
+
427
−
109
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
15
Search (e.g. *.vue) (Ctrl+P)
.gitlab-ci/deploy.sh
0 → 100755
+
57
−
0
Options
#!/bin/bash
#
# Deployment script for CRDM Logs.
# Intended for execution by the GitLab Runner.
set
-euo
pipefail
# Ensure required environment variables are set.
# DEPLOYMENT_HOST denotes the SSH TARGET. Can be only ONE IP or DNS name.
if
[
-z
"
$DEPLOYMENT_HOST
"
]
;
then
echo
"[ERROR] Make sure DEPLOYMENT_HOST is set."
>
&2
exit
1
fi
# ----------------------- #
# Repository checks #
# ----------------------- #
DEPLOYMENT_PATH
=
"
${
DEPLOYMENT_PATH
:-
crdm
-logging-setup
}
"
SSH_TARGET
=
"
${
DEPLOYMENT_USER
:-
logs
}
@
${
DEPLOYMENT_HOST
}
"
# SSH to target, initialize repo if it doesn't exist.
# Otherwise, tear down old deployment and pull changes.
ssh
"
${
SSH_TARGET
}
"
"bash"
<<-
EOF
set -eu pipefail
mkdir -p "
${
DEPLOYMENT_PATH
}
" && cd "
${
DEPLOYMENT_PATH
}
"
if git status > /dev/null 2>&1; then
echo "[INFO] Pulling origin."
git pull "
${
CI_REPOSITORY_URL
}
"
else
echo "[INFO] Git repository doesn't exist, cloning and setting up."
git clone "
${
CI_REPOSITORY_URL
}
" . > /dev/null 2>&1
fi
echo -n "[INFO] " && git checkout "
${
CI_COMMIT_BRANCH
}
"
EOF
# ----------------------- #
# .env file checks #
# ----------------------- #
# Dump variables and transfer the file.
echo
"[INFO] Dumping variables to .env file."
./scripts/dump-vars.sh
".env"
scp
".env"
"
${
SSH_TARGET
}
:
${
DEPLOYMENT_PATH
}
/.env"
# SSH again, check if ssl directory is empty: setup or rerun.
ssh
"
${
SSH_TARGET
}
"
"bash"
<<-
EOF
set -eu pipefail
cd "
${
DEPLOYMENT_PATH
}
"
if [
$(
find
"./ssl"
-type
f
!
-name
'.gitkeep'
|
wc
-l
)
-eq 0 ]; then
echo "[INFO] SSL directory only contains .gitkeep. Running setup.sh to create certificates."
./scripts/setup.sh
else
echo "[INFO] SSL directory is not empty. Skipping certificate setup."
docker compose up -d
fi
EOF
Loading