Created
May 2, 2022 11:11
-
-
Save omerlh/c2245637c9a8b9d5cdbd64d38d210627 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
if [[ "$@" == "run"* && -z "${CI}" ]]; then | |
echo "Logging in to 1password" | |
# Set env var here as specific in the doc: https://developer.1password.com/docs/cli/secrets-environment-variables | |
eval $(op signin) | |
op run -- ${BAZEL_REAL} $@ | |
else | |
exec -a $0 ${BAZEL_REAL} $@ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A small script demoing how to integrate 1password with Bazel 💪
To use it, put the script under
tools
folder. Bazel will execute it each time it is running.Take a look at 1password docs to learn how to configure 1password