Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch '10.0'

Conflicts:
	postbuild.sh
  • Loading branch information...
commit c224a5a8a01ecfbf7a62fba57f38f59029c782eb 2 parents f381d41 + 83965f6
@buckett buckett authored
View
17 common.sh
@@ -1,17 +0,0 @@
-# Setup common things for both the pre and post scripts.
-
-[ "$WORKSPACE" ] || WORKSPACE=`pwd`
-# We keep this outside the workspace so that if the workspace gets wiped out
-# we can still terminate the process
-export CATALINA_PID="/tmp/${JOB_NAME}-catalina.pid"
-export CATALINA_OPTS="-server -Xms256m -Xmx1024m -XX:NewSize=192m -XX:MaxNewSize=384m -XX:PermSize=192m -XX:MaxPermSize=384m -Djava.awt.headless=true -Dsun.net.inetaddr.ttl=0 -Dsun.lang.ClassLoader.allowArraySyntax=true"
-export CATALINA_HOME="$WORKSPACE/target/tomcat/"
-export JAVA_OPTS="$JAVA_OPTS -Dsolr.solr.home=$CATALINA_HOME/solr/"
-# This sets JAVA_HOME to something sensible
-export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:bin/javac::")
-
-# If we have a JMX Port set use that:
-if [ -n "$JMX_PORT" ] ; then
- export CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$JMX_PORT -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
-fi
-
View
84 pom.xml
@@ -1,84 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>uk.ac.ox.oucs.vle</groupId>
- <artifactId>sakai-run</artifactId>
- <packaging>pom</packaging>
- <version>1.0-SNAPSHOT</version>
- <name>Sakai Run</name>
- <url>http://maven.apache.org</url>
- <repositories>
- <repository>
- <id>thirdparty</id>
- <name>Maven Repo Third Party</name>
- <layout>default</layout>
- <url>http://maven-repo.oucs.ox.ac.uk/content/repositories/thirdparty</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
- <dependencies>
- <dependency>
- <groupId>apache.tomcat</groupId>
- <artifactId>tomcat</artifactId>
- <version>5.5.28</version>
- <scope>runtime</scope>
- <type>zip</type>
- </dependency>
- <dependency>
- <groupId>org.sakaiproject</groupId>
- <artifactId>pack-build</artifactId>
- <version>2.8-SNAPSHOT</version>
- <scope>runtime</scope>
- <type>zip</type>
- <classifier>tomcat-overlay</classifier>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-dependencies</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>unpack-dependencies</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.build.directory}/tomcat</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-resources</id>
- <!-- here the phase you need -->
- <phase>process-resources</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>${basedir}/target/tomcat</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/tomcat</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- <nonFilteredFileExtensions>
- <nonFilteredFileExtension>jar</nonFilteredFileExtension>
- <nonFilteredFileExtension>war</nonFilteredFileExtension>
- </nonFilteredFileExtensions>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
View
65 postbuild.sh
@@ -1,65 +0,0 @@
-#!/bin/bash
-# Script executed after the build
-
-. common.sh
-if [ -d $CATALINA_HOME ] ; then
- mkdir -p target/tomcat/sakai/
-
- # Grab config from svn
- svn export https://svn.oucs.ox.ac.uk/projects/vle/deployment/debian/sakai/config/trunk/sakai.properties target/tomcat/sakai/sakai.properties
- svn export https://svn.oucs.ox.ac.uk/projects/vle/sakai/config/trunk/local.properties target/tomcat/sakai/local.properties
- svn export https://svn.oucs.ox.ac.uk/projects/vle/sakai/config/trunk/log4j.properties target/tomcat/common/classes/log4j.properties
- svn export --force https://svn.oucs.ox.ac.uk/projects/vle/deployment/solr-config target/tomcat/solr
- sed -i "s/DB_NAME/${DB_NAME}/" target/tomcat/sakai/local.properties
- sed -i "s|SEARCH_SOLR_URL|${SEARCH_SOLR_URL}|" target/tomcat/sakai/local.properties
- sed -i "s/TURNITIN_AID/${TURNITIN_AID:-69293}/" target/tomcat/sakai/local.properties
- sed -i "s/TURNITIN_SECRET/${TURNITIN_SECRET:-OUCSsKey}/" target/tomcat/sakai/local.properties
- sed -i "s|TURNITIN_API_URL|${TURNITIN_API_URL:-'https://sandbox.turnitin.com/api.asp'}|" target/tomcat/sakai/local.properties
- sed -i "s|SENTRY_DSN|${SENTRY_DSN}|" target/tomcat/common/classes/log4j.properties
- sed -i "s|SES_SOLR_URL|${SES_SOLR_URL}|" target/tomcat/sakai/local.properties
-
- # Show the build version that we're running.
- echo version.service=$BUILD_TAG >> target/tomcat/sakai/local.properties
-
- # Copy any archived files back
- if [ -f /tmp/${BUILD_TAG}.tgz ]; then
- mkdir -p ${CATALINA_HOME}/sakai/files/
- tar -zxf /tmp/${BUILD_TAG}.tgz -C ${CATALINA_HOME}/sakai/files/
- # Clean up the file we copied to /tmp
- rm /tmp/${BUILD_TAG}.tgz
- fi
-
- # Remove existing tomcat webapps except solr
- find target/tomcat/webapps -type d -maxdepth 1 -mindepth 1 -not -name solr | xargs rm -rf
- # Fix the startup scripts
- chmod +x $CATALINA_HOME/bin/*.sh
-
- # Start tomcat (with or without debug mode enabled)
- # http://issues.hudson-ci.org/browse/HUDSON-2729
- if [ -z $JPDA_PORT ] ; then
- BUILD_ID=dontKillMe $CATALINA_HOME/bin/catalina.sh start
- else
- export JPDA_ADDRESS="127.0.0.1:${JPDA_PORT}"
- BUILD_ID=dontKillMe $CATALINA_HOME/bin/catalina.sh jpda start
- fi
-
- mkfifo target/log-fifo
- tail -f target/tomcat/logs/catalina.out | tee target/log-fifo &
- if grep -q "Server startup in " < target/log-fifo ; then
- echo Found startup message
- fi
- # If this happens too quickly then the background job won't be up and running yet.
- tail_pid=`jobs -p %1`
- echo $tail_pid
- kill $tail_pid
- wait $tail_pid
-
- sleep 5
-
- # See if we can connect
- curl -s -f -m 10 -o /dev/null http://localhost:${HTTPS_PORT}/portal/
- if [ $? -ne 0 ]; then
- echo "Can't connect to Tomcat" && exit 1
- fi
-
-fi
View
36 prebuild.sh
@@ -1,36 +0,0 @@
-#!/bin/bash
-# Script executed before the build
-
-. common.sh
-if [ -d $CATALINA_HOME -a -f $CATALINA_PID ] ; then
- chmod +x $CATALINA_HOME/bin/*.sh
- if $CATALINA_HOME/bin/catalina.sh stop -force ; then
- echo Tomcat stopped
- fi
-
- # See if we still have a pid associated with our AJP_PORT
- pid=$(netstat -telpW | grep ":${AJP_PORT}" | awk '{print $9;}' | sed 's@/.*@@')
- if [ -n "$pid" ]; then
- echo Killing Tomcat with PID of $pid
- kill -9 $pid
- fi
-
- # Current user needs access to the database
- # -s No boxing -N No column names
- if [ "${CONTENT_KEEP}" != "true" ]; then
- echo Cleaning database
- db=${DB_NAME}
- ( echo "SET foreign_key_checks = 0;"
- mysql $db -e 'show tables' -sN | while read table
- do
- echo "DROP TABLE $table;"
- done) | mysql $db
- else
- # Keep the sakai files.
- if [ -d ${CATALINA_HOME}/sakai/files/ ]; then
- echo Backing up uploaded content
- tar zcf /tmp/${BUILD_TAG}.tgz -C ${CATALINA_HOME}/sakai/files/ .
- fi
- fi
-
-fi
View
20 readme.txt
@@ -1,19 +1,5 @@
-This small project is to support automatically deployed copies of Sakai with jenkins.
+This is no longer used as we now have docker images that are used everywhere.
-The project should be added as a maven build as this allows upstream dependencies to automatically kickoff the build. The prebuild.sh should be run before the build is started and the postbuild.sh should be run after the build has complete.
+https://github.com/ox-it/wl-docker
-The deployed copy of Tomcat is designed to be run behind Apache so that WebAuth works.
-
-The build supports the following configuration parameter set through enviormental variables.
-
-SHUTDOWN_PORT - The port on which tomcat listens for shutdown commands.
-AJP_PORT - The port on which tomcat listens for AJP requests.
-HTTPS_PORT - The port on which HTTPS requests are handled.
-DB_NAME - The name of the MySQL database which should be used.
-JPDA_PORT - The port in which JDPA debugger is started.
-CONTENT_KEEP - If true then we don't clean the database and attempt to keep the uploaded files.
-SEARCH_SOLR_URL - Solr url to enable search with Solr
-TURNITIN_AID - Turnitin account
-TURNITIN_SECRET - Turnitin password
-TURNITIN_API_URL - Turnitin url
-SENTRY_DSN - URL used to send information to a sentry instance
+This is just here to point you to the new place.
View
57 src/main/tomcat/conf/server.xml
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<Server port="${env.SHUTDOWN_PORT}" shutdown="SHUTDOWN">
-
- <!-- Comment these entries out to disable JMX MBeans support used for the
- administration web application -->
- <Listener className="org.apache.catalina.core.AprLifecycleListener"/>
- <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
- <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
- <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
-
-
- <!-- A "Service" is a collection of one or more "Connectors" that share
- a single "Container" (and therefore the web applications visible
- within that Container). Normally, that Container is an "Engine",
- but this is not required.
-
- Note: A "Service" is not itself a "Container", so you may not
- define subcomponents such as "Valves" or "Loggers" at this level.
- -->
-
- <!-- Define the Tomcat Stand-Alone Service -->
- <Service name="Catalina">
-
- <!-- Define an AJP 1.3 Connector on port 8009 -->
- <Connector enableLookups="false" address="127.0.0.1" port="${env.AJP_PORT}" protocol="AJP/1.3" redirectPort="${env.HTTPS_PORT}" tomcatAuthentication="false"/>
-
- <!-- Define the top level container in our container hierarchy -->
- <Engine defaultHost="localhost" name="Catalina">
-
- <!-- Define the default virtual host
- Note: XML Schema validation will not work with Xerces 2.2.
- -->
- <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">
-
- </Host>
-
- </Engine>
-
- </Service>
-
-</Server>
View
BIN  src/main/tomcat/webapps/solr.war
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.