Commit 4b7fa0be authored by chickahoona's avatar chickahoona

added automatic update of version number

parent eaea47dd
......@@ -35,7 +35,6 @@ docker-image:
- sh ./var/build-ubuntu.sh
- set -x && curl -fSL "https://get.docker.com/builds/Linux/x86_64/docker-1.12.0.tgz" -o docker.tgz && echo "3dd07f65ea4a7b4c8829f311ab0213bca9ac551b5b24706f3e79a97e22097f8b *docker.tgz" | sha256sum -c - && tar -xzvf docker.tgz && mv docker/* /usr/local/bin/
- docker info
- gulp
- docker login -u gitlab-ci-token -p "$CI_BUILD_TOKEN" registry.gitlab.com
- docker build -t $CONTAINER_TEST_IMAGE .
- docker push $CONTAINER_TEST_IMAGE
......
......@@ -279,16 +279,41 @@ gulp.task('dist', ['default', 'crx', 'xpi']);
gulp.task('updateversion', function() {
var fileContent = fs.readFileSync("./src/common/data/VERSION.txt", "utf8");
var commit_tag = gutil.env.commit_tag;
var commit_hash = gutil.env.commit_hash;
if (! /^v\d*\.\d*\.\d*$/.test(commit_tag)) {
return;
}
var version = commit_tag.substring(1);
var hash = commit_hash.substring(0,8);
var version_long = version+ ' (Build '+hash+')';
fs.writeFile("./build/webserver/data/VERSION.txt", version_long, function(err) {
if(err) {
return console.log(err);
}
});
var all_browsers = ['chrome', 'firefox'];
all_browsers.forEach(function(browser) {
fs.writeFile("./build/" + browser + "/data/VERSION.txt", version_long, function(err) {
if(err) {
return console.log(err);
}
});
gulp.src(path.join("./build", browser, "manifest.json"))
.pipe(removeFiles());
gulp.src(path.join("./src", browser, "manifest.json"))
.pipe(jeditor({
'version': fileContent.trim()
'version': version
}))
.pipe(gulp.dest(path.join("./build/", browser)));
});
......
......@@ -3,7 +3,7 @@
"name": "psono.PW",
"description": "Psono Password Manager",
"version": "1.0.10",
"version": "VERSION",
"browser_action": {
"default_icon": "data/img/icon-32.png",
......
1.0.10
\ No newline at end of file
VERSION
\ No newline at end of file
......@@ -3,7 +3,7 @@
"name": "psono.PW",
"description": "Psono Password Manager",
"version": "1.0.10",
"version": "VERSION",
"browser_action": {
"default_icon": "data/img/icon-32.png",
......
......@@ -9,4 +9,5 @@ npm install karma-cli -g && \
npm install jpm --global && \
node --version && \
npm --version && \
gulp
\ No newline at end of file
gulp && \
gulp --commit_tag=$CI_COMMIT_TAG --commit_hash=$CI_COMMIT_HASH updateversion
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment