storj/scripts/test-billing.sh
Michał Niewrzał c8a3e0ff96 tests: fix calculation of previous month for billing integration test
Change-Id: I413629520aa52518395189c2ea56000cab67c948
2021-03-29 10:38:59 +02:00

9 lines
496 B
Bash
Executable File

#!/usr/bin/env bash
set -ueo pipefail
PERIOD=$(date -d "$(date +%Y-%m)-15 last month" '+%m/%Y')
satellite --config-dir $SATELLITE_0_DIR billing prepare-invoice-records $PERIOD
satellite --config-dir $SATELLITE_0_DIR billing create-invoice-items $PERIOD
satellite --config-dir $SATELLITE_0_DIR billing create-invoice-coupons $PERIOD
satellite --config-dir $SATELLITE_0_DIR billing create-invoices $PERIOD
satellite --config-dir $SATELLITE_0_DIR billing finalize-invoices $PERIOD