push all files

This commit is contained in:
Suchita 2021-04-14 16:02:58 +05:30
parent 100e916e66
commit acdcc5b154
10 changed files with 81 additions and 0 deletions

29
ansible1.yml Normal file
View file

@ -0,0 +1,29 @@
---
- hosts: dev
become: True
tasks:
- name: Install python pip
yum:
name: python-pip
state: present
- name: Install docker
yum:
name: docker
state: present
- name: start docker
service:
name: docker
state: started
enabled: yes
- name: Install docker-py python module
pip:
name: docker-py
state: present
- name: Start the container
docker_container:
name: spring-boot-1
image: "suchita2007/spring-boot"
state: started
published_ports:
- 0.0.0.0:8091:8080

5
appspec.yml Normal file
View file

@ -0,0 +1,5 @@
version: 0.0
os: linux
files:
- source: ./spring-petclinic-2.4.2.jar
destination: /tmp

19
buildspec.yml Normal file
View file

@ -0,0 +1,19 @@
version: 0.2
phases:
install:
runtime-versions:
java: corretto8
build:
commands:
- echo Build started on `date`
- mvn test
post_build:
commands:
- echo Build completed on `date`
- mvn package
artifacts:
files:
- target/spring-petclinic-2.4.2.jar
- appspec.yml
discard-paths: yes

View file

@ -0,0 +1,13 @@
---
- hosts: web-servers
become: true
tasks:
- name: stop previous version docker
shell: docker stop suchita_demo
- name: remove stopped container
shell: docker rm -f suchita_demo
- name: remove docker images
shell: docker image rm -f suchita2007/suchita_demo
- name: create docker image
shell: docker run -d --name suchita_demo -p 8090:8080 suchita2007/suchita_demo

2
inventory.ansible Normal file
View file

@ -0,0 +1,2 @@
[dev]
172.31.49.240 ansible_user=ec2-user

View file

@ -0,0 +1,3 @@
#!/bin/bash
ln -s -f /target/spring-petclinic-2.4.2.jar /etc/init.d/cdk-app

View file

@ -0,0 +1,3 @@
#!/bin/bash
yum install -y java

3
scripts/start_server.sh Normal file
View file

@ -0,0 +1,3 @@
#!/bin/bash
service cdk-app start

4
scripts/stop_server.sh Normal file
View file

@ -0,0 +1,4 @@
#!/bin/bash
service cdk-app stop
exit 0

BIN
spring-petclinic.zip Normal file

Binary file not shown.