diff --git a/Jenkinsfile b/Jenkinsfile index 4d3ce17..d2f0e0d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,8 +13,6 @@ pipeline { CI_ARTIFACT_DIR = '.ci-artifacts' DEPLOY_DIR = '/mnt/books/Reports' DIAGNOSTICS_AUTHOR = 'Beffroi' - // Later replace with credentials('reports-zip-password') (Secret text). - REPORT_ZIP_PASSWORD = 'CHANGE_ME' } stages { @@ -103,6 +101,9 @@ pipeline { } stage('Package Reports') { + environment { + REPORT_ZIP_PASSWORD = credentials('typst-reporter-publish-password') + } steps { sh ''' set +x diff --git a/README.md b/README.md index ff204c1..3bc87d1 100644 --- a/README.md +++ b/README.md @@ -132,15 +132,22 @@ and write access to `/mnt/books/Reports`. `DIAGNOSTICS_AUTHOR` defaults to Beffr Jenkins installs pinned [pyzipper](https://pypi.org/project/pyzipper/) into `.ci-venv` and creates AES-256 ZIPs without a system `zip` executable. Extract with an AES-capable ZIP reader, such as 7-Zip. -The temporary password is `CHANGE_ME`; it is a public placeholder, not a secret. -Later create a Jenkins **Secret text** credential and replace the Jenkinsfile -assignment with `REPORT_ZIP_PASSWORD = credentials('reports-zip-password')`. -The packaging script reads that environment variable with shell tracing disabled. +Jenkins binds the **Secret text** credential `typst-reporter-publish-password` +to `REPORT_ZIP_PASSWORD` only during the packaging stage. The credential must be +accessible to this job. The packaging script requires a nonempty password and +reads it from the environment with shell tracing disabled; there is no fallback +password. The next successful publication replaces both ZIPs using this secret. To package an existing local build: ```bash uv venv --allow-existing .ci-venv uv pip install --python .ci-venv/bin/python -r tools/packaging-requirements.txt -PACKAGING_PYTHON=.ci-venv/bin/python REPORT_ZIP_PASSWORD=CHANGE_ME ./tools/package-reports.sh +# Prompt without echoing the password or storing it in shell history. +set +x +read -r -s -p 'Archive password: ' REPORT_ZIP_PASSWORD +printf '\n' +export REPORT_ZIP_PASSWORD +PACKAGING_PYTHON=.ci-venv/bin/python ./tools/package-reports.sh +unset REPORT_ZIP_PASSWORD ```