diff --git a/.github/scripts/docker-create-and-push.sh b/.github/scripts/docker-create-and-push.sh new file mode 100755 index 000000000..d10fb26ef --- /dev/null +++ b/.github/scripts/docker-create-and-push.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ $# -eq 0 ] + then + echo "No arguments supplied, please supply a tag eg 'docker-create-and-push.sh '" + exit +fi + +echo "tag supplied: $1" +echo "buildarg supplied: $2" + +docker build --build-arg "$2" --build-arg "spring_profile=without-vault" -t jeroenwillemsen/addo-example:$1-no-vault ./../../. +docker push jeroenwillemsen/addo-example:$1-no-vault +docker build --build-arg "$2" --build-arg "spring_profile=local-vault" -t jeroenwillemsen/addo-example:$1-local-vault ./../../. +docker push jeroenwillemsen/addo-example:$1-local-vault +docker build --build-arg "$2" --build-arg "spring_profile=kubernetes-vault" -t jeroenwillemsen/addo-example:$1-k8s-vault ./../../. +docker push jeroenwillemsen/addo-example:$1-k8s-vault \ No newline at end of file diff --git a/README.md b/README.md index 6c52f4309..d8ab8d01c 100644 --- a/README.md +++ b/README.md @@ -124,21 +124,4 @@ Now use the `local-vault` profile to do you development. If you want to dev without a Vault instance, use the `without-vault` profile to do your development. -Want to push a container? This is how you do it if you have the credentials: -for local exercise/k8s containers: - -```shell -docker build --build-arg "argBasedPassword=" --build-arg "spring_profile=without-vault" -t jeroenwillemsen/addo-example: . -``` - -for local vault containers: - -```shell -docker build --build-arg "argBasedPassword=" --build-arg "spring_profile=local-vault" -t jeroenwillemsen/addo-example: . -``` - -for vault k8s containers: - -```shell -docker build --build-arg "argBasedPassword=" --build-arg "spring_profile=kubernetes-vault" -t jeroenwillemsen/addo-example: . -``` +Want to push a container? See `.github/scripts/docker-create-and-push.sh` for a script that generates and pushes all containers.