trac-bootstrap is meant to be used an in initContainer in kubernetes to initialize a trac instead from a backup that's stored in an s3 compatible provider.
This image requires a number of environment variables
DESTINATION
The destination path in the container to extrac the backup to.GID
The group id to set on the extracted files.S3_URL
Is the URL to your S3 bucket.S3_KEY
The key in S3 that holds your trac backup.S3_ACCESS_KEY
The S3 access key.S3_SECRET_KEY
The S3 secret access key.TAR_ARGS
Arguments to pass to tar. This will need to be set to the proper
argument for decompressing as the data is piped to tar so it can not guess
the filename.UID
The user id to set on the extracted files.These environment variables are used to create an alias in mc and then extract the backup with the following commands.
mc alias set trac-bootstrap "${S3_URL}" "${S3_ACCESS_KEY}" "${S3_SECRET_KEY}"
mc cat "trac-bootstrap/${S3_KEY}" | tar -xf -C "${DESTINATION}"
chmod -R "${UID}":"${GID}" "${DESTINATION}"
Note these commands are copied from bootstrap and may have not always get updated. Please double check the file if you need to.
If this container finds an existing ${DESTINATION}/conf/trac.ini
it will
assume that the bootstrap is already complete and exit successfully. This
means you can happily leave the init container around forever and in the event
something should happen to your volume mount, it'll fix it.