Skip to content

Commit

Permalink
updated readme and added a script
Browse files Browse the repository at this point in the history
  • Loading branch information
commjoen committed Oct 12, 2021
1 parent 6a12b67 commit e7836a6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
17 changes: 17 additions & 0 deletions .github/scripts/docker-create-and-push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

if [ $# -eq 0 ]
then
echo "No arguments supplied, please supply a tag eg 'docker-create-and-push.sh <tag> <buildarg>'"
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
19 changes: 1 addition & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<YOUKNOWWHATTHATISRIGHT?>" --build-arg "spring_profile=without-vault" -t jeroenwillemsen/addo-example:<TAG> .
```

for local vault containers:

```shell
docker build --build-arg "argBasedPassword=<YOUKNOWWHATTHATISRIGHT?>" --build-arg "spring_profile=local-vault" -t jeroenwillemsen/addo-example:<TAG> .
```

for vault k8s containers:

```shell
docker build --build-arg "argBasedPassword=<YOUKNOWWHATTHATISRIGHT?>" --build-arg "spring_profile=kubernetes-vault" -t jeroenwillemsen/addo-example:<TAG> .
```
Want to push a container? See `.github/scripts/docker-create-and-push.sh` for a script that generates and pushes all containers.

0 comments on commit e7836a6

Please sign in to comment.