Skip to content

Commit 8fbd9c2

Browse files
committed
removing copies of the version number
1 parent 1384091 commit 8fbd9c2

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

Jenkinsfile

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
node_version = "14.18.1"
1717

1818
project_name = "$JOB_NAME"
19-
version_prefix = "0.8.0"
19+
version_prefix = sh(returnStdout: true, script: "cat ${WORKSPACE}/weblogic-toolkit-ui/electron/package.json | grep version | awk 'match($0, /[0-9]+.[0-9]+.[0-9]+/) { print substr( $0, RSTART, RLENGTH )}'")
2020
version_number = VersionNumber([versionNumberString: '-${BUILD_YEAR}${BUILD_MONTH,XX}${BUILD_DAY,XX}${BUILDS_TODAY_Z,XX}', versionPrefix: "${version_prefix}"])
2121

2222
github_url = "${env.GIT_URL}"
@@ -43,7 +43,6 @@
4343
stage('Linux Echo Environment') {
4444
steps {
4545
sh 'env|sort'
46-
sh "git config --global http.https://github.com.proxy ${WKTUI_PROXY}"
4746
}
4847
}
4948
stage('Linux Checkout') {
@@ -142,7 +141,6 @@
142141
stage('MacOS Echo Environment') {
143142
steps {
144143
sh 'env|sort'
145-
sh "git config --global http.https://github.com.proxy ${WKTUI_PROXY}"
146144
}
147145
}
148146
stage('MacOS Checkout') {

WKTUI_VERSION.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.8.0-SNAPSHOT
1+
-SNAPSHOT

electron/app/js/wktApp.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ class WktApp {
7373
if (doesExist) {
7474
fsPromises.readFile(versionFilePath, 'utf8')
7575
.then(contents => {
76-
if (!contents || contents.startsWith('This empty file')) {
77-
resolve(defaultVersion);
76+
if (!contents || contents.startsWith('-')) {
77+
// dev build so concatenate the app version with the qualifier from the file
78+
resolve(`${defaultVersion}${contents.trim()}`);
7879
} else {
7980
resolve(contents.trim());
8081
}

electron/app/test/wktApp-test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ describe('WKT App tests', () => {
4949
const WktMode = proxyquire('../js/wktMode', { electron: electronStub });
5050

5151
function getDefaultVersionNumber() {
52+
const packageJsonFileName = path.normalize(path.join(__dirname, '..', '..', 'package.json'));
53+
const packageJson = require(packageJsonFileName);
5254
const wktuiVersionFileName = path.normalize(path.join(__dirname, '..', '..', '..', 'WKTUI_VERSION.txt'));
53-
const version = readFileSync(wktuiVersionFileName, { encoding: 'utf8'});
54-
return version.trim();
55+
const qualifier = readFileSync(wktuiVersionFileName, { encoding: 'utf8'});
56+
return `${packageJson.version}${qualifier.trim()}`;
5557
}
5658

5759
it('make sure application name works', () => {

0 commit comments

Comments
 (0)