Update requirements.txt #234
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
name: GitHub Actions Demo | |
on: [push] | |
jobs: | |
DeployCode: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_KEY }} | |
aws-region: ${{ secrets.REGION }} | |
- id: files | |
uses: jitterbit/get-changed-files@v1 | |
with: | |
format: 'json' | |
- run: | | |
set -e | |
folders="" | |
files=`jq -r '.[]' <<<'${{ steps.files.outputs.added_modified }}'` | |
for file in ${files[@]}; do | |
folders="$folders $(dirname $file)" | |
done | |
folders="$folders" | tr " " "\n" | sort | uniq | tr "\n" " " | |
cd bin | |
type="" | |
function="" | |
for folder in $folders; do | |
IFS="/" read -ra PARTS <<< "$folder" | |
if [[ $folder == *-udfs/* ]] && [[ $function != ${PARTS[1]} ]]; then | |
type=${PARTS[0]} | |
function=${PARTS[1]} | |
key=${{ secrets.S3_KEY }} | |
if ! [[ -z "${key// }" ]]; then | |
k="-k ${{ secrets.S3_KEY }}" | |
fi | |
./deployFunction.sh -t $type -f "$function" -s ${{ secrets.S3_BUCKET }} $k -r ${{ secrets.IAM_ROLE }} -c ${{ secrets.CLUSTER }} -d ${{ secrets.DB }} -u ${{ secrets.USER }} -n ${{ secrets.SCHEMA }} -g ${{ secrets.SECURITY_GROUP }} -x ${{ secrets.SUBNET }} | |
./testFunction.sh -t $type -f "$function" -c ${{ secrets.CLUSTER }} -d ${{ secrets.DB }} -u ${{ secrets.USER }} -n ${{ secrets.SCHEMA }} | |
else | |
echo Ignoring: $folder | |
fi | |
done |