Skip to content

Commit

Permalink
Merge pull request #45 from bcgov-nr/fix/emptyCatalogueFile
Browse files Browse the repository at this point in the history
fix: empty catalogue file
  • Loading branch information
andrwils authored May 1, 2024
2 parents b465333 + cbc0207 commit 8d8394e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions generators/backstage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Generator from 'yeoman-generator';
import yosay from 'yosay';
import { parseDocument } from 'yaml';
import {
Document,
BACKSTAGE_FILENAME,
pathToProps,
extractFromYaml,
Expand All @@ -20,6 +21,8 @@ export default class extends Generator {
if (fs.existsSync(backstagePath)) {
const backstageYaml = fs.readFileSync(backstagePath, 'utf8');
this.backstageDoc = parseDocument(backstageYaml);
} else {
this.backstageDoc = new Document();
}
}

Expand Down
5 changes: 3 additions & 2 deletions generators/gh-maven-build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as fs from 'fs';
import Generator from 'yeoman-generator';
import yosay from 'yosay';
import chalk from 'chalk';
import { parseDocument } from 'yaml';
import { Document, parseDocument } from 'yaml';
import {
BACKSTAGE_FILENAME,
pathToProps,
Expand All @@ -21,12 +21,13 @@ export default class extends Generator {
if (fs.existsSync(backstagePath)) {
const backstageYaml = fs.readFileSync(backstagePath, 'utf8');
this.backstageDoc = parseDocument(backstageYaml);
} else {
this.backstageDoc = new Document();
}
}

async prompting() {
this.answers = extractFromYaml(this.backstageDoc, pathToProps);
console.log(this.answers);

this.log(
yosay(
Expand Down
2 changes: 1 addition & 1 deletion generators/gh-maven-build/templates/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ jobs:
ARTIFACT_ID: ${{ steps.set-build-output-parameters.outputs.artifact_id }}
- name: Send build info
run: |
curl -s POST ${{ env.BROKER_URL }}/v1/intention/action/patch \
curl -s -X POST ${{ env.BROKER_URL }}/v1/intention/action/patch \
-H 'Content-Type: application/json' \
-H 'X-Broker-Token: '"${BUILD_TOKEN}"'' \
-d '{"package":{"checksum": "sha256:'${ARTIFACT_SHA256}'"}}'
Expand Down

0 comments on commit 8d8394e

Please sign in to comment.