diff --git a/.github/scripts/docker-create-and-push.sh b/.github/scripts/docker-create-and-push.sh index 3bf8e49cb..cb619edbd 100755 --- a/.github/scripts/docker-create-and-push.sh +++ b/.github/scripts/docker-create-and-push.sh @@ -11,10 +11,12 @@ echo "tag message: $2" echo "buildarg supplied: $3" echo "tagging version" -git tag -a $1 -m "$2" -git push --tags +#git tag -a $1 -m "$2" +#git push --tags docker buildx create --name mybuilder docker buildx use mybuilder +echo "generating challenge 12-data" +openssl rand -base64 32 >yourkey.txt echo "creating containers" docker buildx build --platform linux/amd64,linux/arm64 -t jeroenwillemsen/addo-example:$1-no-vault --build-arg "$3" --build-arg "PORT=8081" --build-arg "argBasedVersion=$1" --build-arg "spring_profile=without-vault" --push ./../../. docker buildx build --platform linux/amd64,linux/arm64 -t jeroenwillemsen/addo-example:$1-local-vault --build-arg "$3" --build-arg "PORT=8081" --build-arg "argBasedVersion=$1" --build-arg "spring_profile=local-vault" --push ./../../. diff --git a/.gitignore b/.gitignore index 3b74a75cd..e172c9487 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,6 @@ aws/.terraform.tfstate.lock.info # Templated gcp/k8s/secret-volume.yml gcp/k8s/secret-challenge-vault-deployment.yml + +# Challenge 12 ;-) +.github/scripts/yourkey.txt diff --git a/Dockerfile b/Dockerfile index 9a291a4f5..7f3169563 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,4 +13,5 @@ RUN echo "$ARG_BASED_PASSWORD" RUN echo "$argBasedPassword" ADD target/wrongsecrets-0.0.2-SNAPSHOT.jar /application.jar +ADD .github/scripts/yourkey.txt /yourkey.txt CMD java -jar -Dspring.profiles.active=$(echo ${SPRING_PROFILES_ACTIVE}) application.jar \ No newline at end of file