File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Author: Didier DONSEZ
4+ # License ASL 2.0
5+
6+ # Build script for the Wildfly container containing javaee7-angular simple web app and swagger UI
7+
8+ COMPONENT_VERSION=" 1.0"
9+ COMPONENT_NAME=" wildfly-app"
10+ COMPONENT_INSTANCE=1
11+ # DOCKERFILE=${COMPONENT_NAME}.df
12+ DOCKERFILE=Dockerfile
13+
14+ WORKDIR=$( pwd)
15+
16+ wait_for_host_port (){
17+ echo " Wait for $1 :$2 ..."
18+ until nc -vzw 2 $1 $2 & > /dev/null;
19+ do
20+ echo " Wait for $1 :$2 "
21+ sleep 1
22+ done
23+ echo " $1 :$2 ready"
24+ }
25+
26+ # Install Docker
27+ # TODO
28+
29+ # Install Java and Maven
30+ # TODO
31+
32+ # Get javaee7-angular
33+ mkdir tmp1
34+ cd tmp1
35+ git clone https://github.com/radcortez/javaee7-angular.git
36+ cd javaee7-angular
37+ mvn clean install
38+ cd ../..
39+
40+ # Get swagger-ui
41+ mkdir tmp2
42+ cd tmp2
43+ git clone https://github.com/swagger-api/swagger-ui.git
44+ cd swagger-ui
45+
46+ cd $WORKDIR
47+
48+ cp tmp1/javaee7-angular/target/javaee7-angular.war .
49+ mkdir swagger-ui
50+ cp -r tmp2/swagger-ui/dist/* swagger-ui/
51+
52+ docker pull jboss/wildfly
53+ docker build -t ${COMPONENT_NAME} -${COMPONENT_INSTANCE} :${COMPONENT_VERSION} -f $DOCKERFILE .
54+
55+ docker run --hostname ${COMPONENT_NAME} -${COMPONENT_INSTANCE} --name ${COMPONENT_NAME} -${COMPONENT_INSTANCE} -p 8080:8080 -p 9990:9990 -d ${COMPONENT_NAME} -${COMPONENT_INSTANCE} :${COMPONENT_VERSION}
56+
57+
58+ # Open URLs
59+ wait_for_host_port localhost 8080
60+ open http://localhost:8080/
61+
62+ open http://localhost:8080/javaee7-angular
63+
64+ # wait_for_host_port localhost 8443
65+ open https://localhost:8443/javaee7-angular
66+
67+ # wait_for_host_port localhost 9990
68+ open http://localhost:9990/management
You can’t perform that action at this time.
0 commit comments