commit b6a9a32c0bf7616e9c070d292d346f8c19e273e6 Author: Jessica Frazelle Date: Thu Sep 11 10:52:11 2014 -0700 init commit diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..5bd33ee --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "idonethis/src"] + path = idonethis/src + url = git@github.com:influitive/idonethis.git diff --git a/idonethis/.idonethisrc b/idonethis/.idonethisrc new file mode 100644 index 0000000..4711379 --- /dev/null +++ b/idonethis/.idonethisrc @@ -0,0 +1,2 @@ +--- +sender: GmailSender diff --git a/idonethis/Dockerfile b/idonethis/Dockerfile new file mode 100644 index 0000000..fd7ae4f --- /dev/null +++ b/idonethis/Dockerfile @@ -0,0 +1,15 @@ +FROM ruby:1.9.3-p547 +MAINTAINER Jessica Frazelle + +# update gems +RUN gem update --system +RUN gem update + +# install idonethis from git +COPY src/ /idonethis +RUN cd /idonethis; rake build; gem install /idonethis/pkg/idonethis-0.1.0.gem; + +COPY .idonethisrc / +COPY main.sh / + +ENTRYPOINT ["/main.sh"] \ No newline at end of file diff --git a/idonethis/main.sh b/idonethis/main.sh new file mode 100755 index 0000000..e4d36f2 --- /dev/null +++ b/idonethis/main.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# main entry point to run idonethis + +function checkvars() { + if [[ -z "${IDT_USERNAME}" ]]; then + echo "ERROR: The environment variable IDT_USERNAME is not set." + exit 1 + fi + + if [[ -z "${IDT_PASSWORD}" ]]; then + echo "ERROR: The environment variable IDT_PASSWORD is not set." + exit 1 + fi + + if [[ -z "${IDT_ADDRESS}" ]]; then + echo "ERROR: The environment variable IDT_ADDRESS is not set." + exit 1 + fi +} + +function main() { + checkvars + + cat <> /.idonethisrc +username: $IDT_USERNAME +password: $IDT_PASSWORD +idonethis_address: $IDT_ADDRESS +EOT +} + +main +echo "Sending message: '$@'" +idonethis "$@" \ No newline at end of file diff --git a/idonethis/src b/idonethis/src new file mode 160000 index 0000000..022072c --- /dev/null +++ b/idonethis/src @@ -0,0 +1 @@ +Subproject commit 022072cac6ded1d55bc30415022dd3bf8ad937fc