Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jrzvnn committed Sep 11, 2023
0 parents commit cfbab71
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Docker Image CI/CD to ECR

on:
push:
branches:
- main # Adjust the branch name as needed

jobs:
build-and-push-images:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Configure AWS credentials
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: <your-region>

- name: Run Docker image push script
run: |
chmod +x push_images_to_ecr.sh
./scripts.sh
34 changes: 34 additions & 0 deletions scripts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

# Define the list of images to pull and push
IMAGES=(
securecodebox/engine
securecodebox/nmap
securecodebox/zap
securecodebox/nikto
securecodebox/sslyze
securecodebox/bodgeit
securecodebox/amass
securecodebox/arachni
securecodebox/ssh
securecodebox/lurcher
securecodebox/hook-teams-notification
)

AWS_REGION="us-east-1"
ECR_URI="353472581086.dkr.ecr.us-east-1.amazonaws.com/dk-securecodebox"

aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
aws configure set default.region $AWS_REGION

$(aws ecr get-login --no-include-email --region $AWS_REGION)

for IMAGE in "${IMAGES[@]}"; do
docker pull $IMAGE:latest
NEW_TAG="$ECR_URI:$(basename $IMAGE)-latest"
docker tag $IMAGE:latest $NEW_TAG
docker push $NEW_TAG
done


0 comments on commit cfbab71

Please sign in to comment.