diff --git a/Jenkinsfile b/Jenkinsfile index ea3793b..63549a5 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,40 +1,36 @@ +#!groovy // Jenkinsfile (Pipeline Script) + +mavenConfiguration = [ + jdk: "jdk7", + maven: "m3.5", + mavenLocalRepo: ".repository", + mavenSettingsConfig: "639c4560-87b7-4502-bb3d-2c44845cd2b5" +] + node { - // Configure environment - //env.JAVA_HOME = tool name: 'JDK8' - env.REPO_URL = "repo.koc.se/zallery.git" - env.BUILD_NAME = "BUILD-" + env.BUILD_ID - - - checkout scm - - stage('Build') { - sh 'ant clean' - sh 'ant build' + stage('Checkout') { + checkout scm } - stage('Package') { - sh 'ant package' - archiveArtifacts artifacts: 'build/release/*', fingerprint: true + withMaven(mavenConfiguration) { + def mvnParams = "-Dbuild.number=${BUILD_NUMBER}" - // Tag artifact - withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'f8e5f6c6-4adb-4ab2-bb5d-1c8535dff491', - usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) { - sh "git tag ${env.BUILD_NAME}" - sh "git push 'https://${USERNAME}:${PASSWORD}@${env.REPO_URL}' ${env.BUILD_NAME}" + stage('Build') { + sh "mvn ${mvnParams} clean compile" + } + + stage('Test') { + sh "mvn ${mvnParams} test" + } + + stage('Package') { + sh "mvn ${mvnParams} -DskipStatic -DskipTests package" + } + + stage('Deploy') { + sh "mvn ${mvnParams} -DskipStatic -DskipTests deploy" + sh "mvn ${mvnParams} scm:tag" } } -} - -stage('Deploy') { - timeout(time:2, unit:'HOURS') { - input message: 'Deploy?', submitter: 'ziver' - } - node { - withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: '46f1d99b-2037-47b9-a7b7-57a1066337fc', - usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) { - sh 'ant -Dtomcat.user=${USERNAME} -Dtomcat.pass=${PASSWORD} deploy' - } - } -} - +} \ No newline at end of file diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml deleted file mode 100755 index 80de9b5..0000000 --- a/WebContent/WEB-INF/web.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - Zallery - - - - Zallery - zall.Zallery - 1 - - - Zallery - /gallery - /media - /slideshow - /login - /logout - /upload - /profile - /users - /register - - - - Content - zall.page.ContentServlet - - - Content - /content - - - - Ajax - zall.ZalleryAjax - - - Ajax - /ajax - - - - Upload - zall.UploadServlet - - TEMP_PATH - SYSTEM - - - ALLOWED_EXTENSIONS - png,jpg,jpeg,gif,tif,bmp,avi,wmv,mov,mp4,mpeg,flv,m4v,divx,xvid - - - - Upload - /uploadserv - - - - transcoder - zall.transcoder.ZalleryTranscoder - 1 - - - - gallery - - \ No newline at end of file diff --git a/WebContent/WEB-INF/web_debug.xml b/WebContent/WEB-INF/web_debug.xml deleted file mode 100644 index 0e3b9e3..0000000 --- a/WebContent/WEB-INF/web_debug.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - Zallery - - - gallery - - - - Zallery - zall.Zallery - - WEBSITE_NAME - Koc.se Gallery - - - WEBSITE_URL - http://koc.se/Zallery/ - - - SMTP_HOST - 192.168.0.10 - - - THEME - - - - DATA_PATH - C:\\Users\\Ziver\\Desktop\\Downloads\\temp\\album - - 1 - - - Zallery - /gallery - /media - /slideshow - /login - /logout - /upload - /profile - /users - /register - - - - Content - zall.page.ContentServlet - - - Content - /content - - - - Ajax - zall.ZalleryAjax - - - Ajax - /ajax - - - - Upload - zall.UploadServlet - - TEMP_PATH - C:\\Users\\Ziver\\Desktop\\Downloads\\temp\\ - - - ALLOWED_EXTENSIONS - png,jpg,jpeg,gif,tif,bmp,avi,wmv,mov,mp4,mpeg,flv,m4v,divx,xvid - - - - Upload - /uploadserv - - - - transcoder - zall.ZalleryTranscoder - 1 - - - - gallery - - \ No newline at end of file diff --git a/WebContent/WEB-INF/web_server.xml b/WebContent/WEB-INF/web_server.xml deleted file mode 100644 index 12a9fb9..0000000 --- a/WebContent/WEB-INF/web_server.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - Zallery - - - gallery - - - - Zallery - zall.Zallery - - WEBSITE_NAME - Koc.se Gallery - - - WEBSITE_URL - http://koc.se/Zallery/ - - - SMTP_HOST - 192.168.0.10 - - - THEME - - - - DATA_PATH - /home/tomcat/ZalleryData/ - - 1 - - - Zallery - /gallery - /media - /slideshow - /login - /logout - /upload - /profile - /users - /register - - - - Content - zall.page.ContentServlet - - - Content - /content - - - - Ajax - zall.ZalleryAjax - - - Ajax - /ajax - - - - Upload - zall.UploadServlet - - ALLOWED_EXTENSIONS - png,jpg,jpeg,gif,tif,bmp,avi,wmv,mov,mp4,mpeg,flv,m4v,divx,xvid - - - - Upload - /uploadserv - - - - transcoder - zall.ZalleryTranscoder - 1 - - - - gallery - - \ No newline at end of file diff --git a/WebContent/page_gallery.jsp b/WebContent/page_gallery.jsp index 9206f0f..4b28d1f 100755 --- a/WebContent/page_gallery.jsp +++ b/WebContent/page_gallery.jsp @@ -1,4 +1,4 @@ - + diff --git a/Zallery.iml b/Zallery.iml index 934e528..775bcac 100755 --- a/Zallery.iml +++ b/Zallery.iml @@ -11,7 +11,7 @@ - + @@ -55,7 +55,7 @@ - + diff --git a/pom.xml b/pom.xml index 0b3ba2e..8e138bc 100755 --- a/pom.xml +++ b/pom.xml @@ -6,23 +6,22 @@ se.koc zallery - 1.0.0-SNAPSHOT + 2.0.${build.number} war Zallery - - - 1.8 + 1.7 UTF-8 + SNAPSHOT se.koc zutil - 1.0.1 + 1.0.2-SNAPSHOT javax.mail @@ -71,9 +70,17 @@ WebContent + + org.apache.tomcat.maven + tomcat7-maven-plugin + 2.2 + + http://localhost:8080/manager/text + tomcat + + -