Skip to content

Commit

Permalink
wait for started db
Browse files Browse the repository at this point in the history
  • Loading branch information
escoand committed Aug 16, 2024
1 parent e37e7f4 commit 20c3524
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/test_kube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ jobs:
run: |-
set -euo pipefail
find init/ -name 'secrets.*.yaml' -print -exec podman kube play {} \;
find kube/ -name '*.yaml' -print -exec podman kube play --quiet --start=false {} \;
- name: Start databases
run: |-
set -euo pipefail
podman pod start mariadb
podman wait --condition healthy mariadb-app
- name: Start pods
run: podman pod start -a
find kube/ -name '*.yaml' -print -exec podman kube play --quiet {} \;
- name: Wait for healthy state
run: |-
set -euo pipefail
Expand Down Expand Up @@ -120,9 +113,5 @@ jobs:
if: ${{ always() }}
run: |-
set -euo pipefail
yq -ot '. as $parent | (
.spec.containers[] | $parent.metadata.name + "-" + .name,
.spec.template.spec.containers[] | $parent.metadata.name + "-pod-" + .name,
.spec.initContainers[] | $parent.metadata.name + "-" + .name
)' kube/*.yaml |
podman ps -aq |
xargs -tn1 podman logs -n
1 change: 1 addition & 0 deletions kube/nextcloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ spec:
- sh
- -c
- |-
until mariadb --skip-ssl -h mariadb -p"$MARIADB_ROOT_PASSWORD" -e "select 1"; do sleep 3; done
cat <<EOF | mariadb -h mariadb -p"$MARIADB_ROOT_PASSWORD"
CREATE DATABASE IF NOT EXISTS $MYSQL_DATABASE;
CREATE USER IF NOT EXISTS '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD';
Expand Down
1 change: 1 addition & 0 deletions kube/wordpress1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ spec:
- sh
- -c
- |-
until mariadb --skip-ssl -h mariadb -p"$MARIADB_ROOT_PASSWORD" -e "select 1"; do sleep 3; done
cat <<EOF | mariadb -h mariadb -p"$MARIADB_ROOT_PASSWORD"
CREATE DATABASE IF NOT EXISTS $WORDPRESS_DB_NAME;
CREATE USER IF NOT EXISTS '$WORDPRESS_DB_USER'@'%' IDENTIFIED BY '$WORDPRESS_DB_PASSWORD';
Expand Down
1 change: 1 addition & 0 deletions kube/wordpress2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ spec:
- sh
- -c
- |-
until mariadb --skip-ssl -h mariadb -p"$MARIADB_ROOT_PASSWORD" -e "select 1"; do sleep 3; done
cat <<EOF | mariadb -h mariadb -p"$MARIADB_ROOT_PASSWORD"
CREATE DATABASE IF NOT EXISTS $WORDPRESS_DB_NAME;
CREATE USER IF NOT EXISTS '$WORDPRESS_DB_USER'@'%' IDENTIFIED BY '$WORDPRESS_DB_PASSWORD';
Expand Down

0 comments on commit 20c3524

Please sign in to comment.