Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
General
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitLab CI/CD
General
Commits
51a01791
Commit
51a01791
authored
1 year ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
#17
Add "--retry 2" to all curl commands
parent
bc8a9eaf
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
datacore.yml
+14
-14
14 additions, 14 deletions
datacore.yml
tagrelease.yml
+1
-1
1 addition, 1 deletion
tagrelease.yml
with
15 additions
and
15 deletions
datacore.yml
+
14
−
14
View file @
51a01791
...
...
@@ -20,23 +20,23 @@ DeployDataCore:
-
mkdir -p /data/${CI_COMMIT_REF_NAME}/data
-
cd /data/${CI_COMMIT_REF_NAME}
# Create docker-compose.yml
-
curl --silent https://gitlab.lakedrops.com/gitlab-ci-cd/general/-/raw/main/templates/datacore/docker-compose.yml | envsubst > docker-compose.yml
-
curl --silent
--retry 2
https://gitlab.lakedrops.com/gitlab-ci-cd/general/-/raw/main/templates/datacore/docker-compose.yml | envsubst > docker-compose.yml
# Create ./borgconfig/.env ./borgconfig/crontab.txt ./borgconfig/config.yaml
-
export HEALTHCHECK1=$(python3 /usr/local/bin/healthchecks.py get_curl_for_ping ${HEALTHCHECK_URL} ${HEALTHCHECK_API_KEY} --host=${HOST} --channel=${HEALTHCHECK_API_CHANNELS} --jobname="Borg Backup datacore_${CI_PROJECT_ID}_${CI_COMMIT_REF_NAME}" --schedule="55 */6 * * *")
-
export HEALTHCHECK2=$(python3 /usr/local/bin/healthchecks.py get_curl_for_ping ${HEALTHCHECK_URL} ${HEALTHCHECK_API_KEY} --host=${HOST} --channel=${HEALTHCHECK_API_CHANNELS} --jobname="Borg Backup Check datacore_${CI_PROJECT_ID}_${CI_COMMIT_REF_NAME}" --schedule="30 23 1 * *")
-
export EXTERNALREPO=
-
if [[ "$CI_COMMIT_REF_NAME" == "develop" ]]; then export EXTERNALREPO=" - ${DATACORE_BORGREPO}"; fi
-
curl --silent https://gitlab.lakedrops.com/gitlab-ci-cd/general/-/raw/main/templates/datacore/borg-config.yaml | envsubst > borgconfig/config.yaml
-
curl --silent https://gitlab.lakedrops.com/gitlab-ci-cd/general/-/raw/main/templates/datacore/borg-crontab.txt | envsubst > borgconfig/crontab.txt
-
curl --silent
--retry 2
https://gitlab.lakedrops.com/gitlab-ci-cd/general/-/raw/main/templates/datacore/borg-config.yaml | envsubst > borgconfig/config.yaml
-
curl --silent
--retry 2
https://gitlab.lakedrops.com/gitlab-ci-cd/general/-/raw/main/templates/datacore/borg-crontab.txt | envsubst > borgconfig/crontab.txt
-
if [[ ! -f borgconfig/.env ]]; then echo "${BORG_SSH_KEY}" > borgdata/ssh/id_rsa ||
true
; fi
-
if [[ ! -f borgconfig/.env ]]; then echo "StrictHostKeyChecking no" > borgdata/ssh/config ||
true
; fi
-
echo "BORG_PASSPHRASE=${BORG_PASSPHRASE}" > borgconfig/.env
# Create ./crontabs/jobs.ini
-
export HEALTHCHECK=$(python3 /usr/local/bin/healthchecks.py get_curl_for_ping ${HEALTHCHECK_URL} ${HEALTHCHECK_API_KEY} --host=${HOST} --channel=${HEALTHCHECK_API_CHANNELS} --jobname="DB Backup datacore_${CI_PROJECT_ID}_${CI_COMMIT_REF_NAME}" --schedule="30 0 * * *")
-
curl --silent https://gitlab.lakedrops.com/gitlab-ci-cd/general/-/raw/main/templates/datacore/jobs.ini | envsubst > crontabs/jobs.ini
-
curl --silent
--retry 2
https://gitlab.lakedrops.com/gitlab-ci-cd/general/-/raw/main/templates/datacore/jobs.ini | envsubst > crontabs/jobs.ini
# Download JAR file
-
|
curl --fail -s --header "Private-Token: ${GITLAB_PRIVATE_TOKEN}" "https://gitlab.lakedrops.com/api/v4/projects/311/packages/maven/de/bitegra/datacore/datacore-real-estate/${DATACORE_VERSION}/datacore-real-estate-${DATACORE_VERSION}.jar" -o app/datacore.jar
curl --fail -s
--retry 2
--header "Private-Token: ${GITLAB_PRIVATE_TOKEN}" "https://gitlab.lakedrops.com/api/v4/projects/311/packages/maven/de/bitegra/datacore/datacore-real-estate/${DATACORE_VERSION}/datacore-real-estate-${DATACORE_VERSION}.jar" -o app/datacore.jar
# Start containers
-
docker compose pull --quiet
-
docker compose up -d --quiet-pull --remove-orphans
...
...
@@ -50,7 +50,7 @@ DeployDataCore:
do
sleep 1
LOOP=$((LOOP-1))
if docker compose exec -u root app curl -I -s http://localhost:4100/v3/api-docs | grep "$REQUIRED";
if docker compose exec -u root app curl -I -s
--retry 2
http://localhost:4100/v3/api-docs | grep "$REQUIRED";
then
echo "DataCore started successfully"
exit 0;
...
...
@@ -128,9 +128,9 @@ ImportIntoDatacore:
before_script
:
!reference
[
.prepareaccess
,
before_script
]
script
:
-
cd /data/${CI_COMMIT_REF_NAME}
-
dc exec app curl --fail -X POST http://localhost:4100/api/import/basic
-
dc exec app curl --fail -X POST http://localhost:4100/api/import/realestate
-
dc exec app curl --fail -X POST http://localhost:4100/api/import/internalusers
-
dc exec app curl --fail
--retry 2
-X POST http://localhost:4100/api/import/basic
-
dc exec app curl --fail
--retry 2
-X POST http://localhost:4100/api/import/realestate
-
dc exec app curl --fail
--retry 2
-X POST http://localhost:4100/api/import/internalusers
variables
:
GIT_STRATEGY
:
none
cache
:
{}
...
...
@@ -155,7 +155,7 @@ ImportIntoDatacore:
-
tags
-
schedule
script
:
-
curl -X POST --fail -F token=${TRIGGERTOKEN} -F ref=${CI_COMMIT_REF_NAME} -F "variables[TRIGGERTASK]=DeployAssetsToDrupal" https://gitlab.lakedrops.com/api/v4/projects/${TRIGGERPROJECTID}/trigger/pipeline
-
curl -X POST --fail
--retry 2
-F token=${TRIGGERTOKEN} -F ref=${CI_COMMIT_REF_NAME} -F "variables[TRIGGERTASK]=DeployAssetsToDrupal" https://gitlab.lakedrops.com/api/v4/projects/${TRIGGERPROJECTID}/trigger/pipeline
XRM Check New Users
:
stage
:
build
...
...
@@ -173,7 +173,7 @@ XRM Check New Users:
before_script
:
!reference
[
.prepareaccess
,
before_script
]
script
:
-
cd /data/${CI_COMMIT_REF_NAME}
-
dc exec app curl --fail -X POST http://localhost:4100/api/import/newusers >/dev/null 2>&1
-
dc exec app curl --fail
--retry 2
-X POST http://localhost:4100/api/import/newusers >/dev/null 2>&1
XRM Sync
:
stage
:
build
...
...
@@ -191,7 +191,7 @@ XRM Sync:
before_script
:
!reference
[
.prepareaccess
,
before_script
]
script
:
-
cd /data/${CI_COMMIT_REF_NAME}
-
dc exec app curl --fail -X POST http://localhost:4100/api/import/sync >/dev/null 2>&1
-
dc exec app curl --fail
--retry 2
-X POST http://localhost:4100/api/import/sync >/dev/null 2>&1
Push Changes
:
stage
:
postprocess
...
...
@@ -207,8 +207,8 @@ Push Changes:
before_script
:
!reference
[
.prepareaccess
,
before_script
]
script
:
-
cd /data/${CI_COMMIT_REF_NAME}
-
dc exec app curl --fail -X GET http://localhost:4100/api/export/basic >/dev/null 2>&1
-
dc exec app curl --fail -X GET http://localhost:4100/api/export/realestate >/dev/null 2>&1
-
dc exec app curl --fail
--retry 2
-X GET http://localhost:4100/api/export/basic >/dev/null 2>&1
-
dc exec app curl --fail
--retry 2
-X GET http://localhost:4100/api/export/realestate >/dev/null 2>&1
-
cd /data/${CI_COMMIT_REF_NAME}/data
-
git status > /tmp/gitstatus.log
-
EC=0
...
...
This diff is collapsed.
Click to expand it.
tagrelease.yml
+
1
−
1
View file @
51a01791
...
...
@@ -28,7 +28,7 @@ Tag Release:
-
if [[ "$CI_COMMIT_MESSAGE" == *"[MAJOR_VERSION]"* ]]; then ARGS="--major"; fi
-
NEWTAG=$(gen-semver ${ARGS})
-
echo "New version ${NEWTAG}"
-
curl --fail -s -H "$PRIVHEADER" --data "tag_name=$NEWTAG" --data "ref=main" $TAGURL
-
curl --fail
--retry 2
-s -H "$PRIVHEADER" --data "tag_name=$NEWTAG" --data "ref=main" $TAGURL
rules
:
-
if
:
$CI_COMMIT_TAG
when
:
never
...
...
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