Skip to content

New Consul release version v1.22.1 #17

New Consul release version v1.22.1

New Consul release version v1.22.1 #17

name: Scenario testing for AWS
# Controls when the action will run. Workflow runs when manually triggered.
on:
workflow_dispatch:
inputs:
CONSUL_VERSION:
description: 'Consul version for the testing'
required: true
default: 'latest'
push:
paths:
- '.github/workflows/release_version/*'
env:
WORKFLOW_STEP_REPORT: /home/runner/workflow.log
permissions:
contents: write # required permission to delete artifact
actions: write
packages: write
id-token: write
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "greet"
build_and_run_aws:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Prerequisites
run: |
touch $WORKFLOW_STEP_REPORT
ln $WORKFLOW_STEP_REPORT workflow.log
echo "Install prerequisites step" > $WORKFLOW_STEP_REPORT
sudo apt-get update && sudo apt-get install -y gnupg software-properties-common
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg > /dev/null
gpg --no-default-keyring --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg --fingerprint
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update
sudo apt-get install terraform
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
rm -rf awscliv2.zip aws
- name: Login to doormat
id: doormat-action
uses: hashicorp/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
aws-role-arn: ${{ secrets.DOORMAT_ROLE_ARN}}
- run: aws sts get-caller-identity
- run: aws ec2 describe-regions
- name: Run GS 2 AWS
run: |
echo "Run GS 2 AWS" > $WORKFLOW_STEP_REPORT
cd self-managed/infrastructure/aws
terraform init | tee -a $WORKFLOW_STEP_REPORT
terraform destroy --auto-approve | tee -a $WORKFLOW_STEP_REPORT
terraform plan
# terraform apply --auto-approve --var-file=../../ops/conf/GS_01_deploy_consul.tfvars -var="solve_scenario=true" | tee -a $WORKFLOW_STEP_REPORT
- name: Create Jira report
uses: bryannice/gitactions-jira-issue-creation@master
if: failure()
env:
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_USERNAME: ${{ secrets.JIRA_USERNAME }}
JIRA_ACCOUNT_URL: https://hashicorp.atlassian.net/
JIRA_PROJECT: CE
JIRA_ISSUE_TYPE: Tutorial bug report
JIRA_ISSUE_SUMMARY: Failed instruqt build for ${{ env.CONSUL_VERSION }}.
JIRA_ISSUE_DESCRIPTION: Automated testing for Consul tutorial.
JIRA_ISSUE_ATTACHMENT: workflow.log
- name: Release and publish
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./runbooks/self_managed-docker*
tag: ${{ env.CONSUL_VERSION }}
overwrite: true
file_glob: true
body: "Automated release for Consul ${{ env.CONSUL_VERSION }}"