Permalink
Browse files

Github issue tracker support beta implementation

  • Loading branch information...
0 parents commit bd3a38cb8890fcb24618ceb1ac58ad378b9fc19b Marcus Ilgner committed Jan 30, 2011
@@ -0,0 +1,5 @@
+.idea
+GithubProvider.iml
+out
+bin
+build.properties
13 LICENSE
@@ -0,0 +1,13 @@
+Copyright 2011 Marcus Ilgner <mail@marcusilgner.com>
+
+ Licensed 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.
12 README
@@ -0,0 +1,12 @@
+This is a plugin for TeamCity by Jetbrains to provide integration into the
+Github.com issue tracker.
+
+It uses the REST API to fetch information about issue tickets from a given
+repository so it can be displayed in TeamCity.
+
+To build it, first copy the provided build.properties.template to
+build.properties and adjust the variables according to your system settings.
+Depending on your setup, you may have to replace the provided scp deployment
+with something more specific for your needs.
+Otherwise you may just run `ant package` and manually copy the resulting
+github.zip to the plugins directory of your TeamCity installation.
@@ -0,0 +1,10 @@
+path.variable.maven_repository=/YOUR/HOME/DIRECTORY/.m2/repository
+path.variable.teamcitydistribution=/YOUR/PATH/TO/TeamCity
+jdk.home.1.6=/usr/lib/jvm/java-6-sun
+idea.home=/YOUR/PATH/TO/IDEA
+githubprovider.binaries.dir=bin
+
+deploy.host=YOUR_TEAMCITY_HOST
+deploy.dir=PATH_TO_PLUGINS_DIRECTORY
+deploy.user=SOME_USER_WITH_WRITE_PERMISSIONS
+deploy.keyfile=CORRESPONDING_SSH_KEY
228 build.xml
@@ -0,0 +1,228 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="githubprovider" default="all">
+
+
+ <property file="build.properties"/>
+ <!-- Uncomment the following property if no tests compilation is needed -->
+ <!--
+ <property name="skip.tests" value="true"/>
+ -->
+
+ <!-- Compiler options -->
+
+ <property name="compiler.debug" value="on"/>
+ <property name="compiler.generate.no.warnings" value="off"/>
+ <property name="compiler.args" value=""/>
+ <property name="compiler.max.memory" value="128m"/>
+ <patternset id="ignored.files">
+ <exclude name="**/CVS/**"/>
+ <exclude name="**/SCCS/**"/>
+ <exclude name="**/RCS/**"/>
+ <exclude name="**/rcs/**"/>
+ <exclude name="**/.DS_Store/**"/>
+ <exclude name="**/.svn/**"/>
+ <exclude name="**/.pyc/**"/>
+ <exclude name="**/.pyo/**"/>
+ <exclude name="**/*.pyc/**"/>
+ <exclude name="**/*.pyo/**"/>
+ <exclude name="**/.git/**"/>
+ <exclude name="**/*.hprof/**"/>
+ <exclude name="**/_svn/**"/>
+ <exclude name="**/.hg/**"/>
+ <exclude name="**/*.lib/**"/>
+ <exclude name="**/*~/**"/>
+ </patternset>
+ <patternset id="library.patterns">
+ <include name="*.zip"/>
+ <include name="*.war"/>
+ <include name="*.egg"/>
+ <include name="*.ear"/>
+ <include name="*.swc"/>
+ <include name="*.jar"/>
+ </patternset>
+ <patternset id="compiler.resources">
+ <include name="**/?*.properties"/>
+ <include name="**/?*.xml"/>
+ <include name="**/?*.jsp"/>
+ <include name="**/?*.gif"/>
+ <include name="**/?*.png"/>
+ <include name="**/?*.jpeg"/>
+ <include name="**/?*.jpg"/>
+ <include name="**/?*.html"/>
+ <include name="**/?*.dtd"/>
+ <include name="**/?*.tld"/>
+ <include name="**/?*.ftl"/>
+ </patternset>
+
+ <!-- JDK definitions -->
+
+ <property name="jdk.bin.1.6" value="${jdk.home.1.6}/bin"/>
+ <path id="jdk.classpath.1.6">
+ <fileset dir="${jdk.home.1.6}">
+ <include name="jre/lib/alt-rt.jar"/>
+ <include name="jre/lib/jce.jar"/>
+ <include name="jre/lib/rt.jar"/>
+ <include name="jre/lib/jsse.jar"/>
+ <include name="jre/lib/javaws.jar"/>
+ <include name="jre/lib/charsets.jar"/>
+ <include name="jre/lib/resources.jar"/>
+ <include name="jre/lib/plugin.jar"/>
+ <include name="jre/lib/management-agent.jar"/>
+ <include name="jre/lib/deploy.jar"/>
+ <include name="jre/lib/ext/sunjce_provider.jar"/>
+ <include name="jre/lib/ext/localedata.jar"/>
+ <include name="jre/lib/ext/dnsns.jar"/>
+ <include name="jre/lib/ext/sunpkcs11.jar"/>
+ </fileset>
+ </path>
+
+ <property name="project.jdk.home" value="${jdk.home.1.6}"/>
+ <property name="project.jdk.bin" value="${jdk.bin.1.6}"/>
+ <property name="project.jdk.classpath" value="jdk.classpath.1.6"/>
+
+
+ <!-- Project Libraries -->
+
+ <path id="library.teamcity_libraries.classpath">
+ <pathelement location="${path.variable.teamcitydistribution}/devPackage/common-api.jar"/>
+ <pathelement location="${path.variable.teamcitydistribution}/devPackage/server-api.jar"/>
+ <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/annotations.jar"/>
+ <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/commons-httpclient-3.1.jar"/>
+ <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/commons-logging.jar"/>
+ <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/jdom.jar"/>
+ <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/server.jar"/>
+ <pathelement location="${path.variable.teamcitydistribution}/webapps/ROOT/WEB-INF/lib/util.jar"/>
+ </path>
+ <!-- Register Custom Compiler Taskdefs -->
+ <property name="javac2.home" value="${idea.home}/lib"/>
+ <path id="javac2.classpath">
+ <pathelement location="${javac2.home}/javac2.jar"/>
+ <pathelement location="${javac2.home}/jdom.jar"/>
+ <pathelement location="${javac2.home}/asm.jar"/>
+ <pathelement location="${javac2.home}/asm-commons.jar"/>
+ <pathelement location="${javac2.home}/jgoodies-forms.jar"/>
+ </path>
+ <target name="register.custom.compilers">
+ <taskdef name="javac2" classname="com.intellij.ant.Javac2" classpathref="javac2.classpath"/>
+ <taskdef name="instrumentIdeaExtensions" classname="com.intellij.ant.InstrumentIdeaExtensions" classpathref="javac2.classpath"/>
+ </target>
+
+ <!-- Modules -->
+
+
+ <!-- Module RedmineProvider -->
+
+ <dirname property="module.githubprovider.basedir" file="${ant.file}"/>
+
+
+ <property name="module.jdk.home.githubprovider" value="${jdk.home.1.6}"/>
+ <property name="module.jdk.bin.githubprovider" value="${jdk.bin.1.6}"/>
+ <property name="module.jdk.classpath.githubprovider" value="jdk.classpath.1.6"/>
+
+ <property name="compiler.args.githubprovider" value="${compiler.args}"/>
+
+ <property name="githubprovider.output.dir" value="${module.githubprovider.basedir}/out/production/RedmineProvider"/>
+ <property name="githubprovider.testoutput.dir" value="${module.githubprovider.basedir}/out/test/RedmineProvider"/>
+
+ <path id="githubprovider.module.bootclasspath">
+ <!-- Paths to be included in compilation bootclasspath -->
+ </path>
+
+ <path id="githubprovider.module.production.classpath">
+ <path refid="${module.jdk.classpath.githubprovider}"/>
+ <path refid="library.teamcity_libraries.classpath"/>
+ </path>
+
+ <path id="githubprovider.runtime.production.module.classpath">
+ <pathelement location="${githubprovider.output.dir}"/>
+ <path refid="library.teamcity_libraries.classpath"/>
+ </path>
+
+ <path id="githubprovider.module.classpath">
+ <path refid="${module.jdk.classpath.githubprovider}"/>
+ <pathelement location="${githubprovider.output.dir}"/>
+ <path refid="library.teamcity_libraries.classpath"/>
+ </path>
+
+ <path id="githubprovider.runtime.module.classpath">
+ <pathelement location="${githubprovider.testoutput.dir}"/>
+ <pathelement location="${githubprovider.output.dir}"/>
+ <path refid="library.teamcity_libraries.classpath"/>
+ </path>
+
+
+ <patternset id="excluded.from.module.githubprovider">
+ <patternset refid="ignored.files"/>
+ </patternset>
+
+ <patternset id="excluded.from.compilation.githubprovider">
+ <patternset refid="excluded.from.module.githubprovider"/>
+ </patternset>
+
+ <path id="githubprovider.module.sourcepath">
+ <dirset dir="${module.githubprovider.basedir}">
+ <include name="src"/>
+ </dirset>
+ </path>
+
+
+ <target name="compile.module.githubprovider" depends="compile.module.githubprovider.production,compile.module.githubprovider.tests"
+ description="Compile module RedmineProvider"/>
+
+ <target name="compile.module.githubprovider.production" depends="register.custom.compilers"
+ description="Compile module RedmineProvider; production classes">
+ <mkdir dir="${githubprovider.output.dir}"/>
+ <javac2 destdir="${githubprovider.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}"
+ memorymaximumsize="${compiler.max.memory}" fork="true" executable="${module.jdk.bin.githubprovider}/javac">
+ <compilerarg line="${compiler.args.githubprovider}"/>
+ <bootclasspath refid="githubprovider.module.bootclasspath"/>
+ <classpath refid="githubprovider.module.production.classpath"/>
+ <src refid="githubprovider.module.sourcepath"/>
+ <patternset refid="excluded.from.compilation.githubprovider"/>
+ </javac2>
+
+ <copy todir="${githubprovider.output.dir}">
+ <fileset dir="${module.githubprovider.basedir}/src">
+ <patternset refid="compiler.resources"/>
+ <type type="file"/>
+ </fileset>
+ <fileset dir="${module.githubprovider.basedir}/resources/jar">
+ <patternset refid="compiler.resources"/>
+ <type type="file"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="compile.module.githubprovider.tests" depends="register.custom.compilers,compile.module.githubprovider.production"
+ description="compile module RedmineProvider; test classes" unless="skip.tests"/>
+
+ <target name="clean.module.githubprovider" description="cleanup module">
+ <delete dir="${githubprovider.output.dir}"/>
+ <delete dir="${githubprovider.testoutput.dir}"/>
+ <delete dir="${githubprovider.binaries.dir}"/>
+ </target>
+
+ <target name="package.module.githubprovider" depends="compile.module.githubprovider.production">
+ <mkdir dir="${githubprovider.binaries.dir}"/>
+ <mkdir dir="${githubprovider.binaries.dir}/zip"/>
+ <mkdir dir="${githubprovider.binaries.dir}/zip/server"/>
+ <jar basedir="${githubprovider.output.dir}" destfile="${githubprovider.binaries.dir}/zip/server/github.jar"/>
+ <copy todir="${githubprovider.binaries.dir}/zip" file="${module.githubprovider.basedir}/resources/zip/teamcity-plugin.xml"/>
+ <zip destfile="${githubprovider.binaries.dir}/github.zip" basedir="${githubprovider.binaries.dir}/zip"/>
+ <delete dir="${githubprovider.binaries.dir}/zip"/>
+ </target>
+
+ <target name="deploy" depends="package.module.githubprovider">
+ <scp localFile="${githubprovider.binaries.dir}/github.zip" todir="${deploy.user}@${deploy.host}:${deploy.dir}" keyfile="${deploy.keyfile}"/>
+ </target>
+ <target name="init" description="Build initialization">
+ <!-- Perform any build initialization in this target -->
+ </target>
+
+ <target name="clean" depends="clean.module.githubprovider" description="cleanup all"/>
+
+ <target name="build.modules" depends="init, clean, compile.module.githubprovider" description="build all modules"/>
+
+ <target name="all" depends="build.modules" description="build all"/>
+ <target name="package" depends="package.module.githubprovider" description="make ready for deployment"/>
+</project>
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans default-autowire="constructor">
+ <bean id="githubFetcher" class="com.marcusilgner.ghcity.GithubIssueFetcher">
+ <constructor-arg index="0" ref="ehCacheUtil"/>
+ </bean>
+ <bean id="githubFactory" class="com.marcusilgner.ghcity.GithubIssueProviderFactory">
+ <constructor-arg index="0" ref="githubFetcher"/>
+ </bean>
+</beans>
@@ -0,0 +1,52 @@
+<%@ include file="/include.jsp"%>
+<%@ taglib prefix="props" tagdir="/WEB-INF/tags/props" %>
+
+<%@ include file="/include.jsp"%>
+<%@ taglib prefix="props" tagdir="/WEB-INF/tags/props" %>
+
+<div>
+ <table class="editProviderTable">
+ <c:if test="${showType}">
+ <tr>
+ <th><label class="shortLabel">Connection Type:</label></th>
+ <td>Redmine</td>
+ </tr>
+ </c:if>
+ <tr>
+ <th><label for="name" class="shortLabel">Display Name: <l:star/></label></th>
+ <td>
+ <props:textProperty name="name" maxlength="100" style="width: 16em;"/>
+ <span id="error_name" class="error"></span>
+ </td>
+ </tr>
+ <tr>
+ <th><label for="repository" class="shortLabel">Repository: <l:star/></label></th>
+ <td>
+ <props:textProperty name="repository" maxlength="100" style="width: 16em;"/>
+ <span id="error_repository" class="error"></span>
+ </td>
+ </tr>
+ <tr>
+ <th><label for="username" class="shortLabel">Username:</label></th>
+ <td>
+ <props:textProperty name="username" maxlength="100" style="width: 16em;"/>
+ <span id="error_username" class="error"></span>
+ </td>
+ </tr>
+ <tr>
+ <th><label for="secure:password" class="shortLabel">Password:</label></th>
+ <td>
+ <props:passwordProperty name="secure:password" maxlength="100" style="width: 16em;"/>
+ <span id="error_secure:password" class="error"></span>
+ </td>
+ </tr>
+ <tr>
+ <th><label for="pattern" class="shortLabel">Ticket Pattern: <l:star/></label></th>
+ <td>
+ <props:textProperty name="pattern" maxlength="100" style="width: 16em;"/>
+ <span id="error_idPrefix" class="error"></span>
+ <span class="fieldExplanation">Use general regexp, e.g. #(\d+)<bs:help file="Issue+Tracker+Tab"/></span>
+ </td>
+ </tr>
+ </table>
+</div>
@@ -0,0 +1,17 @@
+<jsp:useBean id="issue" scope="request" type="jetbrains.buildServer.issueTracker.Issue"/>
+<script type='text/javascript'>
+ BS.LoadStyleSheetDynamicly(base_uri + "/plugins/github/style.css");
+</script>
+<div class="githubContainer">
+ <h3>${issue.summary}</h3>
+ <table cellspacing="0" cellpadding="3" >
+ <tbody><tr>
+ <td><b>Id:</b></td>
+ <td><a href="${issue.url}">${issue.id}</a></td>
+ </tr>
+ <tr>
+ <td><b>Status:</b></td>
+ <td>${issue.state}</td>
+ </tr>
+ </tbody></table>
+</div>
@@ -0,0 +1,24 @@
+div.githubContainer {
+ background-color: #f0f0f0;
+ font-family: Arial,sans-serif;
+}
+
+div.githubContainer td {
+ color: black;
+ font-size: 12px;
+ vertical-align: top;
+}
+
+div.githubContainer td a {
+ color: #003366;
+ font-weight: bold;
+}
+
+div.githubContainer h3 {
+ color: #003366;
+ font-size: 17px;
+ font-weight: bold;
+ margin: 0 0 2px;
+ border-bottom: 1px solid #3c78b5;
+}
+
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<teamcity-plugin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="urn:shemas-jetbrains-com:teamcity-plugin-v1-xml">
+ <info>
+ <name>github</name>
+ <display-name>Github issue tracker support</display-name>
+ <version>0.1</version>
+ <vendor>
+ <name>Marcus Ilgner</name>
+ <url>http://github.com/milgner/TeamCityGithub</url>
+ </vendor>
+ </info>
+</teamcity-plugin>
Oops, something went wrong.

0 comments on commit bd3a38c

Please sign in to comment.