Admin: Add Data automation scripts (#5924)
This commit is contained in:
		
							parent
							
								
									95eda0a346
								
							
						
					
					
						commit
						5c95991dcc
					
				
							
								
								
									
										51
									
								
								.github/workflows/data-update_ec2-instance-offerings.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								.github/workflows/data-update_ec2-instance-offerings.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,51 @@
 | 
				
			|||||||
 | 
					# Data Update:
 | 
				
			||||||
 | 
					#   EC2 Instance Offerings
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# This Github Action:
 | 
				
			||||||
 | 
					#   - executes the script that updates the EC2 instance offerings that come bundled with Moto
 | 
				
			||||||
 | 
					#   - creates a PR
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					name: "DataUpdate_EC2InstanceOfferings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					on:
 | 
				
			||||||
 | 
					  schedule:
 | 
				
			||||||
 | 
					    - cron: '00 12 * * 0'
 | 
				
			||||||
 | 
					  workflow_dispatch:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  update:
 | 
				
			||||||
 | 
					    name: Update EC2 Instance Offerings
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    if: ${{ github.ref == 'refs/heads/master' && github.repository == 'getmoto/moto' }}
 | 
				
			||||||
 | 
					    permissions:
 | 
				
			||||||
 | 
					      id-token: write
 | 
				
			||||||
 | 
					      contents: write
 | 
				
			||||||
 | 
					      pull-requests: write
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					    - name: Checkout repository
 | 
				
			||||||
 | 
					      uses: actions/checkout@v3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Set up Python 3.9
 | 
				
			||||||
 | 
					      uses: actions/setup-python@v4
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        python-version: 3.9
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Configure AWS
 | 
				
			||||||
 | 
					      uses: aws-actions/configure-aws-credentials@v1
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        aws-region: us-east-1
 | 
				
			||||||
 | 
					        role-to-assume: arn:aws:iam::486285699788:role/GithubActionsRole
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Pull EC2 instance types from AWS
 | 
				
			||||||
 | 
					      uses: technote-space/create-pr-action@v2
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        GITHUB_TOKEN: ${{ secrets.PR_ACCESS_TOKEN }}
 | 
				
			||||||
 | 
					        EXECUTE_COMMANDS: |
 | 
				
			||||||
 | 
					          pip install boto3
 | 
				
			||||||
 | 
					          scripts/ec2_get_instance_type_offerings.py
 | 
				
			||||||
 | 
					        COMMIT_MESSAGE: 'chore: update EC2 Instance Offerings'
 | 
				
			||||||
 | 
					        COMMIT_NAME: 'Moto Admin'
 | 
				
			||||||
 | 
					        COMMIT_EMAIL: 'admin@getmoto.org'
 | 
				
			||||||
 | 
					        PR_BRANCH_NAME: 'chore-update-${PR_ID}'
 | 
				
			||||||
 | 
					        PR_TITLE: 'chore: update EC2 Instance Offerings'
 | 
				
			||||||
@ -10,7 +10,6 @@ name: "DataUpdate_EC2InstanceTypes"
 | 
				
			|||||||
on:
 | 
					on:
 | 
				
			||||||
  schedule:
 | 
					  schedule:
 | 
				
			||||||
    - cron: '00 12 * * 0'
 | 
					    - cron: '00 12 * * 0'
 | 
				
			||||||
  workflow_dispatch:
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
jobs:
 | 
					jobs:
 | 
				
			||||||
  update:
 | 
					  update:
 | 
				
			||||||
@ -40,7 +39,7 @@ jobs:
 | 
				
			|||||||
    - name: Pull EC2 instance types from AWS
 | 
					    - name: Pull EC2 instance types from AWS
 | 
				
			||||||
      uses: technote-space/create-pr-action@v2
 | 
					      uses: technote-space/create-pr-action@v2
 | 
				
			||||||
      with:
 | 
					      with:
 | 
				
			||||||
        GITHUB_TOKEN: ${{ secrets.PR_ACCESS_TOKEN }}
 | 
					        # GITHUB_TOKEN: ${{ secrets.PR_ACCESS_TOKEN }}
 | 
				
			||||||
        EXECUTE_COMMANDS: |
 | 
					        EXECUTE_COMMANDS: |
 | 
				
			||||||
          pip install boto3
 | 
					          pip install boto3
 | 
				
			||||||
          scripts/get_instance_info.py
 | 
					          scripts/get_instance_info.py
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										51
									
								
								.github/workflows/data-update_ssm-default-amis.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								.github/workflows/data-update_ssm-default-amis.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,51 @@
 | 
				
			|||||||
 | 
					# Data Update:
 | 
				
			||||||
 | 
					#   SSM default AMIs
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# This Github Action:
 | 
				
			||||||
 | 
					#   - executes the script that updates the SSM default AMI's that come bundled with Moto
 | 
				
			||||||
 | 
					#   - creates a PR
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					name: "DataUpdate_SSMdefaultAMIs"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					on:
 | 
				
			||||||
 | 
					  schedule:
 | 
				
			||||||
 | 
					    - cron: '00 12 * * 0'
 | 
				
			||||||
 | 
					  workflow_dispatch:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  update:
 | 
				
			||||||
 | 
					    name: Update SSM default AMIs
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    if: ${{ github.ref == 'refs/heads/master' && github.repository == 'getmoto/moto' }}
 | 
				
			||||||
 | 
					    permissions:
 | 
				
			||||||
 | 
					      id-token: write
 | 
				
			||||||
 | 
					      contents: write
 | 
				
			||||||
 | 
					      pull-requests: write
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					    - name: Checkout repository
 | 
				
			||||||
 | 
					      uses: actions/checkout@v3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Set up Python 3.9
 | 
				
			||||||
 | 
					      uses: actions/setup-python@v4
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        python-version: 3.9
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Configure AWS
 | 
				
			||||||
 | 
					      uses: aws-actions/configure-aws-credentials@v1
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        aws-region: us-east-1
 | 
				
			||||||
 | 
					        role-to-assume: arn:aws:iam::486285699788:role/GithubActionsRole
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Pull SSM default AMIs from AWS
 | 
				
			||||||
 | 
					      uses: technote-space/create-pr-action@v2
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        GITHUB_TOKEN: ${{ secrets.PR_ACCESS_TOKEN }}
 | 
				
			||||||
 | 
					        EXECUTE_COMMANDS: |
 | 
				
			||||||
 | 
					          pip install boto3
 | 
				
			||||||
 | 
					          python scripts/ssm_get_default_amis.py
 | 
				
			||||||
 | 
					        COMMIT_MESSAGE: "chore: update SSM default AMI's"
 | 
				
			||||||
 | 
					        COMMIT_NAME: 'Moto Admin'
 | 
				
			||||||
 | 
					        COMMIT_EMAIL: 'admin@getmoto.org'
 | 
				
			||||||
 | 
					        PR_BRANCH_NAME: 'chore-update-${PR_ID}'
 | 
				
			||||||
 | 
					        PR_TITLE: "chore: update SSM Instance AMI's"
 | 
				
			||||||
							
								
								
									
										51
									
								
								.github/workflows/data-update_ssm-default-parameters.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								.github/workflows/data-update_ssm-default-parameters.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,51 @@
 | 
				
			|||||||
 | 
					# Data Update:
 | 
				
			||||||
 | 
					#   SSM default parameters
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# This Github Action:
 | 
				
			||||||
 | 
					#   - executes the script that updates the SSM default parameters that come bundled with Moto
 | 
				
			||||||
 | 
					#   - creates a PR
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					name: "DataUpdate_SSMdefaultParameters"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					on:
 | 
				
			||||||
 | 
					  schedule:
 | 
				
			||||||
 | 
					    - cron: '00 12 * * 0'
 | 
				
			||||||
 | 
					  workflow_dispatch:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  update:
 | 
				
			||||||
 | 
					    name: Update SSM default parameters
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    if: ${{ github.ref == 'refs/heads/master' && github.repository == 'getmoto/moto' }}
 | 
				
			||||||
 | 
					    permissions:
 | 
				
			||||||
 | 
					      id-token: write
 | 
				
			||||||
 | 
					      contents: write
 | 
				
			||||||
 | 
					      pull-requests: write
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					    - name: Checkout repository
 | 
				
			||||||
 | 
					      uses: actions/checkout@v3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Set up Python 3.9
 | 
				
			||||||
 | 
					      uses: actions/setup-python@v4
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        python-version: 3.9
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Configure AWS
 | 
				
			||||||
 | 
					      uses: aws-actions/configure-aws-credentials@v1
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        aws-region: us-east-1
 | 
				
			||||||
 | 
					        role-to-assume: arn:aws:iam::486285699788:role/GithubActionsRole
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Pull SSM default Parameters from AWS
 | 
				
			||||||
 | 
					      uses: technote-space/create-pr-action@v2
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        GITHUB_TOKEN: ${{ secrets.PR_ACCESS_TOKEN }}
 | 
				
			||||||
 | 
					        EXECUTE_COMMANDS: |
 | 
				
			||||||
 | 
					          pip install boto3
 | 
				
			||||||
 | 
					          python scripts/ssm_get_default_params.py
 | 
				
			||||||
 | 
					        COMMIT_MESSAGE: "chore: update SSM default parameters"
 | 
				
			||||||
 | 
					        COMMIT_NAME: 'Moto Admin'
 | 
				
			||||||
 | 
					        COMMIT_EMAIL: 'admin@getmoto.org'
 | 
				
			||||||
 | 
					        PR_BRANCH_NAME: 'chore-update-${PR_ID}'
 | 
				
			||||||
 | 
					        PR_TITLE: "chore: update SSM Instance parameters"
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user