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
9f245ce5
Unverified
Commit
9f245ce5
authored
5 years ago
by
Cam Saul
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug in checksum calculation in driver build scripts
parent
5701a74a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/build-driver.sh
+11
-6
11 additions, 6 deletions
bin/build-driver.sh
with
11 additions
and
6 deletions
bin/build-driver.sh
+
11
−
6
View file @
9f245ce5
...
...
@@ -48,23 +48,26 @@ fi
# Calculate a checksum of all the driver source files. If we've already built the driver and the checksum is the same
# there's no need to build the driver a second time
calculate_checksum
()
{
find
"
$driver_project_dir
"
-name
'*.clj'
-or
-name
'*.yaml'
|
sort
|
cat
|
$md5_command
find
"
$driver_project_dir
"
-name
'*.clj'
-or
-name
'*.yaml'
|
sort
|
xargs
cat
|
$md5_command
}
# Check whether the saved checksum for the driver sources from the last build is the same as the current one. If so,
# we don't need to build again.
checksum_is_same
()
{
result
=
""
if
[
-f
"
$checksum_file
"
]
;
then
old_checksum
=
`
cat
"
$checksum_file
"
`
if
[
"
$(
calculate_checksum
)
"
==
"
$old_checksum
"
]
;
then
current_checksum
=
`
calculate_checksum
`
echo
"Checksum of source files for previous build:
$old_checksum
"
echo
"Current checksum of source files:
$current_checksum
"
if
[
"
$current_checksum
"
==
"
$old_checksum
"
]
;
then
# Make sure the target driver JAR actually exists as well!
if
[
-f
"
$target_jar
"
]
;
then
result
=
"
$driver
driver source unchanged since last build. Skipping re-build."
echo
"
$driver
driver source unchanged since last build. Skipping re-build."
return
0
fi
fi
fi
echo
"
$result
"
return
1
}
######################################## BUILDING THE DRIVER ########################################
...
...
@@ -228,9 +231,11 @@ mkdir -p resources/modules
if
[
$#
-eq
2
]
;
then
$2
# Build driver if checksum has changed
elif
[
!
"
$(
checksum_is_same
)
"
]
;
then
elif
!
checksum_is_same
;
then
echo
"Checksum has changed."
build_driver
||
retry_clean_build
# Either way, always copy the target uberjar to the dest location
else
echo
"Checksum is unchanged."
(
copy_target_to_dest
&&
verify_build
)
||
retry_clean_build
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