Compare commits
2 Commits
jenkins-sh
...
feature/de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c53fe05e1 | ||
|
|
fab255d0da |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
.idea/*
|
.idea/*
|
||||||
|
target
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
FROM openjdk:8-jre-alpine
|
|
||||||
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
COPY ./target/java-maven-app-1.0-SNAPSHOT.jar /usr/app/
|
|
||||||
WORKDIR /usr/app
|
|
||||||
|
|
||||||
ENTRYPOINT ["java", "-jar", "java-maven-app-1.0-SNAPSHOT.jar"]
|
|
||||||
50
Jenkinsfile
vendored
50
Jenkinsfile
vendored
@@ -1,50 +0,0 @@
|
|||||||
#!/usr/bin/env groovy
|
|
||||||
|
|
||||||
library identifier: 'jenkins-shared-library@master', retriever: modernSCM(
|
|
||||||
[$class: 'GitSCMSource',
|
|
||||||
remote: 'https://gitlab.com/nanuchi/jenkins-shared-library.git',
|
|
||||||
credentialsId: 'gitlab-credentials'
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def gv
|
|
||||||
|
|
||||||
pipeline {
|
|
||||||
agent any
|
|
||||||
tools {
|
|
||||||
maven 'Maven'
|
|
||||||
}
|
|
||||||
stages {
|
|
||||||
stage("init") {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
gv = load "script.groovy"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage("build jar") {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
buildJar()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage("build and push image") {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
buildImage 'nanajanashia/demo-app:jma-3.0'
|
|
||||||
dockerLogin()
|
|
||||||
dockerPush 'nanajanashia/demo-app:jma-3.0'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage("deploy") {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
gv.deployApp()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
26
pom.xml
26
pom.xml
@@ -8,6 +8,32 @@
|
|||||||
<artifactId>java-maven-app</artifactId>
|
<artifactId>java-maven-app</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<version>2.8.2</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<distributionManagement>
|
||||||
|
<snapshotRepository>
|
||||||
|
<id>nexus-snapshots</id>
|
||||||
|
<url>http://167.99.248.163:8081/repository/maven-snapshots/</url>
|
||||||
|
</snapshotRepository>
|
||||||
|
</distributionManagement>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
def deployApp() {
|
|
||||||
echo 'deploying the application...'
|
|
||||||
}
|
|
||||||
|
|
||||||
return this
|
|
||||||
11
src/main/resources/static/index.html
Normal file
11
src/main/resources/static/index.html
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>MyApp</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Welcome to Java Maven Application</h1>
|
||||||
|
<!-- add image here <img src="" width="" /> -->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user