Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/maven/fixes/9.1' into maven/rele…
Browse files Browse the repository at this point in the history
…ase/9.1
  • Loading branch information
metaventis-build committed Sep 11, 2024
2 parents a509c6a + 522590a commit 55290d6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ default:
image: maven:3.8.4-jdk-8

stages:
- lint
- test
- deploy

check-helmreadme:
stage: lint
stage: test
image: node:lts-alpine3.20
script:
- wget -qO- https://github.com/bitnami/readme-generator-for-helm/archive/refs/tags/2.6.1.tar.gz | tar -xz -C /tmp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,25 @@ backup() {


if [[ -n $repodb ]] ; then
echo "backup postgres"
if [[ "$($COMPOSE_EXEC ps repository-mongo -a)" != "no such service: repository-mongo" ]]; then
echo "backup mongo"

if [[ -n $compressed ]] ; then
$COMPOSE_EXEC exec -t repository-mongo sh -c "mongodump --archive --gzip -u ${REPOSITORY_MONGO_ROOT_USER:-root} -p ${REPOSITORY_MONGO_ROOT_PASS:-root}" >"$backupDir/repository-mongo.gz" || {
rm -rf "$backupDir"
echo "ERROR on creating mongodb dump"
exit 1
}
else
$COMPOSE_EXEC exec -t repository-mongo sh -c "mongodump --archive -u ${REPOSITORY_MONGO_ROOT_USER:-root} -p ${REPOSITORY_MONGO_ROOT_PASS:-root}" >"$backupDir/repository-mongo.dump" || {
rm -rf "$backupDir"
echo "ERROR on creating mongodb dump"
exit 1
}
fi
fi

echo "backup postgres"
if [[ -n $compressed ]] ; then
$COMPOSE_EXEC exec -t repository-database sh -c "export PGPASSWORD=${REPOSITORY_DATABASE_PASS:-repository}; pg_dump --username ${REPOSITORY_DATABASE_USER:-repository} --format custom --no-owner --no-privileges ${REPOSITORY_DATABASE_NAME:-repository} | gzip" >"$backupDir/repository-db.gz" || {
rm -rf "$backupDir"
Expand Down

0 comments on commit 55290d6

Please sign in to comment.