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
ec17cfe7
Commit
ec17cfe7
authored
2 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Add support for local DB file for testing during build pipeline
parent
8fa1d5b4
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
lakedrops-execute.yml
+3
-0
3 additions, 0 deletions
lakedrops-execute.yml
lakedrops.yml
+3
-0
3 additions, 0 deletions
lakedrops.yml
test-and-deploy.yml
+53
-31
53 additions, 31 deletions
test-and-deploy.yml
tests/lakedrops.yml
+25
-0
25 additions, 0 deletions
tests/lakedrops.yml
with
84 additions
and
31 deletions
lakedrops-execute.yml
+
3
−
0
View file @
ec17cfe7
...
...
@@ -37,6 +37,9 @@ Import DB:
Import DB NG
:
extends
:
'
.importdbNG'
Import Local DB
:
extends
:
'
.importdbLocal'
Update DB
:
extends
:
'
.updatedb'
...
...
This diff is collapsed.
Click to expand it.
lakedrops.yml
+
3
−
0
View file @
ec17cfe7
...
...
@@ -4,8 +4,10 @@ variables:
DISABLE_CI_TEST_BACKSTOP
:
1
DISABLE_CI_TEST_BEHAT
:
0
DISABLE_CI_TEST_CODESTYLE
:
0
DISABLE_CI_TEST_CYPRESSE2E
:
1
DISABLE_CI_TEST_INVENTORY
:
1
DISABLE_CI_TEST_PHPUNIT
:
0
DISABLE_CONFIG_IMPORT
:
0
DISABLE_DEPLOYMENT
:
0
DISABLE_DEPLOYMENT_LOCAL
:
1
DISABLE_GITLAB_CI_TESTS
:
0
...
...
@@ -23,6 +25,7 @@ variables:
LAKEDROPS_CI_REF
:
main
LAKEDROPS_CI_FILE
:
disabled.yml
LAKEDROPS_DEBUG
:
0
LOCALDBFILE
:
none
NAMESPACES_CHECK_UPDATE
:
drupal/* bitegra/* lakedrops/*
PHP_MAJOR_VERSION
:
7
PHP_MINOR_VERSION
:
4
...
...
This diff is collapsed.
Click to expand it.
test-and-deploy.yml
+
53
−
31
View file @
ec17cfe7
...
...
@@ -119,6 +119,23 @@ Debug:
key
:
build-prod-ng-${COMPOSE_PROJECT_NAME}
<<
:
*cache_paths
.import_db_default
:
&import_db_default
stage
:
prepare
tags
:
-
default
image
:
registry.lakedrops.com/docker/gitlab-drupal-ci/php-${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}
cache
:
{}
variables
:
GIT_STRATEGY
:
none
script
:
-
docker cp ${PROJECT_NAME}.sql ${COMPOSE_PROJECT_NAME}-php-1:/var/www/html
-
drush sql:drop --yes
-
drush sql:query --file=../${PROJECT_NAME}.sql
-
drush cr
-
if [[ "${SKIPCONFIGIMPORT}" == "no" ]]; then drush -y config-import; fi
-
drush updatedb
-
drush cr
.prerequisites
:
stage
:
validation
tags
:
...
...
@@ -140,7 +157,7 @@ Debug:
if [[ "$DISABLE_CI_TESTS" == "1" ]]; then
TESTSDISABLED="yes"
GITLABTESTSDISABLED="yes"
elif [[ "$DISABLE_CI_TEST_B
EHAT
" == "1" ]]; then
elif [[ "$DISABLE_CI_TEST_B
ACKSTOP" == "1" && "$DISABLE_CI_TEST_BEHAT" == "1" && "$DISABLE_CI_TEST_CYPRESSE2E
" == "1" ]]; then
echo "DB not required"
elif [[ "$CI_COMMIT_REF_NAME" == "main" ]]; then
DBREQUIRED="yes"
...
...
@@ -193,6 +210,9 @@ Debug:
if [[ "$CI_COMMIT_MESSAGE" == *"[SKIP_CONFIG_IMPORT]"* ]]; then
SKIPCONFIGIMPORT="yes"
fi
if [[ "$DISABLE_CONFIG_IMPORT" == "1" ]]; then
SKIPCONFIGIMPORT="yes"
fi
if [[ "$TESTSDISABLED" == "no" ]]; then
INCLUDELAKEDROPSTESTS="yes"
...
...
@@ -366,6 +386,8 @@ Debug:
when
:
never
-
if
:
'
$TESTSDISABLED
==
"yes"'
when
:
never
-
if
:
'
$LOCALDBFILE
!=
"none"'
when
:
never
-
if
:
'
$DISABLE_CI_TESTS
!=
"1"'
.dumpdbNG
:
...
...
@@ -396,24 +418,12 @@ Debug:
when
:
never
-
if
:
'
$TESTSDISABLED
==
"yes"'
when
:
never
-
if
:
'
$LOCALDBFILE
!=
"none"'
when
:
never
-
if
:
'
$DISABLE_CI_TESTS
!=
"1"'
.importdb
:
stage
:
prepare
tags
:
-
default
image
:
registry.lakedrops.com/docker/gitlab-drupal-ci/php-${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}
cache
:
{}
variables
:
GIT_STRATEGY
:
none
script
:
-
docker cp ${PROJECT_NAME}.sql ${COMPOSE_PROJECT_NAME}-php-1:/var/www/html
-
drush sql:drop --yes
-
drush sql:query --file=../${PROJECT_NAME}.sql
-
drush cr
-
if [[ "${SKIPCONFIGIMPORT}" == "no" ]]; then drush config-import; fi
-
drush updatedb
-
drush cr
<<
:
*import_db_default
rules
:
-
if
:
'
$DISABLE_DEPLOYMENT
!=
"0"'
when
:
never
...
...
@@ -425,27 +435,15 @@ Debug:
when
:
never
-
if
:
'
$TESTSDISABLED
==
"yes"'
when
:
never
-
if
:
'
$LOCALDBFILE
!=
"none"'
when
:
never
-
if
:
'
$DISABLE_CI_TESTS
!=
"1"'
dependencies
:
-
'
Build
Site'
-
'
Download
DB'
.importdbNG
:
stage
:
prepare
tags
:
-
default
image
:
registry.lakedrops.com/docker/gitlab-drupal-ci/php-${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}
cache
:
{}
variables
:
GIT_STRATEGY
:
none
script
:
-
docker cp ${PROJECT_NAME}.sql ${COMPOSE_PROJECT_NAME}-php-1:/var/www/html
-
drush sql:drop --yes
-
drush sql:query --file=../${PROJECT_NAME}.sql
-
drush cr
-
if [[ "${SKIPCONFIGIMPORT}" == "no" ]]; then drush config-import; fi
-
drush updatedb
-
drush cr
<<
:
*import_db_default
rules
:
-
if
:
'
$DISABLE_DEPLOYMENT
!=
"0"'
when
:
never
...
...
@@ -457,11 +455,35 @@ Debug:
when
:
never
-
if
:
'
$TESTSDISABLED
==
"yes"'
when
:
never
-
if
:
'
$LOCALDBFILE
!=
"none"'
when
:
never
-
if
:
'
$DISABLE_CI_TESTS
!=
"1"'
dependencies
:
-
'
Build
Site'
-
'
Download
DB
NG'
.importdbLocal
:
<<
:
*import_db_default
variables
:
GIT_STRATEGY
:
fetch
before_script
:
-
cp ${LOCALDBFILE} ${PROJECT_NAME}.sql.gz
-
gunzip ${PROJECT_NAME}.sql.gz
rules
:
-
if
:
'
$DISABLE_DEPLOYMENT
!=
"0"'
when
:
never
-
if
:
'
$DISABLE_DEPLOYMENT_LOCAL
!=
"0"'
when
:
never
-
if
:
'
$DBREQUIRED
==
"no"'
when
:
never
-
if
:
'
$TESTSDISABLED
==
"yes"'
when
:
never
-
if
:
'
$LOCALDBFILE
==
"none"'
when
:
never
-
if
:
'
$DISABLE_CI_TESTS
!=
"1"'
dependencies
:
-
'
Build
Site'
.updatedb
:
stage
:
prepare
tags
:
...
...
This diff is collapsed.
Click to expand it.
tests/lakedrops.yml
+
25
−
0
View file @
ec17cfe7
...
...
@@ -92,3 +92,28 @@ Test Backstop:
-
'
Build
Theme'
rules
:
-
if
:
'
$DISABLE_CI_TEST_BACKSTOP
!=
"1"'
Test Cypress E2E
:
<<
:
*test_lakedrops_default
needs
:
-
job
:
Build Site
-
job
:
Build Theme
-
job
:
Import DB
optional
:
true
-
job
:
Import DB NG
optional
:
true
-
job
:
Update DB
optional
:
true
script
:
-
cypress run --browser firefox --project /e2e
artifacts
:
name
:
cypresse2e
when
:
always
paths
:
-
tests/cypress/screenshots
-
tests/cypress/videos
dependencies
:
-
'
Build
Site'
-
'
Build
Theme'
rules
:
-
if
:
'
$DISABLE_CI_TEST_CYPRESSE2E
!=
"1"'
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