Merge branch 'main' into chore-poll-targets

This commit is contained in:
Susmitha Girumala authored and GitHub committed 2021-03-05 10:33:04 -05:00
commit 3cc70256de
3 files changed
+13 -11

No files matched your search

+4 -7
View File
@@ -9,14 +9,11 @@ jobs:
trigger-circleci-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- uses: actions/checkout@v2
- name: Trigger Release job
env:
TAG: ${{ github.event.release.tag_name }}
TEST_REF: ${{ github.ref }}
run: |
echo "($TAG), ($TEST_REF)"
echo "Triggering release with a TAG ${GITHUB_REF#refs/tags/}"
curl -u ${{ secrets.CIRCLE_TOKEN }}: -X POST --header "Content-Type: application/json" \
-d '{ "branch": "main", "parameters": {"TAG": "'${TAG}'" }}' \
-d '{ "branch": "main", "parameters": {"TAG": "'${GITHUB_REF#refs/tags/}'" }}' \
https://circleci.com/api/v2/project/github/hashicorp/boundary-ui-releases/pipeline
+5 -2
View File
@@ -18,8 +18,10 @@ const escapeAndValidateBase62 = (str) => {
};
module.exports = {
// Check boundary cli existence
exists: () => Boolean(cliPath()),
// Initiate connection and return output
connect: (target_id, token, host_id) => {
const addr = origin.origin;
@@ -33,13 +35,13 @@ module.exports = {
`-target-id=${sanitized.target_id}`,
`-token=${sanitized.token}`,
`-addr=${addr}`,
'-format=json',
'--output-json-errors'
'-format=json'
];
if (host_id) command.push(`-host-id=${sanitized.host_id}`)
return spawnAsyncJSONPromise(command);
},
// Returns JSON-formatted version information from the CLI
version: () => {
const command = [ '-v' ];
@@ -54,4 +56,5 @@ module.exports = {
return { gitRevision, versionNumber, formatted };
return rawOutput;
}
}
+4 -2
View File
@@ -52,8 +52,10 @@ module.exports = {
childProcess.stderr.on('data', (data) => {
errorStream += data.toString();
const jsonData = jsonify(errorStream);
const error = jsonData ? jsonData.error : undefined;
if (jsonData) reject(new Error(error));
if (jsonData) {
const error = jsonData.api_error || jsonData.error;
reject(new Error(error));
}
});
});
},