Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Commit

Permalink
feat(quickstart): add support for env vars for Slack, Teams actions (d…
Browse files Browse the repository at this point in the history
  • Loading branch information
shirshanka authored and cccs-Dustin committed Feb 1, 2023
1 parent 3b06a16 commit 492792f
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
15 changes: 15 additions & 0 deletions docker/datahub-actions/env/docker.env
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,18 @@ KAFKA_PROPERTIES_SECURITY_PROTOCOL=PLAINTEXT
# KAFKA_PROPERTIES_SSL_KEYSTORE_PASSWORD=keystore_password
# KAFKA_PROPERTIES_SSL_KEY_PASSWORD=keystore_password
# KAFKA_PROPERTIES_SSL_TRUSTSTORE_PASSWORD=truststore_password

# The following env vars are meant to be passed through from the Host System
# to configure the Slack and Teams Actions
# _ENABLED flags need to be set to "true" case sensitive for the action to be enabled
DATAHUB_ACTIONS_SLACK_ENABLED
DATAHUB_ACTIONS_SLACK_DATAHUB_BASE_URL
DATAHUB_ACTIONS_SLACK_BOT_TOKEN
DATAHUB_ACTIONS_SLACK_SIGNING_SECRET
DATAHUB_ACTIONS_SLACK_CHANNEL
DATAHUB_ACTIONS_SLACK_SUPPRESS_SYSTEM_ACTIVITY

DATAHUB_ACTIONS_TEAMS_ENABLED
DATAHUB_ACTIONS_TEAMS_DATAHUB_BASE_URL
DATAHUB_ACTIONS_TEAMS_WEBHOOK_URL
DATAHUB_ACTIONS_TEAMS_SUPPRESS_SYSTEM_ACTIVITY
10 changes: 10 additions & 0 deletions docker/quickstart/docker-compose-without-neo4j.quickstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ services:
- DATAHUB_SYSTEM_CLIENT_ID=__datahub_system
- DATAHUB_SYSTEM_CLIENT_SECRET=JohnSnowKnowsNothing
- KAFKA_PROPERTIES_SECURITY_PROTOCOL=PLAINTEXT
- DATAHUB_ACTIONS_SLACK_ENABLED
- DATAHUB_ACTIONS_SLACK_DATAHUB_BASE_URL
- DATAHUB_ACTIONS_SLACK_BOT_TOKEN
- DATAHUB_ACTIONS_SLACK_SIGNING_SECRET
- DATAHUB_ACTIONS_SLACK_CHANNEL
- DATAHUB_ACTIONS_SLACK_SUPPRESS_SYSTEM_ACTIVITY
- DATAHUB_ACTIONS_TEAMS_ENABLED
- DATAHUB_ACTIONS_TEAMS_DATAHUB_BASE_URL
- DATAHUB_ACTIONS_TEAMS_WEBHOOK_URL
- DATAHUB_ACTIONS_TEAMS_SUPPRESS_SYSTEM_ACTIVITY
hostname: actions
image: acryldata/datahub-actions:${ACTIONS_VERSION:-head}
restart: on-failure:5
Expand Down
10 changes: 10 additions & 0 deletions docker/quickstart/docker-compose.quickstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ services:
- DATAHUB_SYSTEM_CLIENT_ID=__datahub_system
- DATAHUB_SYSTEM_CLIENT_SECRET=JohnSnowKnowsNothing
- KAFKA_PROPERTIES_SECURITY_PROTOCOL=PLAINTEXT
- DATAHUB_ACTIONS_SLACK_ENABLED
- DATAHUB_ACTIONS_SLACK_DATAHUB_BASE_URL
- DATAHUB_ACTIONS_SLACK_BOT_TOKEN
- DATAHUB_ACTIONS_SLACK_SIGNING_SECRET
- DATAHUB_ACTIONS_SLACK_CHANNEL
- DATAHUB_ACTIONS_SLACK_SUPPRESS_SYSTEM_ACTIVITY
- DATAHUB_ACTIONS_TEAMS_ENABLED
- DATAHUB_ACTIONS_TEAMS_DATAHUB_BASE_URL
- DATAHUB_ACTIONS_TEAMS_WEBHOOK_URL
- DATAHUB_ACTIONS_TEAMS_SUPPRESS_SYSTEM_ACTIVITY
hostname: actions
image: acryldata/datahub-actions:${ACTIONS_VERSION:-head}
restart: on-failure:5
Expand Down
11 changes: 7 additions & 4 deletions docker/quickstart/generate_docker_quickstart.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import os
from collections import OrderedDict
from collections.abc import Mapping

import click
import yaml
from collections.abc import Mapping
from dotenv import dotenv_values
from yaml import Loader
from collections import OrderedDict


# Generates a merged docker-compose file with env variables inlined.
# Usage: python3 docker_compose_cli_gen.py ../docker-compose.yml ../docker-compose.override.yml ../docker-compose-gen.yml
Expand Down Expand Up @@ -54,7 +54,10 @@ def modify_docker_config(base_path, docker_yaml_config):

# 5. Append to an "environment" block to YAML
for key, value in env_vars.items():
service["environment"].append(f"{key}={value}")
if value is not None:
service["environment"].append(f"{key}={value}")
else:
service["environment"].append(f"{key}")

# 6. Delete the "env_file" value
del service["env_file"]
Expand Down

0 comments on commit 492792f

Please sign in to comment.