Skip to content

Instantly share code, notes, and snippets.

@omerlh
Created May 2, 2022 11:11
Show Gist options
  • Save omerlh/c2245637c9a8b9d5cdbd64d38d210627 to your computer and use it in GitHub Desktop.
Save omerlh/c2245637c9a8b9d5cdbd64d38d210627 to your computer and use it in GitHub Desktop.
#!/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
@omerlh
Copy link
Author

omerlh commented May 2, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment