feat: add volume for registry persistence
All checks were successful
/ test (push) Successful in 50s
All checks were successful
/ test (push) Successful in 50s
This commit is contained in:
parent
a778f82a41
commit
484f9931d2
2 changed files with 13 additions and 1 deletions
|
@ -18,4 +18,4 @@ jobs:
|
||||||
- name: Authenticate with registry
|
- name: Authenticate with registry
|
||||||
run: podman login -u srv_container-registry -p ${{ secrets.REGISTRY_TOKEN }} ${{ env.CONTAINER_ADDRESS }}
|
run: podman login -u srv_container-registry -p ${{ secrets.REGISTRY_TOKEN }} ${{ env.CONTAINER_ADDRESS }}
|
||||||
- name: Push image
|
- name: Push image
|
||||||
run: podman push container-registry:0 ${{ env.CONTAINER_ADDRESS }}/container-registry:0
|
run: podman push container-registry:0 ${{ env.CONTAINER_ADDRESS }}/container-registry:${{ env.GITHUB_REF_NAME }}
|
||||||
|
|
12
start.sh
12
start.sh
|
@ -5,6 +5,7 @@ image_name=$service_name
|
||||||
image_version=0
|
image_version=0
|
||||||
|
|
||||||
auth_volume="$service_name"_auth
|
auth_volume="$service_name"_auth
|
||||||
|
data_volume="$service_name"_data
|
||||||
|
|
||||||
podman volume exists "$auth_volume"
|
podman volume exists "$auth_volume"
|
||||||
|
|
||||||
|
@ -17,6 +18,16 @@ else
|
||||||
echo "Created volume $auth_volume and seeded with empty htpasswd."
|
echo "Created volume $auth_volume and seeded with empty htpasswd."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
podman volume exists "$data_volume"
|
||||||
|
|
||||||
|
if [[ "$?" != "1" ]]; then
|
||||||
|
echo "Volume $data_volume already exists."
|
||||||
|
else
|
||||||
|
podman volume create "$data_volume"
|
||||||
|
htpasswd_parent=$(podman volume inspect "$data_volume" | jq '.[0].Mountpoint' -r)
|
||||||
|
echo "Created volume $data_volume."
|
||||||
|
fi
|
||||||
|
|
||||||
podman pod create \
|
podman pod create \
|
||||||
--name "$service_name" \
|
--name "$service_name" \
|
||||||
--replace \
|
--replace \
|
||||||
|
@ -27,4 +38,5 @@ podman run \
|
||||||
--pod "$service_name" \
|
--pod "$service_name" \
|
||||||
--name "$service_name"_app \
|
--name "$service_name"_app \
|
||||||
-v "$auth_volume":/auth:ro \
|
-v "$auth_volume":/auth:ro \
|
||||||
|
-v "$data_volume":/var/lib/registry \
|
||||||
"$image_name:$image_version"
|
"$image_name:$image_version"
|
||||||
|
|
Loading…
Reference in a new issue