mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
[misc] export all git repository revisions
There is a multi purpose shell script for the gathering of git revisions now. It will extract all revisions that can be found in traversing of the current working directory. This effectively includes the overleaf/overleaf repo and any others that may be added downstream.
This commit is contained in:
parent
bb3485016e
commit
df2d46df82
3 changed files with 8 additions and 24 deletions
|
@ -22,7 +22,7 @@ RUN git clone https://github.com/overleaf/overleaf.git \
|
||||||
# Install dependencies needed to run configuration scripts
|
# Install dependencies needed to run configuration scripts
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
ADD ${baseDir}/package.json /var/www/package.json
|
ADD ${baseDir}/package.json /var/www/package.json
|
||||||
ADD ${baseDir}/git-revision.js /var/www/git-revision.js
|
ADD ${baseDir}/git-revision.sh /var/www/git-revision.sh
|
||||||
RUN cd /var/www && npm install
|
RUN cd /var/www && npm install
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ COPY ${baseDir}/init_scripts/ /etc/my_init.d/
|
||||||
|
|
||||||
# Stores the version installed for each service
|
# Stores the version installed for each service
|
||||||
# ---------------------------------------------
|
# ---------------------------------------------
|
||||||
RUN cd /var/www && node git-revision > revisions.txt
|
RUN cd /var/www && ./git-revision.sh > revisions.txt
|
||||||
|
|
||||||
|
|
||||||
# Set Environment Variables
|
# Set Environment Variables
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
var simple = require('simple-git');
|
|
||||||
var services = require('./sharelatex/config/services');
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
function print_latest(repoDir) {
|
|
||||||
git = simple(repoDir);
|
|
||||||
opt = [];
|
|
||||||
opt['max-count'] = 1;
|
|
||||||
git.log(opt, function(err, log) {
|
|
||||||
if (!err) {
|
|
||||||
console.log(repoDir + ',' + log.latest.hash);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
for (id in services) {
|
|
||||||
service = services[id];
|
|
||||||
dirPath = __dirname + '/sharelatex/'+service.name;
|
|
||||||
if (fs.existsSync(dirPath)) {
|
|
||||||
print_latest(dirPath);
|
|
||||||
}
|
|
||||||
}
|
|
6
git-revision.sh
Executable file
6
git-revision.sh
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
for gitDir in $(find "$PWD" -name .git); do
|
||||||
|
echo -n "$(dirname ${gitDir}),"
|
||||||
|
git --git-dir="$gitDir" rev-parse HEAD
|
||||||
|
done
|
Loading…
Reference in a new issue