Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added create-mirroring-sessions-lambda files/github workflows #46

Open
wants to merge 5 commits into
base: feature/quick-setup
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions .github/workflows/deploy-create-mirroring-sessions-lambda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ feature/quick-setup ]
paths: ['lambdas/create-mirroring-sessions/**']
pull_request:
branches: [ feature/quick-setup ]
paths: ['lambdas/create-mirroring-sessions/**']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
Environment:
required: true
type: choice
options:
- prod
- staging
default: staging

# 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

#Set working-directory for build job
defaults:
run:
working-directory: lambdas/create-mirroring-sessions

# 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@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '8'
architecture: x64

- uses: actions/setup-node@v2
with:
node-version: '17'
- name: Install modules
run: npm install
- name: Configure AWS credentials
if: ${{ github.event.inputs.Environment == 'staging' || github.event.inputs.Environment == 'prod' }}
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Make zip file
env:
ZIP_NAME: ${{ github.event.inputs.Environment == 'staging' && '-staging' || '' }}
run: |
mkdir code
cp index.js ./code
cp package.json ./code
cd code
npm install
zip -r create-mirror-session${ZIP_NAME}.zip ./
- name: Copy zip file to S3
if: ${{ github.event.inputs.Environment == 'staging' || github.event.inputs.Environment == 'prod' }}
run: |
cd code
aws configure set default.s3.multipart_threshold 64MB
aws s3 cp *.zip s3://akto-setup-us-east-1/templates/ --acl bucket-owner-full-control --region us-east-1
aws s3 cp *.zip s3://akto-setup-us-east-2/templates/ --acl bucket-owner-full-control --region us-east-2
aws s3 cp *.zip s3://akto-setup-us-west-1/templates/ --acl bucket-owner-full-control --region us-west-1
aws s3 cp *.zip s3://akto-setup-us-west-2/templates/ --acl bucket-owner-full-control --region us-west-2
aws s3 cp *.zip s3://akto-setup-ap-east-1/templates/ --acl bucket-owner-full-control --region ap-east-1
aws s3 cp *.zip s3://akto-setup-ap-south-1/templates/ --acl bucket-owner-full-control --region ap-south-1
aws s3 cp *.zip s3://akto-setup-ap-northeast-2/templates/ --acl bucket-owner-full-control --region ap-northeast-2
aws s3 cp *.zip s3://akto-setup-ap-southeast-1/templates/ --acl bucket-owner-full-control --region ap-southeast-1
aws s3 cp *.zip s3://akto-setup-ap-southeast-2/templates/ --acl bucket-owner-full-control --region ap-southeast-2
aws s3 cp *.zip s3://akto-setup-ap-northeast-1/templates/ --acl bucket-owner-full-control --region ap-northeast-1
aws s3 cp *.zip s3://akto-setup-ca-central-1/templates/ --acl bucket-owner-full-control --region ca-central-1
aws s3 cp *.zip s3://akto-setup-eu-central-1/templates/ --acl bucket-owner-full-control --region eu-central-1
aws s3 cp *.zip s3://akto-setup-eu-west-1/templates/ --acl bucket-owner-full-control --region eu-west-1
aws s3 cp *.zip s3://akto-setup-eu-west-2/templates/ --acl bucket-owner-full-control --region eu-west-2
aws s3 cp *.zip s3://akto-setup-eu-west-3/templates/ --acl bucket-owner-full-control --region eu-west-3
aws s3 cp *.zip s3://akto-setup-eu-north-1/templates/ --acl bucket-owner-full-control --region eu-north-1
aws s3 cp *.zip s3://akto-setup-me-south-1/templates/ --acl bucket-owner-full-control --region me-south-1
aws s3 cp *.zip s3://akto-setup-sa-east-1/templates/ --acl bucket-owner-full-control --region sa-east-1
107 changes: 106 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,108 @@
env/
data/*
.idea/
.idea/

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
Loading