From 2b74b6f9b62b724d8e55b01e4b8426bc80bb9bec Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Mon, 24 Jun 2019 15:56:10 -0400 Subject: [PATCH] add tooling for basic testing of notification webhooks --- Makefile | 3 +++ docs/notification_system.md | 8 ++++++++ tools/docker-notifications-override.yml | 11 +++++++++++ 3 files changed, 22 insertions(+) create mode 100644 tools/docker-notifications-override.yml diff --git a/Makefile b/Makefile index 652ff2f971..7b1b7ca017 100644 --- a/Makefile +++ b/Makefile @@ -583,6 +583,9 @@ docker-compose-credential-plugins: docker-auth echo -e "\033[0;31mTo generate a CyberArk Conjur API key: docker exec -it tools_conjur_1 conjurctl account create quick-start\033[0m" CURRENT_UID=$(shell id -u) TAG=$(COMPOSE_TAG) DEV_DOCKER_TAG_BASE=$(DEV_DOCKER_TAG_BASE) docker-compose -f tools/docker-compose.yml -f tools/docker-credential-plugins-override.yml up --no-recreate awx +docker-compose-notifications: docker-auth + CURRENT_UID=$(shell id -u) TAG=$(COMPOSE_TAG) DEV_DOCKER_TAG_BASE=$(DEV_DOCKER_TAG_BASE) docker-compose -f tools/docker-compose.yml -f tools/docker-notifications-override.yml up --no-recreate awx + docker-compose-test: docker-auth cd tools && CURRENT_UID=$(shell id -u) OS="$(shell docker info | grep 'Operating System')" TAG=$(COMPOSE_TAG) DEV_DOCKER_TAG_BASE=$(DEV_DOCKER_TAG_BASE) docker-compose run --rm --service-ports awx /bin/bash diff --git a/docs/notification_system.md b/docs/notification_system.md index 7ef17d2cef..40adb5c8af 100644 --- a/docs/notification_system.md +++ b/docs/notification_system.md @@ -218,6 +218,14 @@ https://gist.github.com/matburt/73bfbf85c2443f39d272 The link below shows how to define an endpoint and parse headers and json content. It doesn't show how to configure Flask for HTTPS, but is fairly straightforward: http://flask.pocoo.org/snippets/111/ +You can also link an httpbin service to the development environment for testing webhooks using: + +``` +make docker-compose-notifications +``` + +This will create an `httpbin` service reachable from the awx container at `http://httpbin/post`, `http://httpbin/put`, etc. Outside of the container, you can reach the service at `http://localhost:8204`. + ## Grafana diff --git a/tools/docker-notifications-override.yml b/tools/docker-notifications-override.yml new file mode 100644 index 0000000000..528ed7b353 --- /dev/null +++ b/tools/docker-notifications-override.yml @@ -0,0 +1,11 @@ +version: '2' +services: + # Primary Tower Development Container link + awx: + links: + - httpbin + httpbin: + image: kennethreitz/httpbin + container_name: tools_httpbin_1 + ports: + - '8204:80'