forked from doct15/tomcat-war-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
distelli-manifest.yml
50 lines (42 loc) · 1.85 KB
/
distelli-manifest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
fazilc/tomcat-war-docker:
Env:
# Set the below enviornment variables for your environment
- CATALINA_HOME: "/usr/local/tomcat"
# The port number below is only for reference. Set it to the port number of your tomcat server.
- PORT: "8080"
Build:
- echo "DD_USERNAME- $DISTELLI_DOCKER_USERNAME"
- echo "DD_EMAIL- $DISTELLI_DOCKER_EMAIL"
- echo "DD_ENDPOINT- $DISTELLI_DOCKER_ENDPOINT"
- echo "DD_PORTS- $DISTELLI_DOCKER_PORTS"
- mvn package
### Docker Build Commands ###
- docker login -u "$DISTELLI_DOCKER_USERNAME" -p "$DISTELLI_DOCKER_PW" -e "$DISTELLI_DOCKER_EMAIL" $DISTELLI_DOCKER_ENDPOINT
- docker build --quiet=false -t "$DISTELLI_DOCKER_REPO" $DISTELLI_DOCKER_PATH
- docker tag "$DISTELLI_DOCKER_REPO" "$DISTELLI_DOCKER_REPO:$DISTELLI_BUILDNUM"
- docker push "$DISTELLI_DOCKER_REPO:$DISTELLI_BUILDNUM"
### End Docker Build Commands ###
PkgInclude:
- './target/*.war'
PreInstall:
- echo "DD_USERNAME- $DISTELLI_DOCKER_USERNAME"
- echo "DD_EMAIL- $DISTELLI_DOCKER_EMAIL"
- echo "DD_ENDPOINT- $DISTELLI_DOCKER_ENDPOINT"
- echo "DD_PORTS- $DISTELLI_DOCKER_PORTS"
### Docker Pre Install Commands ###
- sudo docker login -u "$DISTELLI_DOCKER_USERNAME" -p "$DISTELLI_DOCKER_PW" $DISTELLI_DOCKER_ENDPOINT
### End Docker Pre Install Commands ###
PostInstall:
- publicip=$(curl -s ident.me)
#- echo "Public IP $publicip"
- echo ""
- 'echo "You can validate the install by pointing your browser at http://$publicip/SimpleTomcatWebApp"'
- echo ""
Exec:
### Docker Exec Commands ###
- cid=$(uuidgen)
- trap 'sudo docker stop $cid' SIGTERM
- sudo -E docker run --name=$cid $DISTELLI_DOCKER_ENVS --rm=true $DISTELLI_DOCKER_PORTS "$DISTELLI_DOCKER_REPO:$DISTELLI_BUILDNUM" &
- wait
- "true"
### End Docker Exec Commands ###