S/4HANA FND 2022 (RHEL4SAP8.6)_ #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SAP S/4HANA Foundation 2022 / SAP HANA / RHEL4SAP 8.6 / eu-central-1 / Runs bi-weekly / SAP Software Download & SSM for SAP & ABAP SDK | |
name: 'S/4HANA FND 2022 (RHEL4SAP8.6)_' | |
# Controls when the workflow will run | |
on: | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '0 7 2 * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# 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 "build" | |
build: | |
# 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: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_DEFAULT_REGION }} | |
role-session-name: GithubActions | |
# Runs a set of commands using the runners shell | |
- name: test | |
run: | | |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | |
unzip awscliv2.zip | |
sudo ./aws/install --update | |
aws --version | |
MyTimestamp=$(date +%s) | |
StackName=S4FND22T$MyTimestamp | |
echo ${{ secrets.STACK_SAPS4HANAFOUNDATIONS_2022 }} > stack.json | |
DEPLOYMENT_ID=$(aws launch-wizard create-deployment --specifications file://stack.json --deployment-pattern-name "SapNWOnHanaSingle" --name $StackName --workload-name "SAP" --output text --query 'deploymentId') | |
sleep 10s | |
echo "Deployment started: "$DEPLOYMENT_ID | |
until [ $(aws launch-wizard get-deployment --deployment-id $DEPLOYMENT_ID --output text --query 'deployment.status') = *"IN_PROGRESS"* ]; | |
do | |
echo "Waiting to complete...." | |
sleep 60s | |
if [ $(aws launch-wizard get-deployment --deployment-id $DEPLOYMENT_ID --output text --query 'deployment.status') != "IN_PROGRESS" ]; then | |
status=$(aws launch-wizard get-deployment --deployment-id $DEPLOYMENT_ID --output text --query 'deployment.status') | |
echo "Deployment $status" | |
if [[ $status != "COMPLETED" ]]; then | |
exit 1 | |
fi | |
break | |
fi | |
done |