Skip to content

Commit 703d297

Browse files
committed
Call git-crypt unlock in CI
To replace calls to `configure_apply`
1 parent 70562a3 commit 703d297

File tree

11 files changed

+50
-10
lines changed

11 files changed

+50
-10
lines changed

.buildkite/commands/diff-merged-manifest.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ echo "--- :rubygems: Setting up Gems"
1515
install_gems
1616

1717
echo "--- :closed_lock_with_key: Installing Secrets"
18-
bundle exec fastlane run configure_apply
18+
.buildkite/git-crypt/git-crypt-unlock
1919

2020
echo "--- 💾 Diff Merged Manifest (Module: WooCommerce, Build Variant: ${BUILD_VARIANT})"
2121
comment_with_manifest_diff "WooCommerce" ${BUILD_VARIANT}

.buildkite/commands/gradle-cache-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ echo "--- :rubygems: Setting up Gems"
1414
install_gems
1515

1616
echo "--- :closed_lock_with_key: Installing Secrets"
17-
bundle exec fastlane run configure_apply
17+
.buildkite/git-crypt/git-crypt-unlock
1818

1919
echo "--- :hammer_and_wrench: Building"
2020
./gradlew assembleWasabiDebug

.buildkite/commands/prototype-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ echo "--- :rubygems: Setting up Gems"
1313
install_gems
1414

1515
echo "--- :closed_lock_with_key: Installing Secrets"
16-
bundle exec fastlane run configure_apply
16+
.buildkite/git-crypt/git-crypt-unlock
1717

1818
echo "--- :hammer_and_wrench: Building ${APP_TO_BUILD}"
1919
bundle exec fastlane build_and_upload_prototype_build app:"${APP_TO_BUILD}"

.buildkite/commands/release-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ echo "--- :rubygems: Setting up Gems"
66
install_gems
77

88
echo "--- :closed_lock_with_key: Installing Secrets"
9-
bundle exec fastlane run configure_apply
9+
.buildkite/git-crypt/git-crypt-unlock
1010

1111
echo "--- :hammer_and_wrench: Building ${APP_TO_BUILD}"
1212
bundle exec fastlane build_and_upload_google_play app:"${APP_TO_BUILD}"

.buildkite/commands/run-instrumented-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ echo "--- :rubygems: Setting up Gems"
1212
install_gems
1313

1414
echo "--- :closed_lock_with_key: Installing Secrets"
15-
bundle exec fastlane run configure_apply
15+
.buildkite/git-crypt/git-crypt-unlock
1616

1717
echo "--- 🧪 Testing"
1818
set +e

.buildkite/commands/run-unit-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ echo "--- :rubygems: Setting up Gems"
1212
install_gems
1313

1414
echo "--- :closed_lock_with_key: Installing Secrets"
15-
bundle exec fastlane run configure_apply
15+
.buildkite/git-crypt/git-crypt-unlock
1616

1717
echo "+++ 🧪 Testing"
1818
set +e

.buildkite/git-crypt/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM alpine:edge
2+
3+
ENV VERSION=0.8.0
4+
5+
RUN apk --update add \
6+
bash \
7+
curl \
8+
git \
9+
g++ \
10+
make \
11+
openssh \
12+
openssl \
13+
openssl-dev \
14+
&& rm -rf /var/cache/apk/*
15+
16+
RUN curl -L https://github.com/AGWA/git-crypt/archive/$VERSION.tar.gz | tar zxv -C /var/tmp
17+
RUN cd /var/tmp/git-crypt-$VERSION && make && make install PREFIX=/usr/local
18+
19+
WORKDIR /repo
20+
VOLUME /repo
21+
CMD ["/bin/bash"]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
if [ -z "$GIT_CRYPT_ENCRYPTION_KEY" ]; then
4+
echo "GIT_CRYPT_ENCRYPTION_KEY is not set"
5+
exit 1
6+
fi
7+
8+
echo "Building Docker image..."
9+
docker build --quiet -t git-crypt:0.8.0 "$(dirname "${BASH_SOURCE[0]}")"
10+
11+
echo "🔓 Decrypting repository..."
12+
repo_root=$(git rev-parse --show-toplevel)
13+
key_file=.git/git-crypt/keys/default
14+
mkdir -p "$(dirname "${repo_root}"/"${key_file}")"
15+
echo "${GIT_CRYPT_ENCRYPTION_KEY}" | base64 -d >"${repo_root}/${key_file}"
16+
docker run --rm -v "${repo_root}":/repo git-crypt:0.8.0 git-crypt unlock "/repo/${key_file}"
17+
echo "✅ git-crypt unlocked"

.buildkite/release-pipelines/download-release-translations.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ steps:
1313
echo '--- :ruby: Setup Ruby Tools'
1414
install_gems
1515
16+
echo '--- :closed_lock_with_key: Installing Secrets'
17+
.buildkite/git-crypt/git-crypt-unlock
18+
1619
echo '--- :globe_with_meridians: Download Release Translations'
1720
bundle exec fastlane download_release_translations skip_confirm:true include_wear_app:"${INCLUDE_WEAR_APP:-false}"
1821
agents:

.buildkite/release-pipelines/finalize-release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ steps:
1313
echo '--- :ruby: Setup Ruby Tools'
1414
install_gems
1515
16+
echo '--- :closed_lock_with_key: Installing Secrets'
17+
.buildkite/git-crypt/git-crypt-unlock
18+
1619
echo '--- :shipit: Finalize Release'
1720
bundle exec fastlane finalize_release skip_confirm:true include_wear_app:"${INCLUDE_WEAR_APP:-false}"
1821
agents:

0 commit comments

Comments
 (0)