Skip to content

Commit 5e22862

Browse files
authored
Create build_windows.sh
1 parent 5f11128 commit 5e22862

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

build_windows.sh

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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

0 commit comments

Comments
 (0)