Skip to content

Commit

Permalink
init ocp test
Browse files Browse the repository at this point in the history
  • Loading branch information
leiicamundi committed May 14, 2024
1 parent 20966e7 commit c384b23
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/actions/rosa-create-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ runs:
export TFSTATE_BUCKET="${{ inputs.s3-backend-bucket }}"
export TFSTATE_REGION="${{ inputs.aws-region }}"
export TFSTATE_KEY="tfstate-${{ inputs.cluster-name }}/${{ inputs.cluster-name }}.tfstate"
echo "TFSTATE_BUCKET=${TFSTATE_BUCKET}" >> "$GITHUB_OUTPUT"
echo "TFSTATE_REGION=${TFSTATE_REGION}" >> "$GITHUB_OUTPUT"
echo "TFSTATE_KEY=${TFSTATE_KEY}" >> "$GITHUB_OUTPUT"
terraform_state_url="s3://${TFSTATE_BUCKET}/${TFSTATE_KEY}"
echo "terraform-state-url=${terraform_state_url}" >> "$GITHUB_OUTPUT"
Expand All @@ -137,22 +141,23 @@ runs:
id: init
run: |
cd .github/actions/rosa-create-cluster/modules/rosa-hcp
terraform init -backend-config="bucket=${{ steps.set-terraform-variables.outputs.TFSTATE_BUCKET }}" -backend-config="key=${{ steps.set-terraform-variables.outputs.TFSTATE_KEY }}" -backend-config="region=${{ steps.set-terraform-variables.outputs.TFSTATE_REGION }}"
terraform validate -backend-config="bucket=${{ steps.set-terraform-variables.outputs.TFSTATE_BUCKET }}" -backend-config="key=${{ steps.set-terraform-variables.outputs.TFSTATE_KEY }}" -backend-config="region=${{ steps.set-terraform-variables.outputs.TFSTATE_REGION }}" -no-color
terraform validate -no-color
- name: Terraform Plan
shell: bash
id: plan
run: |
cd .github/actions/rosa-create-cluster/modules/rosa-hcp
terraform plan -no-color -backend-config="bucket=${{ steps.set-terraform-variables.outputs.TFSTATE_BUCKET }}" -backend-config="key=${{ steps.set-terraform-variables.outputs.TFSTATE_KEY }}" -backend-config="region=${{ steps.set-terraform-variables.outputs.TFSTATE_REGION }}" -out rosa.plan -var "cluster_name=${{ inputs.cluster-name }}" -var "replicas=${{ inputs.replicas }}" -var "htpasswd_password=${{ inputs.admin-password }}" -var "htpasswd_username=${{ inputs.admin-username }}" -var "offline_access_token=${{ inputs.rh-token }}" -var "openshift_version=${{ inputs.openshift-version }}"
terraform plan -no-color -out rosa.plan -var "cluster_name=${{ inputs.cluster-name }}" -var "replicas=${{ inputs.replicas }}" -var "htpasswd_password=${{ inputs.admin-password }}" -var "htpasswd_username=${{ inputs.admin-username }}" -var "offline_access_token=${{ inputs.rh-token }}" -var "openshift_version=${{ inputs.openshift-version }}"
- name: Terraform Apply
shell: bash
id: apply
run: |
cd .github/actions/rosa-create-cluster/modules/rosa-hcp
terraform apply -no-color rosa.plan -backend-config="bucket=${{ steps.set-terraform-variables.outputs.TFSTATE_BUCKET }}" -backend-config="key=${{ steps.set-terraform-variables.outputs.TFSTATE_KEY }}" -backend-config="region=${{ steps.set-terraform-variables.outputs.TFSTATE_REGION }}"
terraform apply -no-color rosa.plan
- name: Retrieve cluster information
shell: bash
Expand Down

0 comments on commit c384b23

Please sign in to comment.