Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
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
Service Desk
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
ac0959cc
Commit
ac0959cc
authored
6 years ago
by
Tom Robinson
Browse files
Options
Downloads
Patches
Plain Diff
Restore build-for-test
parent
45bd1bdf
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/build-for-test
+42
-0
42 additions, 0 deletions
bin/build-for-test
with
42 additions
and
0 deletions
bin/build-for-test
0 → 100755
+
42
−
0
View file @
ac0959cc
#!/usr/bin/env bash
set
-eu
VERSION_PROPERTY_NAME
=
"src_hash"
source-hash
()
{
# hash all the files that might change a backend-only uberjar build (for integration tests)
(
find src project.clj resources/sample-dataset.db.mv.db
-type
f
-print0
| xargs
-0
shasum
;
find resources
-type
f
\(
-iname
\*
.clj
-o
-iname
\*
.edn
-o
-iname
\*
.yaml
-o
-iname
\*
.properties
\)
-not
-name
"version.properties"
-print0
| xargs
-0
shasum
;
)
| shasum |
awk
'{ print $1 }'
}
uberjar-hash
()
{
# java -jar target/uberjar/metabase.jar version | grep -oE 'source_hash [a-f0-9]+' | awk '{ print $2 }'
# pulling the version.properties directly from the jar is much faster
unzip
-c
target/uberjar/metabase.jar version.properties |
grep
"
$VERSION_PROPERTY_NAME
"
|
cut
-f2
-d
=
}
check-uberjar-hash
()
{
expected_hash
=
$(
source-hash
)
actual_hash
=
$(
uberjar-hash
)
if
[
"
$expected_hash
"
==
"
$actual_hash
"
]
;
then
return
0
else
return
1
fi
}
build-uberjar-for-test
()
{
./bin/build version
echo
"
$VERSION_PROPERTY_NAME
=
$(
source-hash
)
"
>>
resources/version.properties
./bin/build uberjar
}
if
[
!
-f
"target/uberjar/metabase.jar"
]
||
!
check-uberjar-hash
;
then
echo
"Building uberjar for testing"
build-uberjar-for-test
else
echo
"Uberjar already up to date for testing"
fi
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