Skip to content

Commit

Permalink
run_zip_lambda_workflow_step set to false
Browse files Browse the repository at this point in the history
  • Loading branch information
libracoder committed Dec 3, 2024
1 parent f19fcda commit fc8d1e5
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 1 deletion.
82 changes: 82 additions & 0 deletions .github/workflows/crossplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
service_name:
required: true
type: string
run_zip_lambda_workflow_step:
type: boolean
default: false


permissions:
id-token: write
Expand Down Expand Up @@ -53,6 +57,84 @@ jobs:
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ~1.9













- name: Build lambdas
if: ${{inputs.run_zip_lambda_workflow_step == true}}
run: cd ${{ github.workspace }} && make lambda
env:
GITHUB_TOKEN: ${{ secrets.GB_TOKEN_PRIVATE }}
GOPRIVATE: "github.com/vimeda/*"

- name: Upload Build Artifacts
if: ${{inputs.run_zip_lambda_workflow_step == 'true'}}
uses: actions/upload-artifact@v4
with:
name: srv-lambdas
path: ${{ github.workspace }}/dist/*

- uses: actions/download-artifact@v4
id: download
if: ${{inputs.run_zip_lambda_workflow_step == 'true'}}
with:
name: srv-lambdas
path: ${{ github.workspace }}/dist

- name: Display structure of downloaded files
if: ${{env.run_zip_lambda_workflow_step == true}}
run: ls -R
working-directory: ${{ steps.download.outputs.download-path }}
env:
run_zip_lambda_workflow_step: ${{ inputs.run_zip_lambda_workflow_step }}

- name: Push all functions to Bucket
if: ${{env.run_zip_lambda_workflow_step == true}}
run: |
cd ${{ github.workspace }}/dist && ls
for file in "./"/*lambda.zip
do
filename=$(basename "$file" .zip)
function_name=${filename%_lambda}
aws s3 cp "$file" "s3://${{inputs.env}}-lykon-lambdas/${{ github.event.repository.name}}/$function_name.zip"
done
env:
run_zip_lambda_workflow_step: ${{ inputs.run_zip_lambda_workflow_step }}


























-
name: Terraform Init
Expand Down
3 changes: 3 additions & 0 deletions crossplane/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,7 @@ resource "kubectl_manifest" "apply" {
depends_on = [data.kubectl_file_documents.claims]
for_each = toset(local.manifests_array)
yaml_body = each.value # Apply each manifest from the array
lifecycle {
create_before_destroy = true # recreate the resource each time
}
}
2 changes: 1 addition & 1 deletion crossplane/modify-claims.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ add_vpc_config() {
if [[ "$env" == "staging" ]]; then
config='{"vpcConfig":[{"securityGroupIds":["sg-03c24245575c1ebc0"],"subnetIds":["subnet-011cb6fe763310759","subnet-08deca209f9e46ebb","subnet-06e62ab1abfd70465"]}]}'
elif [[ "$env" == "prod" ]]; then
config='{"vpcConfig":[{"securityGroupIds":["sg-03c24245575c1ebc0"],"subnetIds":["subnet-011cb6fe763310759","subnet-08deca209f9e46ebb","subnet-06e62ab1abfd70465"]}]}'
config='{"vpcConfig":[{"securityGroupIds":["sg-0c928b162190fd686"],"subnetIds":["subnet-0a03a55b3efec8bc5","subnet-074c6060a0d7ebe56","subnet-0ee3dbbbc8db2762e"]}]}'
else
echo "Error: Unsupported environment $env"
exit 1
Expand Down

0 comments on commit fc8d1e5

Please sign in to comment.