Skip to content

fix quotes

fix quotes #32

name: Deploy Friendly-Umbrella
on:
push:
jobs:
build:
runs-on:
- codebuild-cfpb-cfgov-testing-gha-${{ github.run_id }}-${{ github.run_attempt }}
steps:
# Step 1: Checkout Friendly Umbrella Repo
- name: Checkout Friendly-Umbrella
uses: actions/checkout@v2
# Step 2: Build Docker Image
- name: Build Friendly-Umbrella Docker Image
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
, ${{ secrets.SECURITY_SCAN_SECRET }}
parse-json-secrets: true
- name: Build Docker Image
run: |
# Log into AWS
aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username ${{ secrets.AWS_USERNAME }} --password-stdin ${{ secrets.ECR_REGISTRY }}
# Build Friendly-Umbrella Image
docker build -t ${{ secrets.ECR_REPO }}:$GITHUB_SHA .
echo $TL_CONSOLE_URL
curl -k -u "$TL_USER:$TL_PASSWORD" "$TL_CONSOLE_URL/api/v1/util/twistcli" --output twistcli
chmod +x twistcli
./twistcli images scan --details -address "${TL_CONSOLE_URL}" -u "${TL_USER}" -p "${TL_PASSWORD}" ${{ secrets.ECR_REPO }}:$GITHUB_SHA tee twistcli.log; EXITCODE=$?
# Push to ECR
docker push ${{ secrets.ECR_REPO }}:$GITHUB_SHA
# Step 3: Install Kubectl and Helm, Connecting to EKS
- name: Install K8s/Helm
run: |
# Install Helm
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
# Install kubectl
curl -o ./kubectl https://s3.us-west-2.amazonaws.com/amazon-eks/1.25.14/2023-10-17/bin/linux/amd64/kubectl
curl -o ./kubectl.sha256 https://s3.us-west-2.amazonaws.com/amazon-eks/1.25.14/2023-10-17/bin/linux/amd64/kubectl.sha256
(diff <(openssl sha256 kubectl | awk {'print $2'}) <(cat kubectl.sha256 | awk {'print $1'}) &&
echo 'kubectl checksum matches, enabling usage') || (echo 'kubectl checksum failed, exiting' && exit 1)
chmod +x kubectl
mkdir -p $HOME/bin && mv kubectl $HOME/bin/kubectl && export PATH=$PATH:$HOME/bin
echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc
source ~/.bashrc
kubectl version --client
aws eks update-kubeconfig --name $CLUSTER_NAME --region us-east-1
# Step 4: Install Helm Chart on EKS
- name: Install Helm Chart on EKS
run: >
helm upgrade --install friendly-umbrella ./helm
-n ${{ secrets.NAMESPACE }} -f ./helm/values.yaml
--set image.repository=${{ secrets.ECR_REPO }}
--set image.tag=$GITHUB_SHA
--set mapping.host=${{ secrets.HOST }}
--set serviceAccount.name=${{ secrets.K8S_SERVICE_ACCOUNT }}
--set config.AWS_STORAGE_BUCKET_NAME=${{ secrets.BUCKET_NAME }}