-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/AG-26383
- Loading branch information
Showing
5 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
.eslintcache | ||
coverage | ||
node_modules | ||
out | ||
out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ | |
|
||
--- | ||
!include 'increment.yaml' | ||
|
||
--- | ||
!include 'build.yaml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
version: 2 | ||
plan: | ||
project-key: AJL | ||
key: VSCODEADBLOCKSYNTAXBUILD | ||
name: vscode adblock syntax - build release | ||
variables: | ||
dockerNode: adguard/node-ssh:18.13--0 | ||
|
||
stages: | ||
- Build: | ||
manual: false | ||
final: false | ||
jobs: | ||
- Build | ||
|
||
Build: | ||
key: BUILD | ||
other: | ||
clean-working-dir: true | ||
docker: | ||
image: ${bamboo.dockerNode} | ||
volumes: | ||
${system.YARN_DIR}: "${bamboo.cacheYarn}" | ||
tasks: | ||
- checkout: | ||
force-clean-build: true | ||
- script: | ||
interpreter: SHELL | ||
scripts: | ||
- |- | ||
set -x | ||
set -e | ||
ls -al | ||
yarn install ${bamboo.varsYarn} | ||
yarn build-txt | ||
rm -rf node_modules | ||
- inject-variables: | ||
file: dist/build.txt | ||
scope: RESULT | ||
namespace: inject | ||
- any-task: | ||
plugin-key: com.atlassian.bamboo.plugins.vcs:task.vcs.tagging | ||
configuration: | ||
selectedRepository: defaultRepository | ||
tagName: v${bamboo.inject.version} | ||
requirements: | ||
- adg-docker: true | ||
|
||
triggers: [] | ||
|
||
branches: | ||
create: manually | ||
delete: never | ||
link-to-jira: true | ||
|
||
notifications: | ||
- events: | ||
- plan-status-changed | ||
recipients: | ||
- webhook: | ||
name: Build webhook | ||
url: http://prod.jirahub.service.eu.consul/v1/webhook/bamboo | ||
labels: [] | ||
other: | ||
concurrent-build-plugin: system-default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* @file Output the version number to a build.txt file | ||
*/ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
|
||
const UPPER_LEVEL = '../'; | ||
|
||
const OUTPUT_FOLDER_NAME = 'out'; | ||
const OUTPUT_FILE_NAME = 'build.txt'; | ||
const PKG_FILE_NAME = 'package.json'; | ||
|
||
// Computed constants | ||
const outputFolderLocation = path.join(__dirname, UPPER_LEVEL, OUTPUT_FOLDER_NAME); | ||
const pkgFileLocation = path.join(__dirname, UPPER_LEVEL, PKG_FILE_NAME); | ||
|
||
// Read package.json | ||
const pkg = JSON.parse(fs.readFileSync(pkgFileLocation, 'utf-8')); | ||
|
||
if (!pkg.version) { | ||
throw new Error('Missing required field "version" in package.json'); | ||
} | ||
|
||
const main = (): void => { | ||
const content = `version=${pkg.version}`; | ||
|
||
// Create the output folder if it doesn't exist | ||
if (!fs.existsSync(outputFolderLocation)) { | ||
fs.mkdirSync(outputFolderLocation); | ||
} | ||
|
||
// Write the output file | ||
const file = path.resolve(outputFolderLocation, OUTPUT_FILE_NAME); | ||
fs.writeFileSync(file, content); | ||
|
||
// eslint-disable-next-line no-console | ||
console.log(`Wrote ${content} to ${file} was successful`); | ||
}; | ||
|
||
main(); |