mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 10:33:59 -05:00
Place a git_hash within the archive, and use it in place of git rev-parse
This commit is contained in:
1
Makefile
1
Makefile
@@ -89,6 +89,7 @@ dist: prereqs
|
||||
rm -rf out/dist
|
||||
$(NODE) ./node_modules/requirejs/bin/r.js -o app.build.js
|
||||
# Move all assets to a versioned directory
|
||||
echo $(HASH) > out/dist/git_hash
|
||||
mkdir -p out/dist/v/$(HASH)
|
||||
mv out/dist/main.js* out/dist/v/$(HASH)/
|
||||
mv out/dist/explorer.css out/dist/v/$(HASH)/
|
||||
|
||||
12
app.js
12
app.js
@@ -79,12 +79,18 @@ var hostname = opts.host;
|
||||
var port = opts.port || 10240;
|
||||
var staticDir = opts.static || 'static';
|
||||
var archivedVersions = opts.archivedVersions;
|
||||
var gitReleaseName = child_process.execSync('git rev-parse HEAD').toString().trim();
|
||||
var gitReleaseName = "";
|
||||
var versionedRootPrefix = "";
|
||||
// Don't treat @ in paths as remote adresses
|
||||
var fetchCompilersFromRemote = !opts.noRemoteFetch;
|
||||
// Use the canned git_hash if provided
|
||||
if (opts.static && fs.existsSync(opts.static + "/git_hash")) {
|
||||
gitReleaseName = fs.readFileSync(opts.static + "/git_hash").toString().trim();
|
||||
} else {
|
||||
gitReleaseName = child_process.execSync('git rev-parse HEAD').toString().trim();
|
||||
}
|
||||
if (opts.static && fs.existsSync(opts.static + '/v/' + gitReleaseName))
|
||||
versionedRootPrefix = "v/" + gitReleaseName + "/";
|
||||
// Don't treat @ in paths as remote adresses
|
||||
var fetchCompilersFromRemote = !opts.noRemoteFetch;
|
||||
|
||||
var propHierarchy = _.flatten([
|
||||
'defaults',
|
||||
|
||||
Reference in New Issue
Block a user