Skip to content

Instantly share code, notes, and snippets.

@deardooley
Last active November 9, 2015 03:42
Show Gist options
  • Select an option

  • Save deardooley/722b445675b14d245a3f to your computer and use it in GitHub Desktop.

Select an option

Save deardooley/722b445675b14d245a3f to your computer and use it in GitHub Desktop.
Quick test image for abaco that will document the date locally and make a webhook callout to a URL passed as the message to get a timestamp externally.
#!/bin/bash
# making sure no actors are present
curl "docker.example.com:8000/actors"
# creating several actors for the test image
curl -X POST --data "image=deardooley/abaco_webhook_test&name=hook" "docker.example.com:8000/actors"
# check to make sure actors are ready to go
curl "docker.example.com:8000/actors"
REQUESTBIN_ID=$(curl -sk -XPOST http://requestbin.agaveapi.co/api/v1/bins | curl -s -X POST --globoff -H 'Content-Type:application/json' --data-binary @- "http://agaveapi.co/json-mirror?q=name&strip=true")
# send it some work
for i in {1..10};
do
curl -X POST --data "message=http://requestbin.agaveapi.co/$REQUESTBIN_ID?id=$i&src=abaco" "docker.example.com:8000/actors/hook_0/messages"
done
# verify the execution order using the external requestbin callbacks
curl -sk http://requestbin.agaveapi.co/api/v1/bins/16bxd9e1/requests | jq ".[].query_string.id"
FROM alpine:latest
ADD start.sh /docker_entrypoint.sh
RUN chmod +x /docker_entrypoint.sh
CMD ["sh", "/docker_entrypoint.sh"]
#!/bin/bash
date
wget "${MSG}&host=$HOSTNAME"
echo "Contents of MSG: "$MSG
sleep 2
echo "Environment:"
env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment