17 Commits

Author SHA1 Message Date
Nana Janashia
92602e6c79 Update pom.xml 2021-10-27 06:27:59 +00:00
Nana Janashia
bcff7b9713 Add simple UI 2021-07-12 12:40:04 +02:00
Nana Janashia
851ef30959 Update pom.xml 2021-03-24 14:38:33 +00:00
Nana Janashia
feda16a9a8 Delete freestyle-build.sh 2021-01-01 14:25:12 +00:00
Nana Janashia
0c2ab7794d Add new file 2021-01-01 14:23:51 +00:00
Nana Janashia
31209ff01c Update Jenkinsfile 2020-12-04 09:06:55 +00:00
Nana Janashia
fd26c2e81b Update Jenkinsfile 2020-12-03 15:41:22 +00:00
Nana Janashia
4e6c3e791d Update Jenkinsfile 2020-12-03 15:25:12 +00:00
Nana Janashia
b9c23ee70d Update Jenkinsfile 2020-12-03 15:24:37 +00:00
Nana Janashia
2f9fd78922 Update Jenkinsfile 2020-12-03 15:23:58 +00:00
Nana Janashia
7848de66a2 add patch version to maven version 2020-11-28 11:34:52 +01:00
Nana Janashia
007c036d2a fixed building jar file 2020-11-22 11:33:45 +01:00
Nana Janashia
3da4e695d0 Update Jenkinsfile 2020-11-08 15:23:44 +00:00
Nana Janashia
b7f48cdd4a Update Jenkinsfile 2020-11-08 15:22:06 +00:00
Nana Janashia
d7839d4033 Update Jenkinsfile 2020-11-07 16:28:59 +00:00
Nana Janashia
af78bcdf1e Add new file 2020-11-07 15:45:27 +00:00
Nana Janashia
5a4e789475 Update Jenkinsfile 2020-11-07 15:44:58 +00:00
5 changed files with 79 additions and 11 deletions

2
.gitignore vendored
View File

@@ -1,2 +1,2 @@
.idea/* .idea/*
target/ target

28
Jenkinsfile vendored
View File

@@ -1,28 +1,38 @@
#!/usr/bin/env groovy def gv
pipeline { pipeline {
agent any agent any
stages { stages {
stage('test') { stage("init") {
steps { steps {
script { script {
echo "Testing the application..." gv = load "script.groovy"
} }
} }
} }
stage('build') { stage("build jar") {
steps { steps {
script { script {
echo "Building the application..." echo "building jar"
//gv.buildJar()
} }
} }
} }
stage('deploy') { stage("build image") {
steps { steps {
script { script {
echo "Deploying the application..." echo "building image"
//gv.buildImage()
} }
} }
} }
} stage("deploy") {
} steps {
script {
echo "deploying"
//gv.deployApp()
}
}
}
}
}

30
pom.xml
View File

@@ -6,7 +6,35 @@
<groupId>com.example</groupId> <groupId>com.example</groupId>
<artifactId>java-maven-app</artifactId> <artifactId>java-maven-app</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.5.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- to handle any Java version mismatch, add the following configuration for maven-compiler-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies> <dependencies>
<dependency> <dependency>

19
script.groovy Normal file
View File

@@ -0,0 +1,19 @@
def buildJar() {
echo "building the application..."
sh 'mvn package'
}
def buildImage() {
echo "building the docker image..."
withCredentials([usernamePassword(credentialsId: 'docker-hub-repo', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
sh 'docker build -t nanajanashia/demo-app:jma-2.0 .'
sh "echo $PASS | docker login -u $USER --password-stdin"
sh 'docker push nanajanashia/demo-app:jma-2.0'
}
}
def deployApp() {
echo 'deploying the application...'
}
return this

View 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>