-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
👷 Pass application version docker build and to the applications #445
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
{ | ||
"version": { | ||
"current": "1.0.1" | ||
}, | ||
"database": { | ||
"secret": "", | ||
"mongodb": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import config from "config"; | ||
|
||
export default { | ||
current: /* @VERSION_DETAIL */ "2023.Q1.1223", | ||
current: config.get<string>("general.version.current") || "1.0.1", | ||
minimal: { | ||
web: /* @MIN_VERSION_WEB */ "2022.Q2.975", | ||
mobile: /* @MIN_VERSION_MOBILE */ "2022.Q2.975", | ||
web: /* @MIN_VERSION_WEB */ "1.0.0", | ||
mobile: /* @MIN_VERSION_MOBILE */ "1.0.0", | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const fs = require('fs'); | ||
|
||
const targetPath = `${__dirname}/../src/app/environment/version.ts`; | ||
const appVersion = process.env.TWAKE_DRIVE_VERSION || '1.0.0'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why have a default ? If setting the version and one isn't provided, fail There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's for the local build, when you don't need a version |
||
|
||
const updatedData = `export default { | ||
version: /* @VERSION */ '${appVersion}', | ||
version_detail: /* @VERSION_DISPLAY_NAME */ '${appVersion}', | ||
version_name: /* @VERSION_NAME */ 'Ghost-Dog', | ||
};`; | ||
fs.writeFile(targetPath, updatedData,(err) => { | ||
if (err) { | ||
console.error(`Error writing file: ${targetPath}`, err); | ||
process.exit(1); | ||
} | ||
console.log(`Version set to: ${appVersion}`); | ||
}); |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
"${GITHUB_REF_NAME}"
for it to work.See https://docs.docker.com/build/bake/reference/#interpolate-variables-into-attributes for more details