Skip to content

Commit

Permalink
Merge pull request #77 from pm4ml/fix-gh-action
Browse files Browse the repository at this point in the history
feat: proposed fix for gh action
  • Loading branch information
geka-evk authored Feb 22, 2024
2 parents 8459bd7 + 1457dc6 commit 9490d3d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 56 deletions.
62 changes: 9 additions & 53 deletions .github/workflows/releaseWorkflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Create Tagged Release

on:
release:
types: [ published ]
types: [published]
push:
branches:
- main
Expand All @@ -24,71 +24,27 @@ jobs:
test_license:
uses: modusbox/github-actions-node/.github/workflows/[email protected]

# TODO: Enable when there are unit tests
# test_unit:
# uses: modusbox/github-actions-node/.github/workflows/[email protected]
# TODO: Enable when there are unit tests
# test_unit:
# uses: modusbox/github-actions-node/.github/workflows/[email protected]

# TODO: Enable when there is coveragte for unit tests
# test_coverage:
# uses: modusbox/github-actions-node/.github/workflows/[email protected]
# TODO: Enable when there is coveragte for unit tests
# test_coverage:
# uses: modusbox/github-actions-node/.github/workflows/[email protected]

test_int:
uses: modusbox/github-actions-node/.github/workflows/[email protected]

test_func:
uses: ./.github/workflows/testFuncJob.yml

release_tag:
needs:
- test_lint
- test_dependencies
- test_audit
- test_license
# - test_unit
# - test_coverage
- test_int
- test_func
uses: modusbox/github-actions-node/.github/workflows/[email protected]
secrets:
GIT_KEY: ${{ secrets.PSO_GIT_KEY }}
GIT_USER: ${{ secrets.PSO_GIT_USER }}
GIT_EMAIL: ${{ secrets.PSO_GIT_EMAIL }}

release_gh:
needs:
- release_tag
uses: modusbox/github-actions-node/.github/workflows/[email protected]
with:
RELEASE_VERSION: v${{ needs.release_tag.outputs.VERSION }}
RELEASE_CHANGE_ARTEFACT: ${{ needs.release_tag.outputs.RELEASE_CHANGE_ARTEFACT }}
RELEASE_CHANGE_FILENAME: ${{ needs.release_tag.outputs.RELEASE_CHANGE_FILENAME }}
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish_image:
needs:
- release_tag
- release_gh
uses: modusbox/github-actions-node/.github/workflows/[email protected]
with:
RELEASE_VERSION: v${{ needs.release_tag.outputs.VERSION }}
RELEASE_URL: ${{ github.server_url }}/${{ github.repository }}/releases/tag/v${{ needs.release_tag.outputs.VERSION }}
RELEASE_VERSION: ${{ github.event.release.tag_name }}
RELEASE_URL: ${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.event.release.tag_name }}
secrets:
USER: ${{ github.actor }}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}

notify:
needs:
- release_tag
- release_gh
- publish_image
if: ${{ always() }} # Here we report on the final state of the workflow!
uses: modusbox/github-actions-node/.github/workflows/[email protected]
with:
JOB_STATUS: ${{ ((needs.release_tag.result == 'success') && (needs.release_gh.result == 'success') && (needs.publish_image.result == 'success')) && 'success' || 'failed' }}
TYPE: Release
RELEASE_VERSION: ${{ ((needs.release_tag.result == 'success') && (needs.release_gh.result == 'success') && (needs.publish_image.result == 'success')) && format('v{0}', needs.release_tag.outputs.VERSION) || 'n/a' }}
RELEASE_URL: ${{ ((needs.release_tag.result == 'success') && (needs.release_gh.result == 'success') && (needs.publish_image.result == 'success')) && format('{0} {1}/{2}/releases/tag/v{3}', ':shipit:', github.server_url, github.repository, needs.release_tag.outputs.VERSION) || ':fire:' }}
secrets:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_CHANEL: ${{ secrets.SLACK_CHANNEL_PSO_RELEASE }}
3 changes: 2 additions & 1 deletion src/pki_engine/VaultPKIEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class VaultPKIEngine extends PKIEngine {
}
// endregion

async populateDFSPClientCertBundle (dfspId, dfspName) {
async populateDFSPClientCertBundle (dfspId, dfspName, dfspMonetaryZoneId) {
this.validateId(dfspId, 'dfspId');
const dfspCA = await this.getDFSPCA(dfspId);
const enrollments = await this.getDFSPOutboundEnrollments(dfspId);
Expand All @@ -308,6 +308,7 @@ class VaultPKIEngine extends PKIEngine {
client_cert_chain: `${dfspClientCert.certificate}\n${dfspCA.intermediateChain}\n${dfspCA.rootCertificate}`,
fqdn: cert.subject.CN,
host: dfspName,
currency_code: dfspMonetaryZoneId,
};
await this.client.write(`${this.mounts.dfspClientCertBundle}/${dfspName}`, bundle);
}
Expand Down
4 changes: 2 additions & 2 deletions src/service/DfspOnboardService.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const getIPsBundle = async () => {
exports.onboardDFSP = async (ctx, dfspId) => {
await PkiService.validateDfsp(ctx, dfspId);
const { pkiEngine } = ctx;
const id = await DFSPModel.findIdByDfspId(dfspId);
await pkiEngine.populateDFSPClientCertBundle(id, dfspId);
const { id, monetaryZoneId } = await DFSPModel.findByDfspId(dfspId);
await pkiEngine.populateDFSPClientCertBundle(id, dfspId, monetaryZoneId);

const ipsBundle = await getIPsBundle();
await pkiEngine.populateDFSPInternalIPWhitelistBundle(ipsBundle);
Expand Down

0 comments on commit 9490d3d

Please sign in to comment.