Commit f93b28ee authored by Jan Löwenstrom's avatar Jan Löwenstrom
Browse files

using environment variables for hostnames;

open browser with application after successful deployment;
parent 5b46d2e1
......@@ -4,7 +4,7 @@ Hochschule Bremerhaven - Coding Challenge
## Setup
* clone this repo `git clone https://git.ortgies.it/swe3-si2018/swe3-hscc.git`
* pull the HSCC-docker-image `docker pull jortgies/hsbcc-handler`
* (optional) pull the HSCC-docker-image `docker pull jortgies/hsbcc-handler`
* execute the startup script `./buildAndRun.sh`
* website will be hosted on port *:8080 => `localhost:8080/home.xhtml`
* hsbcc-handler will be started on *:3000
......@@ -44,6 +44,8 @@ Bootsfaces: JSF framework based on Bootstrap 3 and jQuery UI
* ``increase your rating by passing challenges``
#### Admin
* ``list all users``
* ``list all challenges``
* ``create challenges``
* ``update challenges``
* ``delete challenges``
......
......@@ -10,4 +10,7 @@ sleep 10
docker-compose up -d
echo "Waiting 20 seconds for WILDFLY to be ready..."
sleep 20
echo "Running application on localhost:8080/home.xhtml"
\ No newline at end of file
echo "Running application on localhost:8080/home.xhtml"
echo "Trying to open browser..."
sleep 3
open "http://localhost:8080/home.xhtml"
\ No newline at end of file
......@@ -17,6 +17,8 @@ services:
hsbcc-handler:
image: jortgies/hsbcc-handler
container_name: hsbcc-handler
environment:
WILDLFY_HOST: widlfly
ports:
- 3000:80
volumes:
......@@ -26,6 +28,9 @@ services:
context: ./
dockerfile: Dockerfile
container_name: hsbcc-wildfly
environment:
HSBCC_HOST: hsbcc-handler
DB_HOST: db
ports:
- 8080:8080
- 9990:9990
......
......@@ -53,7 +53,7 @@ public class CodeTransferService {
public CodeSubmitResponse sendCode(CodeSubmit codeSubmit) {
System.out.println("sendCode");
try {
String postUrl = "http://localhost:3000/run";
String postUrl = "http://" + System.getenv("HSBCC_HOST") + "/run";
HttpPost post = new HttpPost(postUrl);
StringEntity postingString = new StringEntity(objectMapper.writeValueAsString(codeSubmit));
System.out.println(objectMapper.writeValueAsString(codeSubmit));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment