forked from foundryvtt/pf2e
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add proper gitlab CI support back in. CI will auto-increment build nu…
…mbers and determine the branch name that goes in the manifest file
- Loading branch information
1 parent
a037d44
commit 0d7cf4d
Showing
3 changed files
with
56 additions
and
15 deletions.
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 |
---|---|---|
@@ -1,21 +1,32 @@ | ||
image: node:latest | ||
|
||
stages: | ||
- build | ||
- test | ||
- build | ||
- test | ||
|
||
cache: | ||
paths: | ||
- node_modules/ | ||
before_script: | ||
- apt-get update | ||
- apt-get install zip | ||
|
||
install_dependencies: | ||
stage: build | ||
script: | ||
- npm install | ||
artifacts: | ||
cache: | ||
paths: | ||
- node_modules/ | ||
- node_modules/ | ||
|
||
build: | ||
stage: build | ||
script: | ||
- export | ||
- npm ci | ||
- node updatebuildno.js --buildno=$CI_PIPELINE_IID --branch=$CI_COMMIT_BRANCH --gitlabpath=$CI_PROJECT_PATH | ||
- npm run build | ||
- mv dist pf2e | ||
- zip pf2e.zip -r pf2e | ||
artifacts: | ||
paths: | ||
- pf2e.zip | ||
- system.json | ||
|
||
|
||
testing_testing: | ||
stage: test | ||
script: npm test | ||
stage: test | ||
script: npm test |
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,30 @@ | ||
const yargs = require('yargs'); | ||
const fs = require('fs'); | ||
|
||
const argv = yargs | ||
.option('buildno', { | ||
type: 'number', | ||
description: 'specifies the build number to be updated (CI_PIPELINE_IID)' | ||
}) | ||
.option('branch', { | ||
'type': 'string', | ||
description: 'specifies the branch (CI_COMMIT_BRANCH)' | ||
}) | ||
.option('gitlabpath', { | ||
type: 'string', | ||
description: 'The path on gitlab where this branch is stored (CI_PROJECT_PATH)' | ||
}) | ||
.demandOption(['branch', 'buildno']) | ||
.argv; | ||
|
||
const systemRaw = fs.readFileSync('system.json'); | ||
let system = JSON.parse(systemRaw); | ||
|
||
system.version = `${system.version}.${argv.buildno}`; | ||
system.url = `https://gitlab.com/${argv.gitlabpath}`; | ||
system.manifest = `https://gitlab.com/${argv.gitlabpath}/-/jobs/artifacts/${argv.branch}/raw/system.json?job=build`; | ||
system.download = `https://gitlab.com/${argv.gitlabpath}/-/jobs/artifacts/${argv.branch}/raw/pf2e.zip?job=build`; | ||
|
||
fs.writeFileSync('system.json', JSON.stringify(system, null, 2)); | ||
|
||
console.log(system.manifest); |