Merge pull request #19 from hashicorp/test-resources

Added example python and java apps for testing
This commit is contained in:
Chris Bednarski
2015-09-07 17:03:09 -07:00
4 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
FROM python
ADD main.py main.py
ENV PYTHONUNBUFFERED=1
CMD ["python", "main.py"]

View File

@@ -0,0 +1,17 @@
import signal
import time
# Setup handler for sigterm so we can exit when docker stop is called.
def term(signum, stack_Frame):
exit(1)
signal.signal(signal.SIGTERM, term)
print ("Starting")
max = 3
for i in range(max):
time.sleep(1)
print("Heartbeat {0}/{1}".format(i + 1, max))
print("Exiting")

Binary file not shown.

View File

@@ -0,0 +1,12 @@
public class Hello {
public static void main(String[] args) {
while (true) {
System.out.println("Hi");
try {
Thread.sleep(1000); //1000 milliseconds is one second.
} catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
}
}
}