diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/java-spring-boot-demo/.gitignore b/java-spring-boot-demo/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/java-spring-boot-demo/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/java-spring-boot-demo/Dockerfile b/java-spring-boot-demo/Dockerfile new file mode 100644 index 0000000..427e30e --- /dev/null +++ b/java-spring-boot-demo/Dockerfile @@ -0,0 +1,15 @@ +# +# Build stage +# +FROM docker.io/library/maven:3.9.2-eclipse-temurin-17 AS build +COPY src /home/app/src +COPY pom.xml /home/app +RUN mvn -f /home/app/pom.xml clean package + +# +# Package stage +# +FROM docker.io/library/eclipse-temurin:17-jre +COPY --from=build /home/app/target/demo-0.0.1-SNAPSHOT.jar /usr/local/lib/demo.jar +EXPOSE 8080 +ENTRYPOINT ["java","-jar","/usr/local/lib/demo.jar"] diff --git a/java-spring-boot-demo/pom.xml b/java-spring-boot-demo/pom.xml new file mode 100644 index 0000000..3b5524a --- /dev/null +++ b/java-spring-boot-demo/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.1.0 + + + com.example + demo + 0.0.1-SNAPSHOT + demo + Demo project for Spring Boot + + 17 + + + + org.springframework.boot + spring-boot-starter + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + diff --git a/java-spring-boot-demo/src/main/java/com/example/demo/DemoApplication.java b/java-spring-boot-demo/src/main/java/com/example/demo/DemoApplication.java new file mode 100644 index 0000000..094d95b --- /dev/null +++ b/java-spring-boot-demo/src/main/java/com/example/demo/DemoApplication.java @@ -0,0 +1,13 @@ +package com.example.demo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class DemoApplication { + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } + +} diff --git a/java-spring-boot-demo/src/main/resources/application.properties b/java-spring-boot-demo/src/main/resources/application.properties new file mode 100644 index 0000000..e69de29 diff --git a/java-spring-boot-demo/src/test/java/com/example/demo/DemoApplicationTests.java b/java-spring-boot-demo/src/test/java/com/example/demo/DemoApplicationTests.java new file mode 100644 index 0000000..eaa9969 --- /dev/null +++ b/java-spring-boot-demo/src/test/java/com/example/demo/DemoApplicationTests.java @@ -0,0 +1,13 @@ +package com.example.demo; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class DemoApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml new file mode 100644 index 0000000..a2eb777 --- /dev/null +++ b/zuul.d/jobs.yaml @@ -0,0 +1,48 @@ +- secret: + name: nebulous-opendev-quay.io + data: + quay.io: + username: nebulous+opendev + password: !encrypted/pkcs1-oaep + - GBkjBjEWyZXkCGKTaNF8e7A2SwGfOuLMHV27+GReJjgh2+shxVfYyXwhVW3ZhP2/ICl4Q + vHPKtkqEYUNsUMLkPTWA7VEljZoyKUIZjEBJO9VoMWt79VYC0oS6qzjVmuCblev2nPFQT + jJLvdhyXh/uNbVlQ4X8H2ha0+8a7ClBneW6jA0Wu77cuAYnQRmHhtD+Mob+pTrxzyta37 + wjA/97DMLqKd62M285LFdE1GGh2+PhfUuP//+wz7Ha3XJw1sMQziUWcEAWW7puUDpPI5b + Qpx3NCGInXH3utIpuFo76lTeN5OVAvjotqNWrngA2FRsNKUtH9DEqv5Prl0CuJRs9QEZm + PTJRwN/2LG97VtNCUdW4J5laNTCUR/cVIgTbh+YIvJWjAn4HqgUjS5SXBkR5nVA9pSlGJ + lu1y4WCuxieRdNBZfLcMJUSuLrbRY1De5c5cTcz6R64/2D+h2YTSdp4WzlzHvsEL97eZI + gNRhv3vOHKcWdWeVMXiaAjcBSuuXZGtcuH+pWte+cRYHjRIgjxlQMHAltgfA71JZI+xnh + SB6gmEwff5LL0fB1KULXBKhePnlC8xcr80hwubFzmAa4VcCQ+Fv/v6zbajUV9RfkAm26F + dp5S9xBoTTAlmcJ/cEz4Eq+URYe9jiU/PKYqEzLGhpKpGWzH86kpkWXJOzceCA= + +- job: + name: nebulous-component-template-build-container-images + parent: opendev-build-container-image + description: Build the container images. + vars: &image_vars + promote_container_image_method: intermediate-registry + promote_container_image_job: nebulous-component-template-upload-container-image + container_images: + - context: java-spring-boot-demo + registry: quay.io + repository: quay.io/nebulous/component-template-java-spring-boot-demo + +- job: + name: nebulous-component-template-upload-container-images + parent: opendev-upload-container-image + description: Build and upload the container images. + vars: *image_vars + secrets: + - name: container_registry_credentials + secret: nebulous-opendev-quay.io + pass-to-parent: true + +- job: + name: nebulous-component-template-promote-container-images + parent: opendev-promote-container-image + description: Promote previously uploaded container images. + vars: *image_vars + secrets: + - name: container_registry_credentials + secret: nebulous-opendev-quay.io + pass-to-parent: true diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml new file mode 100644 index 0000000..3c7cd10 --- /dev/null +++ b/zuul.d/project.yaml @@ -0,0 +1,10 @@ +- project: + check: + jobs: + - nebulous-component-template-build-container-images + gate: + jobs: + - nebulous-component-template-upload-container-images + promote: + jobs: + - nebulous-component-template-promote-container-images