forked from as3s/tomcat-sample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.yml
38 lines (34 loc) · 999 Bytes
/
main.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
---
- name: "Deploy tomcat server with sample app"
hosts: host1
connection: local
tasks:
- name: "Check if app is already running"
script: /usr/local/bin/pytest
register: test_result
ignore_errors: true
- name: "Build - Run - Test container"
block:
- name: "Build Docker image from Dockerfile"
docker_image:
name: sample
build:
path: docker
pull: yes
source: build
state: present
#such line
- name: "Running the container"
docker_container:
name: sample
image: sample:latest
ports:
- "8080:8080"
state: started
- name: "Wait few seconds till application is up"
command: sleep 5
- name: "Make sure app is running"
script: /usr/local/bin/pytest
when: test_result is failed
#this is comment that I want to add
#this is my second comment