mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 18:05:42 +03:00
Merge pull request #19 from hashicorp/test-resources
Added example python and java apps for testing
This commit is contained in:
4
client/driver/test-resources/docker/Dockerfile
Normal file
4
client/driver/test-resources/docker/Dockerfile
Normal file
@@ -0,0 +1,4 @@
|
||||
FROM python
|
||||
ADD main.py main.py
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
CMD ["python", "main.py"]
|
||||
17
client/driver/test-resources/docker/main.py
Normal file
17
client/driver/test-resources/docker/main.py
Normal 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")
|
||||
BIN
client/driver/test-resources/java/demoapp.jar
Normal file
BIN
client/driver/test-resources/java/demoapp.jar
Normal file
Binary file not shown.
12
client/driver/test-resources/java/demoapp.java
Normal file
12
client/driver/test-resources/java/demoapp.java
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user