QUAY_USER=lburnett
#this is a fake password
QUAY_TOKEN=Passw0rd
IMAGE=quay.io/lburnett/rhsm
IMAGE_TAG=quarkus_poc
OC_TOKEN=Passw0rd
docker login -u="$QUAY_USER" -p="$QUAY_TOKEN" quay.io
docker -build --no-cache -t "${IMAGE}:${IMAGE_TAG}" .
docker -push "${IMAGE}:${IMAGE_TAG}"
oc login --token=${OC_TOKEN} --server=https://api.c-rh-c-eph.8p0c.p1.openshiftapps.com:6443
VENV_DIR=~/bonfire_venv
mkdir -p $VENV_DIR
python3 -m venv $VENV_DIR
. $VENV_DIR/bin/activate
pip install crc-bonfire
pip install --upgrade crc-bonfire
appsFile:
host: gitlab
repo: insights-platform/cicd-common
path: bonfire_configs/ephemeral_apps.yaml
apps:
- name: swatch-producer-aws # BONFIRE_APP_NAME
components:
- name: swatch-producer-aws # BONFIRE_COMPONENT_NAME
host: local
repo: /home/lburnett/code/rhsm-subscriptions/demo
path: /deploy/clowdapp.yaml
- parameters:
REPLICAS: 1
swatch-producer-aws/IMAGE: quay.io/cloudservices/swatch-producer-aws
IMAGE=quay.io/lburnett/rhsm
IMAGE_TAG=quarkus_poc
BONFIRE_APP_NAME=swatch-producer-aws
BONFIRE_COMPONENT_NAME=swatch-producer-aws
NAMESPACE=$(bonfire namespace reserve -d 12h)
echo $NAMESPACE
bonfire deploy -n $NAMESPACE \
--no-remove-resources $BONFIRE_COMPONENT_NAME \
-p $BONFIRE_COMPONENT_NAME/IMAGE=$IMAGE \
-i $IMAGE=$IMAGE_TAG $BONFIRE_APP_NAME
#!/bin/bash
python3 -m venv .bonfire_venv
source .bonfire_venv/bin/activate
pip install --upgrade pip 'setuptools<58' wheel
pip install --upgrade 'crc-bonfire>=4.0.0'
export IMAGE_TAG=latest
bonfire deploy \
rhsm \
-i quay.io/cloudservices/rhsm-subscriptions=${IMAGE_TAG} \
-i quay.io/cloudservices/swatch-producer-aws=${IMAGE_TAG} \
-i quay.io/cloudservices/swatch-system-conduit=${IMAGE_TAG}
note: i have the namespace hardcoded here…replace with the namespace you reserved
oc port-forward $(oc -n ephemeral-itjulc get -o name pod | grep fruit) 8000
curl --request POST \
--url http://localhost:8000/api/swatch-producer-aws/internal/aws/billable_usage \
--header 'content-type: application/json' \
--data '{
"account_number": "string",
"billable_tally_snapshots": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"snapshot_date": "2022-02-16T15:44:16.793Z",
"product_id": "string",
"sla": "",
"usage": "Development/Test",
"granularity": "Daily",
"tally_measurements": [
{
"hardware_measurement_type": "string",
"metric_id": "Cores",
"value": 0
}
]
}
]
}'