2023-06-27 20:32:01 +00:00
|
|
|
suite: Init template
|
|
|
|
release:
|
|
|
|
name: gitea-unittests
|
|
|
|
namespace: testing
|
|
|
|
templates:
|
|
|
|
- templates/gitea/init.yaml
|
|
|
|
tests:
|
|
|
|
- it: runs gpg in batch mode
|
|
|
|
set:
|
|
|
|
signing.enabled: true
|
|
|
|
signing.privateKey: |-
|
|
|
|
-----BEGIN PGP PRIVATE KEY BLOCK-----
|
|
|
|
{placeholder}
|
|
|
|
-----END PGP PRIVATE KEY BLOCK-----
|
|
|
|
asserts:
|
|
|
|
- equal:
|
|
|
|
path: stringData["configure_gpg_environment.sh"]
|
|
|
|
value: |-
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
gpg --batch --import /raw/private.asc
|
|
|
|
- it: skips gpg script block for disabled signing
|
|
|
|
asserts:
|
|
|
|
- equal:
|
|
|
|
path: stringData["init_directory_structure.sh"]
|
|
|
|
value: |-
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -euo pipefail
|
2024-09-11 12:49:18 +00:00
|
|
|
mkdir -pv /data/git/.ssh
|
|
|
|
chmod -Rv 700 /data/git/.ssh
|
|
|
|
[ ! -d /data/gitea/conf ] && mkdir -pv /data/gitea/conf
|
2023-06-27 20:32:01 +00:00
|
|
|
|
|
|
|
# prepare temp directory structure
|
2024-09-11 12:49:18 +00:00
|
|
|
mkdir -pv "${GITEA_TEMP}"
|
|
|
|
chmod -v ug+rwx "${GITEA_TEMP}"
|
2023-06-27 20:32:01 +00:00
|
|
|
- it: adds gpg script block for enabled signing
|
|
|
|
set:
|
|
|
|
signing.enabled: true
|
|
|
|
signing.privateKey: |-
|
|
|
|
-----BEGIN PGP PRIVATE KEY BLOCK-----
|
|
|
|
{placeholder}
|
|
|
|
-----END PGP PRIVATE KEY BLOCK-----
|
|
|
|
asserts:
|
|
|
|
- equal:
|
|
|
|
path: stringData["init_directory_structure.sh"]
|
|
|
|
value: |-
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -euo pipefail
|
2024-09-11 12:49:18 +00:00
|
|
|
mkdir -pv /data/git/.ssh
|
|
|
|
chmod -Rv 700 /data/git/.ssh
|
|
|
|
[ ! -d /data/gitea/conf ] && mkdir -pv /data/gitea/conf
|
2023-06-27 20:32:01 +00:00
|
|
|
|
|
|
|
# prepare temp directory structure
|
2024-09-11 12:49:18 +00:00
|
|
|
mkdir -pv "${GITEA_TEMP}"
|
|
|
|
chmod -v ug+rwx "${GITEA_TEMP}"
|
2023-06-27 20:32:01 +00:00
|
|
|
|
|
|
|
if [ ! -d "${GNUPGHOME}" ]; then
|
2024-09-11 12:49:18 +00:00
|
|
|
mkdir -pv "${GNUPGHOME}"
|
|
|
|
chmod -v 700 "${GNUPGHOME}"
|
|
|
|
chown -v 1000:1000 "${GNUPGHOME}"
|
2023-06-27 20:32:01 +00:00
|
|
|
fi
|
2023-11-14 21:42:26 +00:00
|
|
|
- it: it does not chown /data even when image.fullOverride is set
|
|
|
|
template: templates/gitea/init.yaml
|
|
|
|
set:
|
|
|
|
image.fullOverride: gitea/gitea:1.20.5
|
|
|
|
asserts:
|
|
|
|
- equal:
|
|
|
|
path: stringData["init_directory_structure.sh"]
|
|
|
|
value: |-
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -euo pipefail
|
2024-09-11 12:49:18 +00:00
|
|
|
mkdir -pv /data/git/.ssh
|
|
|
|
chmod -Rv 700 /data/git/.ssh
|
|
|
|
[ ! -d /data/gitea/conf ] && mkdir -pv /data/gitea/conf
|
2023-11-14 21:42:26 +00:00
|
|
|
|
|
|
|
# prepare temp directory structure
|
2024-09-11 12:49:18 +00:00
|
|
|
mkdir -pv "${GITEA_TEMP}"
|
|
|
|
chmod -v ug+rwx "${GITEA_TEMP}"
|