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
88cafad1
Commit
88cafad1
authored
2 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
lakedrops/portal/data-core/datacore-parent#30 Add DataCore tasks for scheduled pipelines
parent
576cb47f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
datacore.yml
+67
-28
67 additions, 28 deletions
datacore.yml
with
67 additions
and
28 deletions
datacore.yml
+
67
−
28
View file @
88cafad1
stages
:
-
build
-
prepare
-
postprocess
-
deploy
include
:
...
...
@@ -8,6 +9,9 @@ include:
ref
:
main
file
:
'
/mixins.yml'
variables
:
DATACORE_IMPORT_INTERNAL_USERS
:
'
no'
DeployDataCore
:
stage
:
build
tags
:
...
...
@@ -67,6 +71,9 @@ DeployDataCore:
refs
:
-
develop
-
/^feature.*$/
except
:
refs
:
-
schedule
Validate Export
:
stage
:
build
...
...
@@ -94,8 +101,10 @@ Validate Export:
except
:
variables
:
-
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'main'
refs
:
-
schedule
ImportIntoDatacore
:
Prepare Import
:
stage
:
prepare
tags
:
-
deploylocal
...
...
@@ -108,19 +117,28 @@ ImportIntoDatacore:
-
git fetch
-
git pull
-
cd /data/${CI_COMMIT_REF_NAME}
variables
:
GIT_STRATEGY
:
none
cache
:
{}
only
:
refs
:
-
develop
-
/^feature.*$/
-
schedules
ImportIntoDatacore
:
stage
:
prepare
tags
:
-
deploylocal
needs
:
-
job
:
PrepareImport
before_script
:
!reference
[
.prepareaccess
,
before_script
]
script
:
-
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
-
if [[ "DATACORE_IMPORT_INTERNAL_USERS" == "yes ]]; then dc exec app curl --fail -X POST http://localhost:4100/api/import/internalusers; fi
-
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
-
cd /data/${CI_COMMIT_REF_NAME}/data
-
git status > /tmp/gitstatus.log
-
EC=0
-
grep "nothing to commit, working tree clean" /tmp/gitstatus.log || EC=$?
-
if [[ $EC -eq 0 ]]; then exit 0; fi
-
git add *
-
git commit -am "Updated assets by data core"
-
if [[ "$CI_COMMIT_REF_NAME" == "develop" ]]; then git push -o ci.skip -o merge_request.create -o merge_request.target=main -o merge_request.merge_when_pipeline_succeeds; fi
-
if [[ "$CI_COMMIT_REF_NAME" != "develop" ]]; then git push -o ci.skip; fi
variables
:
GIT_STRATEGY
:
none
cache
:
{}
...
...
@@ -128,6 +146,9 @@ ImportIntoDatacore:
refs
:
-
develop
-
/^feature.*$/
except
:
refs
:
-
schedule
.deployToDrupal
:
stage
:
deploy
...
...
@@ -140,10 +161,11 @@ ImportIntoDatacore:
except
:
refs
:
-
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
DataCore
XRM Check New Users
:
XRM Check New Users
:
stage
:
build
tags
:
-
deploylocal
...
...
@@ -152,23 +174,16 @@ DataCore XRM Check New Users:
cache
:
{}
only
:
refs
:
-
chat
-
schedules
except
:
variables
:
-
$DATACORE_JOB_NAME && $DATACORE_JOB_NAME != "XrmCheckNewUser"
before_script
:
!reference
[
.prepareaccess
,
before_script
]
script
:
-
if [[ ! -d /data/develop/data/.git ]]; then git clone -b develop "git@$CI_SERVER_HOST:$CI_PROJECT_PATH.git" /data/develop/data; fi
-
cd /data/develop/data
-
git config user.email "deployment@lakedrops.com"
-
git config user.name "Deployment"
-
git fetch
-
git pull
-
cd /data/develop
-
cd /data/${CI_COMMIT_REF_NAME}
-
dc exec app curl --fail -X GET http://localhost:4000/api/import/realestate/xrm/newusers >/dev/null 2>&1
DataCore
XRM Sync
:
XRM Sync
:
stage
:
build
tags
:
-
deploylocal
...
...
@@ -177,18 +192,42 @@ DataCore XRM Sync:
cache
:
{}
only
:
refs
:
-
chat
-
schedules
except
:
variables
:
-
$DATACORE_JOB_NAME && $DATACORE_JOB_NAME != "XrmSync"
before_script
:
!reference
[
.prepareaccess
,
before_script
]
script
:
-
if [[ ! -d /data/develop/data/.git ]]; then git clone -b develop "git@$CI_SERVER_HOST:$CI_PROJECT_PATH.git" /data/develop/data; fi
-
cd /data/develop/data
-
git config user.email "deployment@lakedrops.com"
-
git config user.name "Deployment"
-
git fetch
-
git pull
-
cd /data/develop
-
cd /data/${CI_COMMIT_REF_NAME}
-
dc exec app curl --fail -X GET http://localhost:4000/api/import/realestate/xrm/sync >/dev/null 2>&1
Push Changes
:
stage
:
postprocess
tags
:
-
deploylocal
needs
:
-
job
:
ImportIntoDatacore
optional
:
true
-
job
:
XRM Check New Users
optional
:
true
-
job
:
XRM Sync
optional
:
true
before_script
:
!reference
[
.prepareaccess
,
before_script
]
script
:
-
cd /data/${CI_COMMIT_REF_NAME}/data
-
git status > /tmp/gitstatus.log
-
EC=0
-
grep "nothing to commit, working tree clean" /tmp/gitstatus.log || EC=$?
-
if [[ $EC -eq 0 ]]; then exit 0; fi
-
git add *
-
git commit -am "Updated assets by data core"
-
if [[ "$CI_COMMIT_REF_NAME" == "develop" ]]; then git push -o ci.skip -o merge_request.create -o merge_request.target=main -o merge_request.merge_when_pipeline_succeeds; fi
-
if [[ "$CI_COMMIT_REF_NAME" != "develop" ]]; then git push -o ci.skip; fi
variables
:
GIT_STRATEGY
:
none
cache
:
{}
only
:
refs
:
-
develop
-
/^feature.*$/
-
schedules
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