Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

corda/crash.shell is not obtainable from jitpack.io #23

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c230ba6
Set version to 1.2.7-SNAPSHOT
vietj Aug 12, 2013
f42a317
Display the prompt message before waiting for input
thomasdelhomenie May 29, 2013
2ab1608
CRASH-139 : Capital letters not allowed for Option value
vietj Aug 12, 2013
5c65cc5
Make close properly work in a pipe
vietj Jun 7, 2013
431e91c
Remove garbage files
vietj Jul 9, 2013
c0e4b66
CRASH-138: -h switch does not work for pipe commands
vietj Jul 11, 2013
253c23d
Minor pom cleanup
vietj Jul 11, 2013
c80e91f
[maven-release-plugin] prepare release 1.2.7
vietj Aug 12, 2013
7d0d131
[maven-release-plugin] prepare for next development iteration
vietj Aug 12, 2013
5422c8c
CRASH-147 : Fix freezing dashboard or thread top
vietj Sep 7, 2013
a935bfa
CRASH-151 : Groovyshell permgen leak
vietj Oct 11, 2013
c20e888
Remove izpack profile
vietj Oct 14, 2013
63ea197
[maven-release-plugin] prepare release 1.2.8
vietj Oct 14, 2013
d1328f4
[maven-release-plugin] prepare for next development iteration
vietj Oct 14, 2013
a78f433
SSH: Fix usage of ssh.keypath for hostkey
Nov 1, 2013
269f879
Instructions for running the CRaSH shell inside Eclipse
NKame Nov 6, 2013
6064229
CRASH-156 : SSH: Fix usage of ssh.keypath for hostkey
vietj Nov 6, 2013
444d9a1
Merge remote-tracking branch 'nkname/patch-1' into 1.2.x
vietj Nov 6, 2013
5a5e301
Add exit status to ERROR when the shell process finishes with a respo…
gdepourtales Jan 9, 2014
ba81e75
CRASH-164 : Add exit status to ERROR when the shell process finishes …
vietj Jan 13, 2014
8daec6c
CRASH-166 : Multiline term input
vietj Aug 12, 2013
c15e9bb
CRASH-167 : Fix jdbc command issue with latest JDBC
vietj Nov 6, 2013
395f1b5
Added crash.ssh.idle-timeout property to set custom idle timeout of t…
gdepourtales Mar 27, 2014
3b36bb0
crash.ssh.idle-timeout and crash.ssh.auth-timeout optional
gdepourtales Mar 27, 2014
e0023b4
CRASH-183 : SSH timeout configuration
vietj Mar 29, 2014
a99acf7
CRASH-155 : cmd not scanned on windows platform in standalonemode
vietj Mar 29, 2014
b8687ec
Added documentation for SSH server timeout parameters
gdepourtales Mar 29, 2014
7c07aff
Update release plugin to 2.5
vietj Mar 30, 2014
24fb091
[maven-release-plugin] prepare release 1.2.9
vietj Mar 30, 2014
38a4aa8
[maven-release-plugin] prepare for next development iteration
vietj Mar 30, 2014
49751ca
CRASH-205: Provide a zip distribution
vietj Jun 3, 2014
533bf69
[maven-release-plugin] prepare release 1.2.10
vietj Jun 3, 2014
10ac07a
[maven-release-plugin] prepare for next development iteration
vietj Jun 3, 2014
c2d7593
CRASH-208: Provide dedicated "gvm" zip that contains only the standal…
vietj Jun 4, 2014
31a28d2
[maven-release-plugin] prepare release 1.2.11
vietj Jun 4, 2014
d37888f
[maven-release-plugin] prepare for next development iteration
vietj Jun 4, 2014
27a1180
Fix gvm generated file
vietj Jun 8, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
<parent>
<artifactId>crsh.parent</artifactId>
<groupId>org.crsh</groupId>
<version>1.2.6</version>
<version>1.2.12-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.crsh</groupId>
<artifactId>crsh.cli</artifactId>
<packaging>jar</packaging>
<version>1.2.6</version>
<version>1.2.12-SNAPSHOT</version>

<name>CRaSH CLI</name>
<description>The CRaSH command line interface module</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public class OptionDescriptor extends ParameterDescriptor {
static {
for (char c = 'a';c <= 'z';c++) {
A.set(c);
A.set(c + 'A' - 'a');
}
B.or(A);
B.set('-');
Expand Down
11 changes: 11 additions & 0 deletions cli/src/test/java/org/crsh/cli/impl/CommandInfoTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ class A {
assertEquals(Arrays.asList("i"),i.getNames());
}

public void testOptionWithUpperCase() throws IntrospectionException {
class A {
@Option(names = "I")
private int i;
}
CommandDescriptor<A> ai = CommandFactory.DEFAULT.create(A.class);
assertEquals(1,ai.getOptions().size());
OptionDescriptor i = ai.getOption("-I");
assertEquals(Arrays.asList("I"),i.getNames());
}

public void testArgument1() throws IntrospectionException {
class A {
@Argument()
Expand Down
4 changes: 0 additions & 4 deletions distrib/META-INF/MANIFEST.MF

This file was deleted.

130 changes: 74 additions & 56 deletions distrib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
<parent>
<artifactId>crsh.parent</artifactId>
<groupId>org.crsh</groupId>
<version>1.2.6</version>
<version>1.2.12-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.crsh</groupId>
<artifactId>crsh.distrib</artifactId>
<packaging>jar</packaging>
<version>1.2.6</version>
<version>1.2.12-SNAPSHOT</version>

<name>CRaSH distrib</name>
<description>The CRaSH distribution</description>
Expand Down Expand Up @@ -198,76 +197,95 @@
</descriptors>
</configuration>
</execution>
<execution>
<id>make-gvm</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<attach>false</attach>
<descriptors>
<descriptor>src/main/assembly/gvm.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<!--
| This profile will publish the gvm artifact in Bintray, guidelines:
| * checkout the tag to release (not mandatory)
| * execute with the bintrayUser and bintrayApiKey properties
| * only upload cr or final versions
| * drop the -SNAPSHOT if any (Bintray will not like it)
-->
<profile>
<id>upload</id>
<id>gvm</id>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
<artifactId>http-builder</artifactId>
<version>0.7.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.8.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.googlecode.maven-gcu-plugin</groupId>
<artifactId>maven-gcu-plugin</artifactId>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<configuration>
<source>${basedir}/src/bintrayUpload.groovy</source>
</configuration>
<phase>install</phase>
<goals>
<goal>upload</goal>
<goal>execute</goal>
</goals>
<configuration>
<serverId>googlecode</serverId>
<failsOnError>true</failsOnError>
<projectName>crsh</projectName>
<uploads>
<upload>
<file>${project.build.directory}/crash-${project.version}-gatein.tar.gz</file>
<summary>CRaSH GateIn web archive ${project.version}</summary>
<labels>
<label>GateIn</label>
</labels>
</upload>
<upload>
<file>${project.build.directory}/crash-${project.version}-mule-app.tar.gz</file>
<summary>CRaSH Mule application ${project.version}</summary>
<labels>
<label>Mule</label>
</labels>
</upload>
<upload>
<file>${project.build.directory}/crash-${project.version}-spring.tar.gz</file>
<summary>CRaSH Spring web archive ${project.version}</summary>
<labels>
<label>Spring</label>
</labels>
</upload>
<upload>
<file>${project.build.directory}/crash-${project.version}-war.tar.gz</file>
<summary>CRaSH Standalone web archive ${project.version}</summary>
<labels>
<label>Servlet</label>
</labels>
</upload>
<upload>
<file>${project.build.directory}/crash-${project.version}-docs.tar.gz</file>
<summary>CRaSH Documentation and sources bundle ${project.version}</summary>
<labels>
<label>Documentation</label>
</labels>
</upload>
<upload>
<file>${project.build.directory}/crash-${project.version}.tar.gz</file>
<summary>CRaSH Standalone ${project.version}</summary>
<labels>
<label>Standalone</label>
</labels>
</upload>
</uploads>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
<artifactId>http-builder</artifactId>
<version>0.7.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.8.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Expand Down
127 changes: 127 additions & 0 deletions distrib/src/bintrayUpload.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// This script uploads the gvm zip in bintray account
// it follows the gvm versionning scheme
// version with empty qualifiers or "crXYZ" will be uploaded
// SNAPSHOT version will be truncated to remove the SNAPSHOT as bintray does not accept them
// SNAPSHOT should be used for testing purpose

import groovyx.net.http.HTTPBuilder
import org.apache.commons.compress.archivers.ArchiveOutputStream
import org.apache.commons.compress.archivers.ArchiveStreamFactory
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream
import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.PatternLayout;
import org.apache.log4j.Level;
import org.apache.log4j.Logger

import static groovyx.net.http.ContentType.BINARY
import static groovyx.net.http.Method.*

// Configure log4j
def console = new ConsoleAppender()
console.setLayout(new PatternLayout("%d [%p|%c|%C{1}] %m%n"));
console.setThreshold(Level.ALL);
console.activateOptions();
Logger.getRootLogger().addAppender(console);
Logger.getRootLogger().setLevel(Level.INFO);
Logger.getLogger(HTTPBuilder.class).setLevel(Level.ALL)

// Version check / change and so on
def pattern = ~/([0-9\.]+)(\-.+)?/
def matcher = pattern.matcher(project.version);
if (!matcher.matches()) {
throw new Exception("Invalid version ${project.version} !")
}
def mmm = matcher.group(1);
def qualifier = matcher.group(2)
def version
if (qualifier != null && qualifier != "-SNAPSHOT") {
def qualifierPattern = ~/\-cr([0-9]+)(?:-SNAPSHOT)?/
def qualifierMatcher = qualifierPattern.matcher(qualifier);
if (!qualifierMatcher.matches()) {
// Only candidate releases
return;
}
version = "${mmm}.RC${qualifierMatcher.group(1)}"
} else {
version = mmm;
}

// Check we have the file to upload first
def file = new File(project.build.directory, "crash-${project.version}-gvm.zip")
if (!file.exists()) {
throw new Exception("${file.absolutePath} does not exists");
}
if (!file.isFile()) {
throw new Exception("${file.absolutePath} is not a file");
}

// Transform file to prefix
ByteArrayOutputStream baos = new ByteArrayOutputStream((int)file.length())
ZipArchiveInputStream zipIn = new ZipArchiveInputStream(new BufferedInputStream(new FileInputStream(file)));
ArchiveOutputStream zipOut = new ArchiveStreamFactory().createArchiveOutputStream("zip", baos);
byte[] buffer = new byte[512];
while (true) {
ZipArchiveEntry entry = zipIn.getNextZipEntry();
if (entry == null) {
break;
} else {
def length = (int)entry.size
entry.name = "crash-${version}/${entry.name}";
if (entry.name.endsWith(".sh") || entry.name.endsWith(".bat")) {
entry.setUnixMode(0100755);
}
zipOut.putArchiveEntry(entry);
while (length > 0) {
def amount = zipIn.read(buffer, 0, Math.min(length, buffer.length));
zipOut.write(buffer, 0, amount);
length -= amount;
}
zipOut.closeArchiveEntry();
}
}
zipOut.close();

// Credentials
def bintrayUser = project.properties.bintrayUser;
def bintrayApiKey = project.properties.bintrayApiKey;
if (bintrayUser == null) {
throw new Exception("Property bintrayUser not found");
}
if (bintrayApiKey == null) {
throw new Exception("Property bintrayApiKey not found");
}

//
def repoPath = "crashub/crash"
def packageName = "gvm"
def packagePath = "$repoPath/gvm"
def uploadUri = "/content/$packagePath/${version}/crash-${version}.zip";

//
def http = new HTTPBuilder("https://api.bintray.com");
http.headers.Authorization = "Basic ${"$bintrayUser:$bintrayApiKey".toString().bytes.encodeBase64()}"

println("Uploading ${file.absolutePath} to ${uploadUri}");
def result = http.request(PUT) {
uri.path = uploadUri
requestContentType = BINARY
body = new ByteArrayInputStream(baos.toByteArray());
response.success = { resp ->
return "Package ${packageName} uploaded.";
}
response.failure = { resp ->
def msg = "Cannot upload: ${resp.statusLine.statusCode} : ${resp.statusLine.reasonPhrase}";
def entity = resp.entity;
if (entity != null) {
msg += "\n" + org.apache.http.util.EntityUtils.toString(entity);
}
return new Exception(msg);
}
}

if (result instanceof Exception) {
throw result;
} else if (result != null) {
println(result)
}
44 changes: 44 additions & 0 deletions distrib/src/main/assembly/gvm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
~ Copyright (C) 2012 eXo Platform SAS.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1 http://maven.apache.org/xsd/assembly-1.1.1.xsd">
<id>gvm</id>
<formats>
<format>zip</format>
</formats>

<baseDirectory>/</baseDirectory>

<componentDescriptors>
<componentDescriptor>src/main/assembly/distrib.xml</componentDescriptor>
</componentDescriptors>

<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<unpack>true</unpack>
<includes>
<include>org.crsh:crsh.shell.packaging:tar.gz</include>
</includes>
</dependencySet>
</dependencySets>

</assembly>
2 changes: 1 addition & 1 deletion distrib/src/main/assembly/packaging.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
</dependencySet>
</dependencySets>

</assembly>
</assembly>
Loading