├── .dockerignore
├── .gitignore
├── Dockerfile
├── README.md
├── pom.xml
└── src
└── main
├── java
└── com
│ └── zufarexplainedit
│ └── hello
│ ├── HelloApplication.java
│ └── HelloController.java
└── resources
└── application.yml
/.dockerignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
35 | ### Git ###
36 | .git/
37 | .gitignore
38 |
39 | ### Docker ###
40 | Dockerfile
41 | .dockerignore
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 | !**/src/main/**/target/
5 | !**/src/test/**/target/
6 |
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /nbbuild/
25 | /dist/
26 | /nbdist/
27 | /.nb-gradle/
28 | build/
29 | !**/src/main/**/build/
30 | !**/src/test/**/build/
31 |
32 | ### VS Code ###
33 | .vscode/
34 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | ARG HOME_APP=/opt/app
2 |
3 | FROM maven:3.8.3-openjdk-17 as maven_build
4 | ARG HOME_APP
5 | WORKDIR $HOME_APP
6 | ADD pom.xml .
7 | RUN mvn verify --fail-never
8 | ADD . .
9 | RUN mvn package
10 |
11 | FROM eclipse-temurin:17-jre-jammy
12 | ARG HOME_APP
13 | WORKDIR $HOME_APP
14 | COPY --from=maven_build $HOME_APP/target/hello-0.0.1-SNAPSHOT.jar .
15 | ENTRYPOINT ["java", "-jar", "hello-0.0.1-SNAPSHOT.jar" ]
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Sample app used in Zufar Sunagatov's article on DevOps CI/CD pipeline in HackerNoon
2 | * https://hackernoon.com/building-a-cicd-pipeline-with-aws-k8s-docker-ansible-git-github-apache-maven-and-jenkins
3 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 | 4.0.0
6 |
7 |
8 | org.springframework.boot
9 | spring-boot-starter-parent
10 | 2.5.4
11 |
12 |
13 |
14 | com.zufarexplainedit
15 | hello
16 | 0.0.1-SNAPSHOT
17 | Hello
18 | Hello
19 |
20 |
21 |
22 | Zufar Sunagatov
23 | Zufar Explaind IT
24 |
25 | Owner
26 | Developer
27 |
28 |
29 |
30 |
31 |
32 | 11
33 | 11
34 | 11
35 |
36 |
37 |
38 |
39 | org.springframework.boot
40 | spring-boot-starter-web
41 |
42 |
43 | org.springframework.boot
44 | spring-boot-starter-actuator
45 |
46 |
47 | io.micrometer
48 | micrometer-registry-prometheus
49 |
50 |
51 |
52 |
53 |
54 |
55 | org.springframework.boot
56 | spring-boot-maven-plugin
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/src/main/java/com/zufarexplainedit/hello/HelloApplication.java:
--------------------------------------------------------------------------------
1 | package com.zufarexplainedit.hello;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class HelloApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(HelloApplication.class, args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/com/zufarexplainedit/hello/HelloController.java:
--------------------------------------------------------------------------------
1 | package com.zufarexplainedit.hello;
2 |
3 | import org.springframework.http.ResponseEntity;
4 | import org.springframework.web.bind.annotation.GetMapping;
5 | import org.springframework.web.bind.annotation.RequestMapping;
6 | import org.springframework.web.bind.annotation.RestController;
7 |
8 | @RestController
9 | @RequestMapping
10 | public class HelloController {
11 |
12 | @GetMapping
13 | public ResponseEntity getGreeting() {
14 | String message = "Hello World!";
15 | return ResponseEntity.ok()
16 | .body(message);
17 | }
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8080
3 |
4 | management:
5 | endpoints:
6 | web:
7 | exposure:
8 | include: health,prometheus
9 | metrics:
10 | export:
11 | prometheus:
12 | enabled: true
13 | distribution:
14 | percentiles-histogram:
15 | "[http.server.requests]": true
--------------------------------------------------------------------------------