diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index de35093..09149dd 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -127,7 +127,7 @@ jobs: echo $TERRAFORM_ENV_BASE64 | base64 -d > tfvars source tfvars _tfdir=terraform - _branch=$(echo "${GITHUB_REF}" | sed -e "s#refs/heads/##g") + _branch="${GITHUB_BASE_REF}" export TF_VAR_pingone_environment_name=${_branch} case $_branch in prod) @@ -139,7 +139,7 @@ jobs: export TF_VAR_pingone_target_environment_id="${PINGONE_TARGET_ENVIRONMENT_ID_QA}" ;; *) - echo "Local feature branch detected, skipping deployment" + echo "Local feature branch detected, skipping OPA policy check" exit 0 ;; esac diff --git a/README.md b/README.md index 396cc85..e6e2ae1 100644 --- a/README.md +++ b/README.md @@ -127,9 +127,30 @@ gh secret set --app actions TERRAFORM_ENV_BASE64 --body $_secrets unset _secrets ``` +### Deploy Prod and QA + +The final step before working on features is to deploy the sample Davinci flow to the `prod` and `qa` environments. + +Under the **Actions** tab in Github, locate the failed **Initial commit** workflow that failed when the repository was created. Click "Re-run jobs" and choose "Re-run all jobs". If your secrets are configured correctly, this action should result in the successful deployment of the sample Davinci workflow to the "prod" environment in your PingOne account. + +![re-run all jobs](./img/rerunalljobs.png "Re-run All Jobs") + +![prod deployed](./img/proddeployed.png "Prod Deployed") + +To deploy the flow to the `qa` environment, create and push a new branch from prod with the name `qa`: + +```bash +git checkout prod +git pull origin prod +git checkout -b qa +git push origin qa +``` + +![QA deployed](./img/qadeployed.png "QA Deployed") + ## Development Example Overview -To experience the developer's perspective, a walkthrough follows. The demonstration will simulate the use case of modifying a Davinci flow and promoting the change. To simplify the demonstration, a starting pre-configured flow will be created using Terraform. The UI components will be built into a Docker image and launched on your local machine. After you have deployed the flow, you will be able to make the changes necessary in the PingOne UI, export the configuration, and promote the change to the QA and Prod environments. +To experience the developer's perspective, a walkthrough follows. The demonstration will simulate the use case of modifying a Davinci flow and promoting the change. To simplify the demonstration, a starting pre-configured flow is included that will be deployed using Terraform. The UI components will be built into a Docker image and launched on your local machine. After you have deployed the flow, you will be able to make the changes necessary in the PingOne UI, export the configuration, and promote the change to the QA and Prod environments. ## Feature Development @@ -168,17 +189,16 @@ source localsecrets 5. Confirm the deployment by examining the Davinci flow in the PingOne console in the development environment matching the ID you provided. Click on the Davinci link from the PingOne console to open the DaVinci console and select **Flows** from the left navigation panel. Click on the **PingOne DaVinci Registration Example** flow to view the configuration. -6. The Terraform configuration also deployed a sample client application in a local docker container that can be used to try out the flow by navigating to [https://127.0.0.1:8443](https://127.0.0.1:8443). You will be presented a simple progressive profiling style form to enter an email address. If the email address is not found, you will be prompted to register the user. +6. The Terraform configuration also deployed a sample client application in a local container that can be used to try out the flow by navigating to [https://127.0.0.1:8443](https://127.0.0.1:8443). You will be presented a simple progressive profiling style form to enter an email address. If the email address is not found, you will be prompted to register the user. > [!NOTE] > For demo purposes, there is a self-signed certificate in the Docker image that will require you to accept the security warning in your browser to proceed. - -7. On the next panel, you are told to provide the email and password. There are password rules in place, but you are not informed when prompted. Try using a simple password such as `password`. The form does not indicate there is a problem, but refuses to accept the password and continue. The password must be at least 8 characters long and contain at least one uppercase letter, one lowercase letter, one number, and one special character. +7. On the next panel, you are told to provide the email and password. There are password rules in place, but you are not informed. Try using a simple password such as `password`. The form does not indicate there is a problem, but refuses to accept the password and continue. The password must be at least 8 characters long and contain at least one uppercase letter, one lowercase letter, one number, and one special character. 8. Create a valid password. After registering the user, you will be redirected to login. -9. To improve the flow, you will add a small prompt on the registration page to indicate that the password must meet the requirements. To do so, select the **Registration Window** node in the Davinci flow editor. Replace the text in the HTML Template editor with the following code block. The only change from what is provided is the addition of the password requirements notification and some descriptive comments. +9. To improve the flow, you will add a prompt on the registration page to indicate the password requirements. To do so, select the **Registration Window** node in the Davinci flow editor. Replace the text in the HTML Template editor with the following code block. The only change from what is provided is the addition of the password requirements notification and some descriptive comments. ```html