Skip to content

Commit

Permalink
Merge pull request #49 from fitbeard/feat/issue_45
Browse files Browse the repository at this point in the history
feat: extract job id
  • Loading branch information
fitbeard authored Apr 18, 2024
2 parents 063339a + f73a03a commit 4bec74c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test.sh
2 changes: 1 addition & 1 deletion Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ RUN pip install --no-cache-dir -r /requirements.txt

RUN apk update \
&& apk upgrade \
&& apk add bash \
&& apk add bash jq \
&& rm -rf /var/cache/*/*
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@ See [action.yml](action.yml)
awx-examples:
runs-on: ubuntu-latest
steps:
- name: "Test AWX: Simple job template"
- name: "Test AWX: Simple job template with GH step id to extract AWX job id for the next step"
uses: fitbeard/[email protected]
id: example_id
with:
controller_host: ${{ secrets.CONTROLLER_HOST }}
controller_oauth_token: ${{ secrets.CONTROLLER_OAUTH_TOKEN }}
resource_type: job_template
resource_name: actions-awxkit-test

- name: "Output AWX job id"
run: |
echo ${{ steps.example_id.outputs.job_id }}
- name: "Test AWX: Simple job template - specify credentials"
uses: fitbeard/[email protected]
with:
Expand Down
5 changes: 3 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,6 @@ else
exit 1
fi

echo "awx ${ACTION} ${RESOURCE_NAME} -f human ${MONITOR_VALUE} ${TIMEOUT_VALUE} ${LIMIT_VALUE} ${INVENTORY_VALUE} ${CREDENTIALS_VALUE} ${EXTRA_VARS_VALUE} ${BRANCH_VALUE} ${JOB_TYPE_VALUE} ${TAGS_VALUE} ${SKIP_TAGS_VALUE}"
echo "awx ${ACTION} ${RESOURCE_NAME} -f human ${MONITOR_VALUE} ${TIMEOUT_VALUE} ${LIMIT_VALUE} ${INVENTORY_VALUE} ${CREDENTIALS_VALUE} ${EXTRA_VARS_VALUE} ${BRANCH_VALUE} ${JOB_TYPE_VALUE} ${TAGS_VALUE} ${SKIP_TAGS_VALUE}" | bash
echo "awx ${ACTION} ${RESOURCE_NAME} -f jq --filter .id ${MONITOR_VALUE} ${TIMEOUT_VALUE} ${LIMIT_VALUE} ${INVENTORY_VALUE} ${CREDENTIALS_VALUE} ${EXTRA_VARS_VALUE} ${BRANCH_VALUE} ${JOB_TYPE_VALUE} ${TAGS_VALUE} ${SKIP_TAGS_VALUE}"
echo "awx ${ACTION} ${RESOURCE_NAME} -f jq --filter .id ${MONITOR_VALUE} ${TIMEOUT_VALUE} ${LIMIT_VALUE} ${INVENTORY_VALUE} ${CREDENTIALS_VALUE} ${EXTRA_VARS_VALUE} ${BRANCH_VALUE} ${JOB_TYPE_VALUE} ${TAGS_VALUE} ${SKIP_TAGS_VALUE}" | bash | tee awxkit-output.log
echo job_id="$(sed -e 's/[[:space:]]*$//' awxkit-output.log | awk 'NF' | tail -n 1)" >> $GITHUB_OUTPUT
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
awxkit==24.2.0
jq

0 comments on commit 4bec74c

Please sign in to comment.