delete bin

This commit is contained in:
LiLi 2017-04-14 09:56:32 +08:00
parent 2c816e7d94
commit 7f409059fc
41 changed files with 1 additions and 562 deletions

2
.gitignore vendored
View File

@ -7,6 +7,6 @@ target/
.classpath
.settings/
*.log
*bin/
bin/
*target/

View File

@ -1,105 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>jenkins</artifactId>
<groupId>cn.guange.app</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jenkins-exec</artifactId>
<packaging>war</packaging>
<name>jenkins-exec</name>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer>
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer>
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer>
<mainClass>cn.guange.app.jenkins.App</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<address>0.0.0.0</address>
<port>9001</port>
<path>/</path>
<uriEncoding>UTF-8</uriEncoding>
<finalName>jenkins-exec</finalName>
<server>tomcat7</server>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>javax.mail</artifactId>
<groupId>com.sun.mail</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>hamcrest-core</artifactId>
<groupId>org.hamcrest</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>

View File

@ -1,178 +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>
<parent>
<groupId>cn.guange.app</groupId>
<artifactId>jenkins</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>jenkins-exec</artifactId>
<packaging>war</packaging>
<name>jenkins-exec</name>
<dependencies>
<dependency>
<groupId>cn.guange.app</groupId>
<artifactId>jenkins-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.20</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>cn.guange.app.jenkins.App</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<address>0.0.0.0</address>
<port>9001</port>
<path>/</path>
<uriEncoding>UTF-8</uriEncoding>
<finalName>jenkins-exec</finalName>
<server>tomcat7</server>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<context:annotation-config></context:annotation-config>
<context:component-scan base-package="com.educoder.jenkins.api"/>
<context:component-scan base-package="com.educoder.jenkins.settings"/>
<context:component-scan base-package="com.educoder.jenkins.controller"/>
<!--导入配置-->
<context:property-placeholder location="classpath:config.properties"/>
</beans>

View File

@ -1,16 +0,0 @@
# trustieUrl=http://www.trustie.net/callback
# trustieUrl=http://ucloudtest.trustie.net/shixuns/training_task_status
trustieUrl=http://192.168.0.238:8888/myshixuns/training_task_status
#jenkinsUrl
#jenkinsUrl=http://localhost:8080/
#jenkisUserName=admin
#jenkisPassWord=wang199637
jenkinsUrl=http://123.59.135.74:9999/jenkins
jenkisUserName=guange
jenkisPassWord=123456
#jenkinsUrl=http://192.168.0.238:9999
#jenkisUserName=guange
#jenkisPassWord=123456

View File

@ -1,22 +0,0 @@
if (nowStep == STEP) {
// 读取输入和预期输出
def in = readFile '/home/pdl/.jenkins/workspace/testCases/SHIXUNID_STEP_In'
def expectedOut = readFile '/home/pdl/.jenkins/workspace/testCases/SHIXUNID_STEP_Out'
// 编译程序
sh script: 'echo "$(javac FILEPATH 2>&1)" > compile_result.txt'
compileResult = readFile ('compile_result.txt')
// 如果编译错误
if (compileResult.trim() == '') {
postResultToBDWeb(compileResult: compileResult, out: '', in:in, expectedOut:expectedOut)
return ;
}
// 从in.txt读入程序运行输出重定向到out.txt
sh script: 'echo "$(java SOURCECLASSNAME < /home/pdl/.jenkins/workspace/testCases/SHIXUNID_STEP_In 2>&1)" > out.txt'
def out = readFile "out.txt"
// 由中间层判断结果之后发送给BDWeb
postResultToBDWeb(compileResult: compileResult, out: out, in:in, expectedOut:expectedOut)
}

View File

@ -1,20 +0,0 @@
node() {
git url: gitUrl
withDockerContainer(language) {
def nowStep = Integer.parseInt(step)
}
}
// 传送运行结果到BDWeb
def postResultToBDWeb(def arg){
def s = 'compileResult=' + arg.compileResult + '&out=' + arg.out +
'&in=' + arg.in + '&expectedOut=' + arg.expectedOut
def response = httpRequest acceptType: 'APPLICATION_JSON_UTF8', consoleLogResponseBody: true, contentType: 'APPLICATION_FORM',
httpMode: 'POST', requestBody: s, url: "http://123.59.135.74:9999/jenkins-exec/pipeline/call?taskId=${taskId}"
if (response.status==299){
error response.content
}
}

View File

@ -1,21 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<flow-definition plugin="workflow-job@2.10">
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
PARAMS_CONTENT
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
<org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
<triggers/>
</org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
</properties>
<definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="workflow-cps@2.26">
<script>PIPELINE_CONTENT</script>
<sandbox>false</sandbox>
</definition>
<triggers/>
</flow-definition>

View File

@ -1,11 +0,0 @@
### 设置###
log4j.rootLogger = debug,stdout
### 输出信息到控制抬 ###
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
#log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
log4j.appender.stdout.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} %m%n
log4j.logger.org.springframework=INFO

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!--指明 controller 所在包,并扫描其中的注解-->
<context:component-scan base-package="cn.guange.app.jenkins.controller"/>
<!-- 静态资源(js、image等)的访问 -->
<mvc:default-servlet-handler/>
<!-- 开启注解 -->
<mvc:annotation-driven/>
<bean class="springfox.documentation.swagger2.configuration.Swagger2DocumentationConfiguration" id="swagger2Config"/>
<mvc:resources location="classpath:/META-INF/resources/" mapping="swagger-ui.html"/>
<mvc:resources location="classpath:/META-INF/resources/webjars/" mapping="/webjars/**"/>
</beans>

View File

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<display-name>SpringMVCDemo Web Application</display-name>
<!-- Spring 上下文参数 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>mvc-dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>mvc-dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>

View File

@ -1 +0,0 @@
<meta http-equiv="refresh" content="0; url=/swagger-ui.html" />

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<context:annotation-config></context:annotation-config>
<context:component-scan base-package="com.educoder.jenkins.api"/>
<context:component-scan base-package="com.educoder.jenkins.settings"/>
<context:component-scan base-package="com.educoder.jenkins.controller"/>
<!--导入配置-->
<context:property-placeholder location="classpath:config.properties"/>
</beans>

View File

@ -1,18 +0,0 @@
# trustieUrl=http://www.trustie.net/callback
# trustieUrl=http://ucloudtest.trustie.net/shixuns/training_task_status
trustieUrl=http://192.168.0.238:8888/myshixuns/training_task_status
#jenkinsUrl
#jenkinsUrl=http://localhost:8080/
#jenkisUserName=admin
#jenkisPassWord=wang199637
#jenkinsUrl=http://106.75.33.219:30001
#jenkisUserName=root
#jenkisPassWord=root
jenkinsUrl=http://123.59.135.74:9999/jenkins
jenkisUserName=guange
jenkisPassWord=123456
#jenkinsUrl=http://106.75.78.183:8888
#jenkisUserName=root
#jenkisPassWord=root

View File

@ -1,21 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<flow-definition plugin="workflow-job@2.10">
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
PARAMS_CONTENT
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
<org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
<triggers/>
</org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
</properties>
<definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="workflow-cps@2.26">
<script>PIPELINE_CONTENT</script>
<sandbox>false</sandbox>
</definition>
<triggers/>
</flow-definition>

View File

@ -1,11 +0,0 @@
### 设置###
log4j.rootLogger = stdout
### 输出信息到控制抬 ###
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
#log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
log4j.appender.stdout.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} %m%n
log4j.logger.org.springframework=INFO

View File

@ -1,3 +0,0 @@
node(){
echo "helloworld"
}

View File

@ -1,26 +0,0 @@
import com.fasterxml.jackson.databind.*
import java.io.*
import java.text.SimpleDateFormat;
import java.util.Date;
node(){
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
println("jenkins start build time:" + df.format(new Date()) + " taskId:" + taskId);
Thread.sleep(10000);
executeCmd(commitType:'commitSuccess',
jsonTypeArg: '{"msg":"' + '1' + '", "outPut": "' + '1' + '"}')
println("jenkins build finished time:" + df.format(new Date()) + " taskId:" + taskId);
}
def executeCmd(def arg){
def s = 'commitType=' + arg.commitType + "&jsonTypeArg=" + arg.jsonTypeArg
println(s)
def response = httpRequest acceptType: 'APPLICATION_JSON_UTF8', consoleLogResponseBody: true, contentType: 'APPLICATION_FORM',
httpMode: 'POST', requestBody: s, url: "http://123.59.135.74:9999/jenkins-exec/pipeline/call?taskId=${taskId}"
if (response.status==299){
error response.content
}
}

View File

@ -1 +0,0 @@
WEB-INF/classes/config.properties

View File

@ -1 +0,0 @@
rsync --stats --exclude-from="`pwd`/sync_exclude.list" --rsh=ssh -P -r target/jenkins-exec-1.0-SNAPSHOT/ jenkins:/home/pdl/apache-tomcat-8.5.11/webapps/jenkins-exec/