Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drupal
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
Container Registry
Model registry
Operate
Environments
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
Drupal
Commits
edcf6cfe
Commit
edcf6cfe
authored
2 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
mobimo/assets#42 Implement CI job to deploy assets to Drupal
parent
63c24e64
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
data-handling-ng.yml
+18
-10
18 additions, 10 deletions
data-handling-ng.yml
with
18 additions
and
10 deletions
data-handling-ng.yml
+
18
−
10
View file @
edcf6cfe
...
...
@@ -116,8 +116,8 @@ CopyDataToStage:
-
IFS=' ' read sourcebranch targetbranch <<< ${CHAT_INPUT}
-
echo "Source ${sourcebranch}"
-
echo "Target ${targetbranch}"
-
if [[ ! -d /data/${sourcebranch}/app ]]; then "Source branch does not exist!"; exit 1; fi
-
if [[ ! -d /data/${targetbranch}/app ]]; then "Target branch does not exist!"; exit 2; fi
-
if [[ ! -d /data/${sourcebranch}/app ]]; then
echo
"Source branch does not exist!"; exit 1; fi
-
if [[ ! -d /data/${targetbranch}/app ]]; then
echo
"Target branch does not exist!"; exit 2; fi
-
if [[ "${targetbranch}" == "main" ]]; then echo "Main branch is not an allowed target!"; exit 3; fi
-
docker compose --project-name ${PROJECT_NAME}_${sourcebranch} exec php drush sql:dump --result-file=/var/backups/mysql/drupal.sql
-
rsync -rlDzogtp /data/${sourcebranch}/files/ /data/${targetbranch}/files/
...
...
@@ -137,7 +137,7 @@ ResetLocales:
script
:
-
IFS=' ' read branch <<< ${CHAT_INPUT}
-
echo "Branch ${branch}"
-
if [[ ! -d /data/${branch}/app ]]; then "Branch does not exist!"; exit 1; fi
-
if [[ ! -d /data/${branch}/app ]]; then
echo
"Branch does not exist!"; exit 1; fi
-
cd /data/${branch}/app
-
docker compose --project-name ${PROJECT_NAME}_${branch} exec php drush -y sql:query "truncate locales_location;"
-
docker compose --project-name ${PROJECT_NAME}_${branch} exec php drush -y sql:query "truncate locales_source;"
...
...
@@ -150,18 +150,26 @@ ResetLocales:
# @todo Lets also itegrate through drupal_extra_locales, hmm, that's an Ansible variable
DeployAssetsToDrupal
:
variables
:
GIT_STRATEGY
:
none
tags
:
-
deploylocal
before_script
:
!reference
[
.prepareaccess
,
before_script
]
cache
:
{}
only
:
refs
:
-
triggers
-
chat
variables
:
-
$CI_PIPELINE_SOURCE == 'chat' || $TRIGGERTASK == 'DeployAssetsToDrupal'
script
:
-
echo "We need to pull the asset repository and do our work on the Drupal site"
# variables:
# - $CI_PIPELINE_SOURCE == 'chat' || $TRIGGERTASK == 'DeployAssetsToDrupal'
-
if [[ ! -d /data/${CI_COMMIT_REF_NAME}/app ]]; then echo "Branch does not exist!"; exit 1; fi
-
ASSET_REPO=$(yq eval .inventory.assets.url .lakedrops.yml)
-
if [[ "$ASSET_REPO" == "null" ]]; then exit 1; fi
-
ASSET_PATH=$(yq eval .inventory.assets.namespace .lakedrops.yml)
-
if [[ "$ASSET_PATH" == "null" ]]; then exit 2; fi
-
ASSET_BRANCH=$(yq eval .inventory.assets.branch .lakedrops.yml)
-
if [[ "$ASSET_BRANCH" == "null" ]]; then ASSET_BRANCH=main; fi
-
cd /data/${CI_COMMIT_REF_NAME}/app
-
rm -rf vendor/${ASSET_PATH}
-
git clone -b ${ASSET_BRANCH} ${ASSET_REPO} vendor/${ASSET_PATH}
-
drush migrate:import --all
-
drush migrate:import --all
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