-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from hashicorp/test-resources
Added example python and java apps for testing
- Loading branch information
Showing
4 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM python | ||
ADD main.py main.py | ||
ENV PYTHONUNBUFFERED=1 | ||
CMD ["python", "main.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
} | ||
} | ||
} |