Skip to content

Commit

Permalink
+ download aap
Browse files Browse the repository at this point in the history
  • Loading branch information
nilgaar committed Dec 9, 2024
1 parent df6bb71 commit 973d073
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .ibm/pipelines/env_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,6 @@ AUTH_PROVIDERS_NAMESPACE="showcase-auth-providers"
STATIC_API_TOKEN="somecicdtoken"
AUTH_PROVIDERS_CHART="rhdh-chart/backstage"

RH_OFFLINE_TOKEN=$(cat /tmp/secrets/RH_OFFLINE_TOKEN)

set +a # Stop automatically exporting variables
38 changes: 38 additions & 0 deletions .ibm/pipelines/get_aap_files.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.4/html-single/installing_ansible_plug-ins_for_red_hat_developer_hub/index#rhdh-download-plugins_rhdh-install-ocp
---
- name: Headlessly Download AAP from Red Hat Customer Portal
hosts: localhost
vars:
offline_token: "{{ lookup('file', '/tmp/secrets/RH_OFFLINE_TOKEN') }}"
file_url: "https://access.cdn.redhat.com/content/origin/files/sha256/cf/cf2a2d4e6b6819676a563daae36eff34195af67caf111f1fc89b487daf165520/ansible-automation-platform-setup-bundle-2.4-8-x86_64.tar.gz"
download_path: "/tmp/ansible-automation-platform-setup-bundle.tar.gz"

tasks:
- name: Generate Access Token from Offline Token
no_log: true
uri:
url: "https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token"
method: POST
headers:
Content-Type: "application/x-www-form-urlencoded"
body:
grant_type: "refresh_token"
client_id: "rhsm-api"
refresh_token: "{{ offline_token }}"
body_format: form-urlencoded
return_content: yes
register: access_token_response

- name: Extract Access Token
no_log: true
set_fact:
access_token: "{{ access_token_response.json.access_token }}"

- name: Download File
no_log: true
uri:
url: "{{ file_url }}"
method: GET
headers:
Authorization: "Bearer {{ access_token }}"
dest: "{{ download_path }}"
2 changes: 2 additions & 0 deletions .ibm/pipelines/openshift-ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ source "${DIR}/jobs/periodic.sh"
echo "Loaded periodic.sh"

main() {
ansible-playbook get_aap_files.yaml

echo "Log file: ${LOGFILE}"
echo "JOB_NAME : $JOB_NAME"

Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineConfig({
timeout: 90 * 1000,
testDir: "./playwright",
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
forbidOnly: false,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
Expand Down

0 comments on commit 973d073

Please sign in to comment.