Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TAM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Labrador
TAM
Merge requests
!394
Switch to shared CI
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Switch to shared CI
shared-ci
into
development
Overview
0
Commits
1
Pipelines
6
Changes
16
Merged
Switch to shared CI
Ruben Backx
requested to merge
shared-ci
into
development
10 months ago
Overview
0
Commits
1
Pipelines
6
Changes
16
0
0
Merge request reports
Compare
development
version 1
a33bea9b
10 months ago
development (base)
and
latest version
latest version
69629dae
1 commit,
10 months ago
version 1
a33bea9b
1 commit,
10 months ago
16 files
+
10
−
1064
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
16
scripts/migration-cross-branch-test.sh deleted
100755 → 0
+
0
−
56
View file @ 8ada0465
#!/usr/bin/env sh
THIS_FILE
=
$0
TARGET_BRANCH
=
$1
if
[
-z
"
$TARGET_BRANCH
"
]
;
then
echo
"No target branch provided, not running branch-to-branch migration test."
echo
"Please run this script again as: './scripts/migration-cross-branch-test.sh <BRANCH_NAME>'"
exit
0
fi
# Stash any current changes to later unstash
CURRENT_STASHES
=
$(
git stash list |
wc
-l
)
git stash
NEW_STASHES
=
$(
git stash list |
wc
-l
)
if
[
"
$CURRENT_STASHES
"
!=
"
$NEW_STASHES
"
]
;
then
echo
"Successfully stashed your current changes"
STASHED
=
"yes"
fi
# Run migration test with DB population on target branch, this should populate the DB and leave it for the next run
git checkout
"
$TARGET_BRANCH
"
git pull
# Stupid self-check to see whether this is not the first time this script is introduced
if
[
!
-f
"
$THIS_FILE
"
]
;
then
echo
"Target branch does not contain script for migrations, assuming this is the first cross-branch run."
git checkout -
if
[
-n
"
$STASHED
"
]
;
then
git stash pop
fi
exit
0
fi
./gradlew clean
./gradlew
test
--tests
"*.MigrationApplicationTest"
-i
-x
generateGitProperties
EXIT_CODE
=
$?
git checkout -
if
[
-n
"
$STASHED
"
]
;
then
git stash pop
fi
if
[
!
$EXIT_CODE
-eq
0
]
;
then
echo
"Non-zero exit code from migration test, returning"
exit
1
fi
# Then run the migration test on current branch, but without loading a new database to see if data transfer is okay
./gradlew clean
./gradlew
test
--tests
"*.NoDbMigrationApplicationTest"
-i
-x
generateGitProperties
exit
$?
Loading