Skip to content

Commit

Permalink
examples recommend using 1password-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
pnowosie committed Feb 5, 2024
1 parent efdddcd commit d19221b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
18 changes: 10 additions & 8 deletions examples/Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
PYTHON := ../.venv/bin/python
PYTHON := .venv/bin/python

venv:
python3 -m venv .venv

install: venv
${PYTHON} -m pip install ..

# I'm using 1password-cli to inject environment variables to the python
# process. You can do without 1password by preparing `.env` file and task:
# `env $$(cat ".env") ${PYTHON} script-file.py`
invoice:
${PYTHON} main.py consensius.yml
op run --env-file op.env \
${PYTHON} main.py consensius.yml

check-month:
@env $$(cat ".env") ${PYTHON} check_accounting_month.py
op run --env-file op.env \
${PYTHON} check_accounting_month.py

list-invoices:
@env $$(cat ".env") ${PYTHON} list_invoices.py
op run --env-file op.env \
${PYTHON} list_invoices.py

clean:
rm -rf .venv

clean-env:
rm .env
@echo "unset IFIRMA_API_KEY IFIRMA_abonent_API_KEY IFIRMA_API_USERNAME"
3 changes: 3 additions & 0 deletions examples/op.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
IFIRMA_API_USERNAME="op://devops/ifirma-my-api-tokens/api_user"
IFIRMA_API_KEY="op://devops/ifirma-my-api-tokens/api_key"
IFIRMA_abonent_API_KEY="op://devops/ifirma-my-api-tokens/abonent_api_key"

0 comments on commit d19221b

Please sign in to comment.