Skip to content
Draft
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
10 changes: 10 additions & 0 deletions .bacon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Metadata for all Bacon test suites. For options, see:
# https://oktawiki.atlassian.net/wiki/spaces/ESS/pages/635280223/.Bacon.yaml
test_suites:
- name: 'netlify_preview'
script_path: /root/okta/okta-developer-docs/scripts
script_name: test-new-token
sort_order: '0'
timeout: '50'
criteria: OPTIONAL
queue_name: small
61 changes: 40 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ jobs:
skip-unresolved: false
run-on-non-main: true

test-new-token:
docker:
- image: cimg/base:current
resource_class: small
steps:
- checkout
- eng-services/get-ocm-windows:
ocm-version: v12.30.1
- run: bash ./scripts/test-new-token.sh

inclusive-linting:
docker:
- image: cimg/base:current
Expand Down Expand Up @@ -193,33 +203,42 @@ jobs:


workflows:
linting:
test-new-token:
when:
and:
- not: << pipeline.parameters.preview >>
- not: << pipeline.parameters.preview_with_redirect >>
jobs:
- inclusive-linting:
name: "Inclusive Linting"
- test-new-token:
name: "test-new-token"

build_checks:
when:
and:
- not: << pipeline.parameters.preview >>
- not: << pipeline.parameters.preview_with_redirect >>
jobs:
- node_build_checks:
name: "Build and Checks"
- snyk-scan:
context:
- static-analysis
name: execute-snyk
requires:
- Build and Checks
filters:
branches:
only:
- master
# linting:
# when:
# and:
# - not: << pipeline.parameters.preview >>
# - not: << pipeline.parameters.preview_with_redirect >>
# jobs:
# - inclusive-linting:
# name: "Inclusive Linting"

# build_checks:
# when:
# and:
# - not: << pipeline.parameters.preview >>
# - not: << pipeline.parameters.preview_with_redirect >>
# jobs:
# - node_build_checks:
# name: "Build and Checks"
# - snyk-scan:
# context:
# - static-analysis
# name: execute-snyk
# requires:
# - Build and Checks
# filters:
# branches:
# only:
# - master

nightly:
triggers:
Expand Down
41 changes: 41 additions & 0 deletions scripts/test-new-token.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

export AURM_BASE_URL="https://api.aurm.prod.aue1k.saasure.net"
export ES_APP_NAME="info-dev-bot-okta"
export ACCESS_KEY=""
export SECRET_KEY=""

get_vault_secret_key repo_gh-atko-eng-info-dev/default ACCESS_KEY ACCESS_KEY
get_vault_secret_key repo_gh-atko-eng-info-dev/default SECRET_KEY SECRET_KEY

set -x

export AURM_SECRET_KEY=$SECRET_KEY
export AURM_ACCESS_KEY=$ACCESS_KEY

export AURM_TOKEN=$(generate_aurm_token "$AURM_ACCESS_KEY" "$AURM_SECRET_KEY")

export GH_TOKEN_RESPONSE=$(curl --ssl-no-revoke --location 'https://aurm-prod.aue1e.saasure.net/services/github/resources/'${ES_APP_NAME}'/credential-source/vend' \
--header 'x-aurm-token: '${AURM_TOKEN}'' \
--header 'Content-Type: application/json' \
--data '{
"input": {
"org": "okta"
}
}')

export GITHUB_TOKEN=$(echo $GH_TOKEN_RESPONSE | jq -r '.result.token')

echo "Obtained GitHub token from AURM ${GITHUB_TOKEN}"

setup_github_token

# export OUTPUT_REPO=output_repo
# export GIT_REPO=https://oauth2:${GITHUB_TOKEN}@github.com/atko-eng/okta-help.git

# ocm config list
# which git

# git config --global credential.credentialStore dpapi

# git clone --depth 1 ${GIT_REPO} ${OUTPUT_REPO}