GeezerVison is showing github.com — deploy scripts · obrienmeli/samplejavaapp@0f86b52
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboard +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | FROM tomcat |
2 | | -ADD target/addressbook.war /usr/local/tomcat/webapps |
| 2 | +ADD target/sampleapp.war /usr/local/tomcat/webapps |
3 | 3 | EXPOSE 8080 |
4 | 4 | CMD /usr/local/tomcat/bin/catalina.sh run |
Collapse file
Copy file name to clipboardExpand all lines: deploy/ansible.cfg +490Lines changed: 490 additions & 0 deletions Large diffs are not rendered by default.
Collapse file
Copy file name to clipboard +12Lines changed: 12 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +- hosts: "{{ env }}" |
| 2 | + become: yes |
| 3 | + tasks: |
| 4 | + - name: remove any previous app services |
| 5 | + shell: | |
| 6 | + if [ `docker service ls | grep -v NAME | grep mysvc | awk '{print $2}' | wc -l` -gt 0 ]; then |
| 7 | + docker service rm `docker service ls | grep -v NAME | grep mysvc | awk '{print $2}'` |
| 8 | + else |
| 9 | + echo "No Service found" |
| 10 | + fi |
| 11 | + - name: deploy app |
| 12 | + command: docker service create --name mysvc --replicas 4 -p 9080:8080 lerndevops/addressbook:{{ build }} |
Collapse file
Copy file name to clipboard +18Lines changed: 18 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +[qa] |
| 2 | +ip1 |
| 3 | +ip2 |
| 4 | + |
| 5 | +[prod] |
| 6 | +ip1 |
| 7 | +ip2 |
| 8 | + |
| 9 | +[qa:vars] |
| 10 | +ansible_user=devops |
| 11 | +ansible_ssh_pass=devops |
| 12 | +ansible_sudo_pass=devops |
| 13 | + |
| 14 | +[prod:vars] |
| 15 | +ansible_user=devops |
| 16 | +ansible_ssh_pass=devops |
| 17 | +ansible_sudo_pass=devops |
| 18 | + |
Collapse file
Copy file name to clipboard +36Lines changed: 36 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: addressbook |
| 5 | + labels: |
| 6 | + app: addressbookapp |
| 7 | +spec: |
| 8 | + replicas: 2 |
| 9 | + selector: |
| 10 | + matchLabels: |
| 11 | + app: addressbookapp |
| 12 | + template: |
| 13 | + metadata: |
| 14 | + labels: |
| 15 | + app: addressbookapp |
| 16 | + spec: |
| 17 | + containers: |
| 18 | + - name: addressbookapp |
| 19 | + image: lerndevops/addressbook |
| 20 | + ports: |
| 21 | + - containerPort: 8080 |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +kind: Service |
| 26 | +apiVersion: v1 |
| 27 | +metadata: |
| 28 | + name: addressbookapp-svc |
| 29 | +spec: |
| 30 | + type: NodePort |
| 31 | + selector: |
| 32 | + app: addressbookapp |
| 33 | + ports: |
| 34 | + - protocol: TCP |
| 35 | + port: 8080 |
| 36 | + nodePort: 30002 |
Collapse file
Copy file name to clipboard File renamed without changes.
Collapse file
Copy file name to clipboard File renamed without changes.
Collapse file
Copy file name to clipboard File renamed without changes.