From 01a2d6c33a6deaff92a1071fa9b6cfff567cf1cd Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Sun, 17 May 2020 12:43:56 +0200 Subject: [PATCH] remove old packaging --- Dockerfile | 44 --- Jenkinsfile | 39 +-- scm-server/pom.xml | 264 ------------------ scm-server/src/main/assembly/README.txt | 13 - scm-server/src/main/assembly/WORKDIR.txt | 5 - .../src/main/assembly/scm-server-app.xml | 99 ------- scm-server/src/main/conf/server-config.xml | 197 ------------- scm-server/src/main/docroot/index.html | 35 --- scm-server/src/main/nativepkg/clear-cache | 9 - scm-server/src/main/nativepkg/create-user | 6 - scm-server/src/main/nativepkg/default | 51 ---- scm-server/src/main/nativepkg/init-script | 128 --------- scm-server/src/main/nativepkg/logging.xml | 93 ------ 13 files changed, 13 insertions(+), 970 deletions(-) delete mode 100644 Dockerfile delete mode 100644 scm-server/src/main/assembly/README.txt delete mode 100644 scm-server/src/main/assembly/WORKDIR.txt delete mode 100644 scm-server/src/main/assembly/scm-server-app.xml delete mode 100644 scm-server/src/main/conf/server-config.xml delete mode 100644 scm-server/src/main/docroot/index.html delete mode 100644 scm-server/src/main/nativepkg/clear-cache delete mode 100644 scm-server/src/main/nativepkg/create-user delete mode 100644 scm-server/src/main/nativepkg/default delete mode 100644 scm-server/src/main/nativepkg/init-script delete mode 100644 scm-server/src/main/nativepkg/logging.xml diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 14b083567e..0000000000 --- a/Dockerfile +++ /dev/null @@ -1,44 +0,0 @@ -# -# MIT License -# -# Copyright (c) 2020-present Cloudogu GmbH and Contributors -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# - -FROM openjdk:8u212-alpine3.9 - -ENV SCM_HOME=/var/lib/scm - -RUN set -x \ - && apk add --no-cache mercurial bash \ - && addgroup -S -g 1000 scm \ - && adduser -S -s /bin/false -G scm -h /opt/scm-server -D -H -u 1000 scm \ - && mkdir ${SCM_HOME} \ - && chown scm:scm ${SCM_HOME} - -ADD scm-server/target/scm-server-app.tar.gz /opt -RUN chown -R scm:scm /opt/scm-server - -WORKDIR /opt/scm-server -VOLUME [ "${SCM_HOME}", "/opt/scm-server/var/log" ] -EXPOSE 8080 -USER scm - -ENTRYPOINT [ "/opt/scm-server/bin/scm-server" ] diff --git a/Jenkinsfile b/Jenkinsfile index a612510c1b..49118db632 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -110,17 +110,14 @@ node('docker') { imageVersion = imageVersion.replace('-SNAPSHOT', "-${commitHash.substring(0,7)}-${BUILD_NUMBER}") } - stage('Archive') { - archiveArtifacts 'scm-webapp/target/scm-webapp.war' - archiveArtifacts 'scm-server/target/scm-server-app.*' - } - stage('Maven Deployment') { - // TODO why is the server recreated - // delete appassembler target, because the maven plugin fails to recreate the tar - sh "rm -rf scm-server/target/appassembler" + // configuration for docker deployment + mvn.useRepositoryCredentials([ + id: 'docker.io', + credentialsId: 'hub.docker.com-cesmarvin' + ]) - // deploy java artifacts + // configuration for maven deployment mvn.useDeploymentRepository([ id: 'packages-test.scm-manager.org', url: 'https://packages-test.scm-manager.org/nexus', @@ -150,24 +147,14 @@ node('docker') { } } - stage('Docker') { - docker.withRegistry('', 'hub.docker.com-cesmarvin') { - // push to cloudogu repository for internal usage - def image = docker.build('cloudogu/scm-manager') - image.push(imageVersion) - if (isReleaseBranch()) { - // push to official repository - image = docker.build('scmmanager/scm-manager') - image.push(imageVersion) - } - } - } - stage('Presentation Environment') { - build job: 'scm-manager/next-scm.cloudogu.com', propagate: false, wait: false, parameters: [ - string(name: 'changeset', value: commitHash), - string(name: 'imageTag', value: imageVersion) - ] + /** + * TODO does not match docker version (scm-packaging/docker) + * build job: 'scm-manager/next-scm.cloudogu.com', propagate: false, wait: false, parameters: [ + * string(name: 'changeset', value: commitHash), + * string(name: 'imageTag', value: imageVersion) + * ] + */ } if (isReleaseBranch()) { diff --git a/scm-server/pom.xml b/scm-server/pom.xml index 08fbe4dc39..5d44052667 100644 --- a/scm-server/pom.xml +++ b/scm-server/pom.xml @@ -68,272 +68,8 @@ - - - - - - sonia.maven - appassembler-maven-plugin - 1.2.2.0 - - - scm-app - package - - create-repository - generate-daemons - - - ${project.build.directory}/appassembler - ${exploded.directory} - lib - flat - - - - scm-server - ${commons.daemon.native.version} - sonia.scm.server.ScmServerDaemon - - commons-daemon - - - - - java.awt.headless=true - logback.configurationFile=logging.xml - ClassLoaderLeakPreventor.threadWaitMs=100 - - - - - - - commons-daemon - - - configuration.directory - conf - - - darwin.arch.enable - false - - - windows.service.dependencies - Tcpip - - - - - - - - - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - 2.4 - - - package - - copy - - - - - ${project.groupId} - scm-webapp - ${project.version} - war - ${exploded.directory}/var/webapp - scm-webapp.war - - - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - src/main/assembly/scm-server-app.xml - - - - - package - - single - - - - - - - - scm-server - - - - - nativepkg - - - - - - com.github.sdorra - nativepkg-maven-plugin - 1.1.4 - - - - deb - rpm - - - none - - - - ${project.name}-2 - true - all - ${maven.build.timestamp} -
devel
- Development/Tools - SCM-Manager - MIT - www.scm-manager.org - ${project.description} - Sebastian Sdorra <s.sdorra@gmail.com> - - noarch - linux - - - ${project.basedir}/src/main/nativepkg/create-user - ${project.basedir}/src/main/nativepkg/clear-cache - - - - - /opt/scm-server/bin/scm-server - ${exploded.directory}/bin/scm-server - 0744 - - - /opt/scm-server/conf/server-config.xml - ${project.basedir}/src/main/conf/server-config.xml - true - - - /opt/scm-server/conf/logging.xml - ${project.basedir}/src/main/nativepkg/logging.xml - true - - - /opt/scm-server/libexec/jsvc-linux-i686 - ${exploded.directory}/libexec/jsvc-linux-i686 - 0744 - - - /opt/scm-server/libexec/jsvc-linux-x86_64 - ${exploded.directory}/libexec/jsvc-linux-x86_64 - 0744 - - - /opt/scm-server/var/webapp/scm-webapp.war - ${exploded.directory}/var/webapp/scm-webapp.war - - - /opt/scm-server/var/webapp/docroot/index.html - ${basedir}/src/main/docroot/index.html - - - /etc/default/scm-server - ${project.basedir}/src/main/nativepkg/default - 0644 - true - - - /etc/init.d/scm-server - ${project.basedir}/src/main/nativepkg/init-script - 0755 - - - - - /opt/scm-server/var/log - /var/log/scm - - - /opt/scm-server/work - /var/cache/scm/work - - - - - /opt/scm-server/lib - ${exploded.directory}/lib - - - /var/cache/scm - scm - scm - 0700 - false - - - /var/cache/scm/work - scm - scm - 0700 - false - - - /var/log/scm - scm - scm - 0770 - false - - - /var/lib/scm - scm - scm - 0700 - false - - - -
-
- -
-
-
-
- 1.2.2 - 1.1.0 - ${project.build.directory}/appassembler/commons-daemon/scm-server diff --git a/scm-server/src/main/assembly/README.txt b/scm-server/src/main/assembly/README.txt deleted file mode 100644 index b21db9b168..0000000000 --- a/scm-server/src/main/assembly/README.txt +++ /dev/null @@ -1,13 +0,0 @@ -SCM-Manager Version ${project.version} -================================================================================ - -First Access: - - URL: http://localhost:8080 - Username: scmadmin - Password: scmadmin - -Further reading: - - Release notes: https://bitbucket.org/sdorra/scm-manager/wiki/release-notes - Getting started: https://bitbucket.org/sdorra/scm-manager/wiki/getting-started \ No newline at end of file diff --git a/scm-server/src/main/assembly/WORKDIR.txt b/scm-server/src/main/assembly/WORKDIR.txt deleted file mode 100644 index 9538e4852b..0000000000 --- a/scm-server/src/main/assembly/WORKDIR.txt +++ /dev/null @@ -1,5 +0,0 @@ -This directory is the temp directory for the SCM-Manager webapp. - -Further reading on jetty temp directories: - -- http://wiki.eclipse.org/Jetty/Reference/Temporary_Directories \ No newline at end of file diff --git a/scm-server/src/main/assembly/scm-server-app.xml b/scm-server/src/main/assembly/scm-server-app.xml deleted file mode 100644 index ad10964105..0000000000 --- a/scm-server/src/main/assembly/scm-server-app.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - app - - - zip - tar.gz - - - true - - - - - target/appassembler/commons-daemon/scm-server/bin - false - bin - 0755 - - - - target/appassembler/commons-daemon/scm-server - false - - - - - src/main/conf - false - conf - - - - src/main/docroot - false - var/webapp/docroot - - - - - - - - src/main/assembly/README.txt - README.txt - true - - - - - - ../scm-webapp/src/main/resources/logback.release.xml - conf - logging.xml - - - - - - src/main/assembly/WORKDIR.txt - work - - - - - \ No newline at end of file diff --git a/scm-server/src/main/conf/server-config.xml b/scm-server/src/main/conf/server-config.xml deleted file mode 100644 index 46ab3eb514..0000000000 --- a/scm-server/src/main/conf/server-config.xml +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - 16384 - 16384 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /scm - - /var/webapp/scm-webapp.war - - - org.eclipse.jetty.servlet.Default.dirAllowed - false - - - /work/scm - - - - - / - - - - - - /var/webapp/docroot - - - - - - /work/docroot - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/scm-server/src/main/docroot/index.html b/scm-server/src/main/docroot/index.html deleted file mode 100644 index a3bff3f8b3..0000000000 --- a/scm-server/src/main/docroot/index.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - SCM-Server - - - - - - diff --git a/scm-server/src/main/nativepkg/clear-cache b/scm-server/src/main/nativepkg/clear-cache deleted file mode 100644 index 01d7140357..0000000000 --- a/scm-server/src/main/nativepkg/clear-cache +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -# clear workdir after upgrade -# https://bitbucket.org/sdorra/scm-manager/issues/923/scmmanager-installed-from-debian-package - -WORKDIR="/var/cache/scm/work/webapp" -if [ -d "${WORKDIR}" ]; then - rm -rf "${WORKDIR}" -fi diff --git a/scm-server/src/main/nativepkg/create-user b/scm-server/src/main/nativepkg/create-user deleted file mode 100644 index 3ffe4972ce..0000000000 --- a/scm-server/src/main/nativepkg/create-user +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -getent group scm >/dev/null || groupadd -r scm -getent passwd scm >/dev/null || \ - useradd -r -g scm -M -s /sbin/nologin \ - -c "user for the scm-server process" scm -exit 0 diff --git a/scm-server/src/main/nativepkg/default b/scm-server/src/main/nativepkg/default deleted file mode 100644 index 228480ef55..0000000000 --- a/scm-server/src/main/nativepkg/default +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -# -# MIT License -# -# Copyright (c) 2020-present Cloudogu GmbH and Contributors -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# - -# scm-server host interface -HOST=0.0.0.0 - -# scm-server port -PORT=8080 - -# change user -USER=scm - -# home of scm-manager -export SCM_HOME=/var/lib/scm - -# force jvm path -# JAVA_HOME="/usr/lib/jvm/jre" - -# path to pid -PIDFILE=/var/run/scm.pid - -# path to log directory -LOGDIR=/var/log/scm - -# increase memory -# EXTRA_JVM_ARGUMENTS="$EXTRA_JVM_ARGUMENTS -Xms1g -Xmx1g" - -# pass extra jvm arguments -EXTRA_JVM_ARGUMENTS="$EXTRA_JVM_ARGUMENTS -Djetty.host=$HOST -Djetty.port=$PORT" diff --git a/scm-server/src/main/nativepkg/init-script b/scm-server/src/main/nativepkg/init-script deleted file mode 100644 index a765e5340b..0000000000 --- a/scm-server/src/main/nativepkg/init-script +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh - -# -# SCM-Server start script -# - -# -# MIT License -# -# Copyright (c) 2020-present Cloudogu GmbH and Contributors -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# - -# chkconfig: 35 35 65 -# description: SCM-Server -# -### BEGIN INIT INFO -# Provides: scm-server -# Required-Start: $local_fs $remote_fs $network $time $named -# Required-Stop: $local_fs $remote_fs $network $time $named -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Description: SCM-Server -### END INIT INFO - -# start script is based on the one posted from JavaNode to SCM-Manager mailing -# list: https://groups.google.com/d/msg/scmmanager/-wNjenUbl0Q/CkELJ6fLMHsJ - - -# Source function library. -if [ -x /etc/rc.d/init.d/functions ]; then -. /etc/rc.d/init.d/functions -fi - -# Check for and source configuration file otherwise set defaults -RETVAL=0 - -appname=ScmServerDaemon - -# See how we were called. -start() { - if [ $(ps aux | grep java | grep ${appname} | wc -l) = 0 ] - then - echo "SCM-Server will now be started" - /opt/scm-server/bin/scm-server start - else - echo "SCM-Server already running" - status - fi -} - -stop() { - if [ ! $(ps aux | grep java | grep ${appname} | wc -l) = 0 ] - then - echo "SCM-Server will now be stopped" - /opt/scm-server/bin/scm-server stop - else - echo "SCM-Server is not running" - fi -} - -status() { - if [ "$(ps auxwww | grep java | grep ${appname} | awk '{ print $1 " PID:" $2 }')" ]; then - echo "SCM-Server is running" - ps auxwww | grep java | grep ${appname} | awk '{ print " PID: " $2 }' - else - echo "SCM-Server is not running" - fi -} - -restart() { - stop - SECONDS=0 - STAT=$( ps auxwww | grep java | grep ${appname} | wc -l ) - while [ $STAT -ne 0 ] - do - echo -n . - sleep 3 - if [ $SECONDS -gt 300 ] - then - SCM_PID=$( ps auxwww | grep java | grep ${appname} | awk '{ print $2 }' ) - kill -9 $SCM_PID - fi - STAT=$( ps auxwww | grep java | grep ${appname} | wc -l ) - done - status - start - status -} - -# See how we were called. - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - status) - status - ;; - *) - echo "Usage: $0 {start|stop|restart}" - exit 1 -esac - -exit $RETVAL diff --git a/scm-server/src/main/nativepkg/logging.xml b/scm-server/src/main/nativepkg/logging.xml deleted file mode 100644 index b976fb5159..0000000000 --- a/scm-server/src/main/nativepkg/logging.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - /var/log/scm/scm-manager.log - - - /var/log/scm/scm-manager-%i.log - 1 - 10 - - - - 10MB - - - true - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n - - - - - - - - - - - - - - - - - - - - - - - - - - - -