Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Cesium
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
bpresles
Cesium
Commits
3be8866f
Commit
3be8866f
authored
4 years ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
[enh] Add a script to check reproducible build
parent
bcfd7af0
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
scripts/check-reproducible-build.sh
+96
-0
96 additions, 0 deletions
scripts/check-reproducible-build.sh
with
96 additions
and
0 deletions
scripts/check-reproducible-build.sh
0 → 100755
+
96
−
0
View file @
3be8866f
#!/bin/bash
# Get to the root project
if
[[
"_"
==
"_
${
PROJECT_DIR
}
"
]]
;
then
SCRIPT_DIR
=
$(
dirname
$0
)
PROJECT_DIR
=
$(
cd
${
SCRIPT_DIR
}
/..
&&
pwd
)
export
PROJECT_DIR
fi
;
# Preparing Android environment
.
${
PROJECT_DIR
}
/scripts/env-android.sh
[[
$?
-ne
0
]]
&&
exit
1
cd
${
PROJECT_DIR
}
# ----------------------------------
# Check templates files build
# ----------------------------------
# Generate templates JS file
echo
"--------------------------------"
echo
"Building templates file... [1/2]"
gulp template
>
/dev/null
[[
$?
-ne
0
]]
&&
exit
1
TEMPLATES_FILE
=
"
${
PROJECT_DIR
}
/www/dist/dist_js/app/templates.js"
PLUGIN_TEMPLATES_FILE
=
"
${
PROJECT_DIR
}
/www/dist/dist_js/plugins/templates.js"
if
[[
!
-f
${
TEMPLATES_FILE
}
]]
||
[[
!
-f
${
PLUGIN_TEMPLATES_FILE
}
]]
;
then
echo
"ERROR - Missing file
${
TEMPLATES_FILE
}
or
${
PLUGIN_TEMPLATES_FILE
}
"
exit
1
;
fi
;
# Keep a copy
rm
-f
"
${
TEMPLATES_FILE
}
.tmp"
rm
-f
"
${
PLUGIN_TEMPLATES_FILE
}
.tmp"
mv
"
${
TEMPLATES_FILE
}
"
"
${
TEMPLATES_FILE
}
.tmp"
mv
"
${
PLUGIN_TEMPLATES_FILE
}
"
"
${
PLUGIN_TEMPLATES_FILE
}
.tmp"
# Second generation
echo
"Building templates file... [2/2]"
gulp template
>
/dev/null
[[
$?
-ne
0
]]
&&
exit
1
echo
"Building templates file [OK]"
# Check diff
echo
"Checking diff between templates files..."
diff
"
${
TEMPLATES_FILE
}
"
"
${
TEMPLATES_FILE
}
.tmp"
>
/tmp/templates.js.diff
if
[[
$?
-ne
0
]]
;
then
echo
"ERROR: Detected some differences: build is not reproducible!"
echo
" Diff are visible at: /tmp/templates.js.diff"
exit
1
;
fi
;
diff
"
${
PLUGIN_TEMPLATES_FILE
}
"
"
${
PLUGIN_TEMPLATES_FILE
}
.tmp"
>
/tmp/plugin_templates.js.diff
if
[[
$?
-ne
0
]]
;
then
echo
"ERROR: Detected some differences: build is not reproducible!"
echo
" Diff are visible at: /tmp/plugin_templates.js.diff"
exit
1
;
fi
;
echo
"Checking diff between templates files... [OK]"
# ----------------------------------
# Check web extension build
# ----------------------------------
# Compile
echo
"----------------------------"
echo
"Building web extension... [1/2]"
gulp webExtBuild
--release
>
/dev/null
WEB_EXT_DIR
=
"
${
PROJECT_DIR
}
/dist/web/ext"
if
[[
$?
-ne
0
]]
||
[[
!
-d
"
${
WEB_EXT_DIR
}
"
]]
;
then
echo
"ERROR - Build failed: missing folder
${
WEB_EXT_DIR
}
"
exit
1
;
fi
;
# Keep a copy
rm
-rf
"
${
WEB_EXT_DIR
}
.tmp"
mv
"
${
WEB_EXT_DIR
}
"
"
${
WEB_EXT_DIR
}
.tmp"
# Compile web extension, second time
echo
"Building web extension... [2/2]"
gulp webExtBuild
--release
>
/dev/null
[[
$?
-ne
0
]]
&&
exit
1
echo
"Building web extension... [OK]"
echo
"Checking diff between builds..."
diff
-arq
"
${
WEB_EXT_DIR
}
"
"
${
WEB_EXT_DIR
}
.tmp"
>
/tmp/webExtention.diff
if
[[
$?
-ne
0
]]
;
then
cat
/tmp/webExtention.diff
echo
"ERROR: Detected some differences: build is not reproducible!"
exit
1
;
fi
;
echo
"Checking diff between builds... [OK]"
echo
"SUCCESS: Build are reproducible!"
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