2023-01-17 10:58:10 -06:00
|
|
|
suite: Init template
|
|
|
|
release:
|
|
|
|
name: gitea-unittests
|
|
|
|
namespace: testing
|
|
|
|
templates:
|
|
|
|
- templates/gitea/init.yaml
|
|
|
|
tests:
|
|
|
|
- it: runs gpg in batch mode
|
|
|
|
set:
|
2023-06-27 15:32:01 -05:00
|
|
|
image.rootless: false
|
2023-01-17 10:58:10 -06:00
|
|
|
signing.enabled: true
|
2023-04-14 01:45:37 -05:00
|
|
|
signing.privateKey: |-
|
|
|
|
-----BEGIN PGP PRIVATE KEY BLOCK-----
|
|
|
|
{placeholder}
|
|
|
|
-----END PGP PRIVATE KEY BLOCK-----
|
2023-01-17 10:58:10 -06:00
|
|
|
asserts:
|
|
|
|
- equal:
|
2023-03-21 10:53:13 -05:00
|
|
|
path: stringData["configure_gpg_environment.sh"]
|
2023-01-17 10:58:10 -06:00
|
|
|
value: |-
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
gpg --batch --import /raw/private.asc
|
|
|
|
- it: skips gpg script block for disabled signing
|
2023-06-27 15:32:01 -05:00
|
|
|
set:
|
|
|
|
image.rootless: false
|
2023-01-17 10:58:10 -06:00
|
|
|
asserts:
|
|
|
|
- equal:
|
2023-03-21 10:53:13 -05:00
|
|
|
path: stringData["init_directory_structure.sh"]
|
2023-01-17 10:58:10 -06:00
|
|
|
value: |-
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
set -x
|
|
|
|
chown 1000:1000 /data
|
|
|
|
mkdir -p /data/git/.ssh
|
|
|
|
chmod -R 700 /data/git/.ssh
|
|
|
|
[ ! -d /data/gitea/conf ] && mkdir -p /data/gitea/conf
|
|
|
|
|
|
|
|
# prepare temp directory structure
|
|
|
|
mkdir -p "${GITEA_TEMP}"
|
|
|
|
chown 1000:1000 "${GITEA_TEMP}"
|
|
|
|
chmod ug+rwx "${GITEA_TEMP}"
|
|
|
|
- it: adds gpg script block for enabled signing
|
|
|
|
set:
|
2023-06-27 15:32:01 -05:00
|
|
|
image.rootless: false
|
2023-01-17 10:58:10 -06:00
|
|
|
signing.enabled: true
|
2023-04-14 01:45:37 -05:00
|
|
|
signing.privateKey: |-
|
|
|
|
-----BEGIN PGP PRIVATE KEY BLOCK-----
|
|
|
|
{placeholder}
|
|
|
|
-----END PGP PRIVATE KEY BLOCK-----
|
2023-01-17 10:58:10 -06:00
|
|
|
asserts:
|
|
|
|
- equal:
|
2023-03-21 10:53:13 -05:00
|
|
|
path: stringData["init_directory_structure.sh"]
|
2023-01-17 10:58:10 -06:00
|
|
|
value: |-
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
set -x
|
|
|
|
chown 1000:1000 /data
|
|
|
|
mkdir -p /data/git/.ssh
|
|
|
|
chmod -R 700 /data/git/.ssh
|
|
|
|
[ ! -d /data/gitea/conf ] && mkdir -p /data/gitea/conf
|
|
|
|
|
|
|
|
# prepare temp directory structure
|
|
|
|
mkdir -p "${GITEA_TEMP}"
|
|
|
|
chown 1000:1000 "${GITEA_TEMP}"
|
|
|
|
chmod ug+rwx "${GITEA_TEMP}"
|
|
|
|
|
|
|
|
if [ ! -d "${GNUPGHOME}" ]; then
|
|
|
|
mkdir -p "${GNUPGHOME}"
|
|
|
|
chmod 700 "${GNUPGHOME}"
|
|
|
|
chown 1000:1000 "${GNUPGHOME}"
|
|
|
|
fi
|