Skip to content

Add sending slack notification on deploy#75

Open
kdowolski-reef wants to merge 4 commits into
reef-technologies:masterfrom
kdowolski-reef:master
Open

Add sending slack notification on deploy#75
kdowolski-reef wants to merge 4 commits into
reef-technologies:masterfrom
kdowolski-reef:master

Conversation

@kdowolski-reef
Copy link
Copy Markdown

No description provided.


{% if cookiecutter.use_slack_notification %}
# Send slack notification about deploy
docker-compose run --rm app sh -c "python bin/notify.py"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how working with that template looks like in real but deploy-to-aws (which is called by github action) doesn't call deploy (or I don't see something). If so, the problem where to call it stands.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What solution do you suggest?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see two options.

  1. Run it here. Technically we have container built there so could run script. Currently we do not COPY bin directory to container but I guess it's not intended.
  2. Technically we could add it here but in case of restarting container we will get notifications.

Comment thread {{cookiecutter.repostory_name}}/.github/workflows/cd.yml Outdated
Comment thread cookiecutter.json
Comment thread {{cookiecutter.repostory_name}}/.github/workflows/cd.yml Outdated
Comment thread {{cookiecutter.repostory_name}}/bin/notify.py Outdated
Comment thread {{cookiecutter.repostory_name}}/bin/notify.py Outdated
Comment thread {{cookiecutter.repostory_name}}/bin/notify.py Outdated
Comment thread {{cookiecutter.repostory_name}}/bin/notify.py Outdated
Comment thread {{cookiecutter.repostory_name}}/bin/notify.py Outdated
Comment thread {{cookiecutter.repostory_name}}/bin/notify.py Outdated
Comment thread {{cookiecutter.repostory_name}}/bin/notify.py Outdated

{% if cookiecutter.use_slack_notification %}
# Send slack notification about deploy
docker-compose run --rm app sh -c "python bin/notify.py"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What solution do you suggest?

@kdowolski-reef kdowolski-reef force-pushed the master branch 7 times, most recently from f44ef61 to 3ff6493 Compare June 19, 2022 10:17
# Send slack notification about deploy
docker-compose run --rm app sh -c "python bin/notify.py"
output=`git log --format=format:%H,%s`
docker-compose run --rm app sh -c "python /root/src/bin/notify.py --parse -m \"$output\""
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately it allows for code injection with backticks, searching how to escape it properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants