Skip to content

Commit a8a3738

Browse files
committed
inline wrapper ci script while we test it
1 parent 00f4691 commit a8a3738

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed
Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
1-
#!/bin/bash
1+
#!/bin/bash
2+
3+
# Description:
4+
# A wrapper script to run `git-conceal unlock` on CI
5+
# See https://github.com/Automattic/git-conceal
6+
#
7+
# The wrapper automatically runs the `install.sh` script of `git-conceal`
8+
# if it's not already installed locally before running `git-conceal unlock env:…`.
9+
#
10+
# By default, it uses the `GIT_CONCEAL_SECRET_KEY` environment variable as the key source.
11+
# You can override it by passing the environment variable name as the first argument.
12+
#
213

314
set -euo pipefail
415

5-
git-conceal unlock env:GIT_CONCEAL_ENCRYPTION_KEY
16+
env_var_name=${1:-GIT_CONCEAL_SECRET_KEY}
17+
18+
19+
# If installed in the $PATH, execute it (replacing this current process)
20+
if command -v git-conceal &> /dev/null; then
21+
echo "git-conceal binary found in PATH at $(command -v git-conceal)"
22+
git-conceal unlock "env:${env_var_name}"
23+
exit $?
24+
fi
25+
26+
INSTALL_DIR="${PWD}"
27+
# If was already previously installed in INSTALL_DIR, execute it (replacing this current process)
28+
if [[ -x "${INSTALL_DIR}/git-conceal" ]]; then
29+
echo "git-conceal binary found in ${INSTALL_DIR}"
30+
"${INSTALL_DIR}/git-conceal" unlock "env:${env_var_name}"
31+
exit $?
32+
fi
33+
34+
# Otherwise, install it locally and execute it
35+
echo "git-conceal binary not found. Installing it..."
36+
mkdir -p "${INSTALL_DIR}"
37+
curl -fsSL https://raw.githubusercontent.com/Automattic/git-conceal/trunk/install.sh | bash -s -- --prefix "${INSTALL_DIR}"
38+
"${INSTALL_DIR}/git-conceal" unlock "env:${env_var_name}"

.buildkite/shared-pipeline-vars

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# This file is `source`'d before calling `buildkite-agent pipeline upload`, and can be used
44
# to set up some variables that will be interpolated in the `.yml` pipeline before uploading it.
55

6-
# "git-crypt-unlock" branch / https://github.com/Automattic/a8c-ci-toolkit-buildkite-plugin/pull/195
7-
export CI_TOOLKIT="automattic/a8c-ci-toolkit#13e3bb6349f69fb78bf7157367be727489bb1fb2"
6+
export CI_TOOLKIT="automattic/a8c-ci-toolkit#5.7.0"
87
export TEST_COLLECTOR="test-collector#v1.10.1"
98
export CLAUDE_PLUGIN="claude-summarize#v1.1.0"

0 commit comments

Comments
 (0)