add lambda_patching scripts #1
Workflow file for this run
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
on: | ||
workflow_call: | ||
inputs: | ||
role_name: | ||
required: true | ||
type: string | ||
role_session_name: | ||
required: true | ||
type: string | ||
aws_region: | ||
required: false | ||
type: string | ||
default: eu-central-1 | ||
working_directory: | ||
required: true | ||
type: string | ||
function_name: | ||
required: true | ||
type: string | ||
env: | ||
required: true | ||
type: string | ||
permissions: | ||
id-token: write | ||
contents: read | ||
pull-requests: write | ||
statuses: write | ||
jobs: | ||
terraform: | ||
name: Terraform | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
defaults: | ||
run: | ||
working-directory: ${{ inputs.working_directory }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Configure AWS Credentials | ||
id: aws | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ inputs.role_name }} | ||
role-session-name: ${{ inputs.role_session_name }} | ||
aws-region: ${{ inputs.aws_region }} | ||
- name: Build lambdas | ||
run: cd ${{ github.workspace }} && make lambda | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GB_TOKEN_PRIVATE }} | ||
GOPRIVATE: "github.com/vimeda/*" | ||
- name: Upload Build Artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: order-srv-lambdas | ||
path: ${{ github.workspace }}/dist/* | ||
- uses: actions/download-artifact@v2 | ||
id: download | ||
with: | ||
name: order-srv-lambdas | ||
path: ${{ github.workspace }}/dist | ||
- name: Display structure of downloaded files | ||
run: ls -R | ||
working-directory: ${{ steps.download.outputs.download-path }} | ||
- name: Push function to Bucket | ||
run: cd ${{ github.workspace }}/dist && aws s3 cp ${{ inputs.function_name }}_lambda.zip s3://${{ inputs.env }}-lykon-lambdas/${{ inputs.function_name }}/function.zip | ||
- uses: hashicorp/setup-terraform@v1 | ||
with: | ||
terraform_version: ~1.0 | ||
- name: Terraform Init | ||
id: init | ||
run: terraform -chdir=${{ github.workspace }}/configs/crossplane/${{ inputs.env }} init | ||
- name: Patch Claim from Parameter store LSS | ||
run: | | ||
# cd ${{ github.workspace }} && ls | ||
cd ${{ inputs.working_directory }} && ls | ||
shell: sh | ||
# | ||
# - name: display claim | ||
# run: | | ||
# cat ${{ github.workspace }}/configs/crossplane/${{ inputs.env }}/claims.yaml | ||
# shell: sh | ||
# - name: Terraform apply | ||
# id: apply | ||
# run: | | ||
# pwd | ||
# echo "${{ secrets.STAGING_KUBECONFIG }}" > ${{ github.workspace }}/kubeconfig.yaml | ||
# export KUBECONFIG=${{ github.workspace }}/kubeconfig.yaml | ||
# terraform -chdir=${{ github.workspace }}/configs/crossplane/${{ inputs.env }} apply -auto-approve -input=false -var-file=staging.tfvars.json | ||
# env: | ||
# TF_WORKSPACE: ${{ inputs.env }} |