replace periods with underscores in version info w/ burnettk
This commit is contained in:
parent
48ef9caeeb
commit
f14a8d17f8
|
@ -64,11 +64,9 @@ jobs:
|
||||||
type=ref,event=branch,suffix=-latest
|
type=ref,event=branch,suffix=-latest
|
||||||
type=ref,event=branch,suffix=-${{ steps.date.outputs.date }}
|
type=ref,event=branch,suffix=-${{ steps.date.outputs.date }}
|
||||||
|
|
||||||
- name: Write app verison info
|
- name: Write app version info
|
||||||
working-directory: spiffworkflow-frontend
|
working-directory: spiffworkflow-frontend
|
||||||
run: |
|
run: echo $DOCKER_METADATA_OUTPUT_JSON | jq '.labels' > app_version.json
|
||||||
touch app_version.json
|
|
||||||
echo '${{ steps.meta.outputs.labels }}' > app_version.json
|
|
||||||
- name: Build and push Frontend Docker image
|
- name: Build and push Frontend Docker image
|
||||||
uses: docker/build-push-action@v4.0.0
|
uses: docker/build-push-action@v4.0.0
|
||||||
with:
|
with:
|
||||||
|
@ -110,11 +108,9 @@ jobs:
|
||||||
type=ref,event=branch,suffix=-latest
|
type=ref,event=branch,suffix=-latest
|
||||||
type=ref,event=branch,suffix=-${{ steps.date.outputs.date }}
|
type=ref,event=branch,suffix=-${{ steps.date.outputs.date }}
|
||||||
|
|
||||||
- name: Write app verison info
|
- name: Write app version info
|
||||||
working-directory: spiffworkflow-backend
|
working-directory: spiffworkflow-backend
|
||||||
run: |
|
run: echo $DOCKER_METADATA_OUTPUT_JSON | jq '.labels' > app_version.json
|
||||||
touch app_version.json
|
|
||||||
echo $DOCKER_METADATA_OUTPUT_JSON | jq '.labels' > app_version.json
|
|
||||||
- name: Build and push Backend Docker image
|
- name: Build and push Backend Docker image
|
||||||
uses: docker/build-push-action@v4.0.0
|
uses: docker/build-push-action@v4.0.0
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -188,11 +188,13 @@ def create_app() -> flask.app.Flask:
|
||||||
def _setup_prometheus_metrics(app: flask.app.Flask, connexion_app: connexion.apps.flask_app.FlaskApp) -> None:
|
def _setup_prometheus_metrics(app: flask.app.Flask, connexion_app: connexion.apps.flask_app.FlaskApp) -> None:
|
||||||
metrics = ConnexionPrometheusMetrics(connexion_app)
|
metrics = ConnexionPrometheusMetrics(connexion_app)
|
||||||
app.config["PROMETHEUS_METRICS"] = metrics
|
app.config["PROMETHEUS_METRICS"] = metrics
|
||||||
app_version_data = {}
|
|
||||||
if os.path.isfile("app_version.json"):
|
if os.path.isfile("app_version.json"):
|
||||||
|
app_version_data = {}
|
||||||
with open("app_version.json", 'r') as f:
|
with open("app_version.json", 'r') as f:
|
||||||
app_version_data = json.load(f)
|
app_version_data = json.load(f)
|
||||||
metrics.info('app_version_info', 'Application Version Info', **app_version_data)
|
# prometheus does not allow periods in key names
|
||||||
|
app_version_data_normalized = {k.replace('.', '_') : v for k, v in app_version_data.items()}
|
||||||
|
metrics.info('app_version_info', 'Application Version Info', **app_version_data_normalized)
|
||||||
|
|
||||||
|
|
||||||
def get_hacked_up_app_for_script() -> flask.app.Flask:
|
def get_hacked_up_app_for_script() -> flask.app.Flask:
|
||||||
|
|
Loading…
Reference in New Issue