Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable AAP plugin #2054

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .ibm/pipelines/env_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,6 @@ KEYCLOAK_AUTH_CLIENT_SECRET=$(cat /tmp/secrets/KEYCLOAK_AUTH_CLIENT_SECRET)
KEYCLOAK_AUTH_LOGIN_REALM=$(cat /tmp/secrets/KEYCLOAK_AUTH_LOGIN_REALM)
KEYCLOAK_AUTH_REALM=$(cat /tmp/secrets/KEYCLOAK_AUTH_REALM)

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

set +a # Stop automatically exporting variables
62 changes: 62 additions & 0 deletions .ibm/pipelines/get_aap_files.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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 }}"

- name: Setup Ansible Backstage Plugins
hosts: localhost
vars:
ansible_backstage_plugins_local_dir: "~/plugins"
ansible_backstage_bundle: "/tmp//tmp/ansible-automation-platform-setup-bundle.tar.gz"

tasks:
- name: Create Plugins Directory
file:
path: "{{ ansible_backstage_plugins_local_dir }}"
state: directory
mode: '0755'

- name: Set Dynamic Plugin Root Directory
set_fact:
dynamic_plugin_root_dir: "{{ ansible_backstage_plugins_local_dir }}"

- name: Extract Ansible Backstage Bundle
unarchive:
src: "{{ ansible_backstage_bundle }}"
dest: "{{ dynamic_plugin_root_dir }}"
excludes: "*code*"
remote_src: yes
1 change: 1 addition & 0 deletions .ibm/pipelines/openshift-ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ for SCRIPT in "${SCRIPTS[@]}"; do
done

main() {

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
5 changes: 5 additions & 0 deletions e2e-tests/playwright/e2e/plugins/aap.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import test, { expect } from "@playwright/test";

test.only("pass", () => {
expect(true);
});
Loading