Skip to content

Commit

Permalink
feat(quickstart): add support for passing thru env vars needed by Sla…
Browse files Browse the repository at this point in the history
…ck, Teams actions
  • Loading branch information
shirshanka committed Dec 1, 2022
1 parent 5937b35 commit 76ef3a5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
16 changes: 16 additions & 0 deletions docker/datahub-actions/env/docker.env
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,19 @@ 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
<<<<<<< HEAD
=======

# 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_BOT_TOKEN
DATAHUB_ACTIONS_SLACK_SIGNING_SECRET
DATAHUB_ACTIONS_SLACK_CHANNEL
DATAHUB_ACTIONS_SLACK_SUPPRESS_SYSTEM_ACTIVITY

DATAHUB_ACTIONS_TEAMS_ENABLED
DATAHUB_ACTIONS_TEAMS_WEBHOOK_URL
DATAHUB_ACTIONS_TEAMS_SUPPRESS_SYSTEM_ACTIVITY
>>>>>>> 7ff370ff36 (feat(quickstart): add support for passing thru env vars needed by Slack, Teams actions)
8 changes: 8 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,14 @@ services:
- DATAHUB_SYSTEM_CLIENT_ID=__datahub_system
- DATAHUB_SYSTEM_CLIENT_SECRET=JohnSnowKnowsNothing
- KAFKA_PROPERTIES_SECURITY_PROTOCOL=PLAINTEXT
- DATAHUB_ACTIONS_SLACK_ENABLED
- 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_WEBHOOK_URL
- DATAHUB_ACTIONS_TEAMS_SUPPRESS_SYSTEM_ACTIVITY
hostname: actions
image: acryldata/datahub-actions:${ACTIONS_VERSION:-head}
restart: on-failure:5
Expand Down
8 changes: 8 additions & 0 deletions docker/quickstart/docker-compose.quickstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ services:
- DATAHUB_SYSTEM_CLIENT_ID=__datahub_system
- DATAHUB_SYSTEM_CLIENT_SECRET=JohnSnowKnowsNothing
- KAFKA_PROPERTIES_SECURITY_PROTOCOL=PLAINTEXT
- DATAHUB_ACTIONS_SLACK_ENABLED
- 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_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 76ef3a5

Please sign in to comment.