Skip to content

Commit

Permalink
switch S3 version listing from demo server to real server
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Jan 12, 2024
1 parent 8a4f91c commit 620bacf
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 25 deletions.
4 changes: 2 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.mwiede</groupId>
<groupId>org.lucee</groupId>
<artifactId>jsch</artifactId>
<version>0.2.11</version>
<version>0.1.55</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ Require-Bundle: org.apache.commons.commons-codec;bundle-version=1.15.0,
tagsoup;bundle-version=1.2.1.0002L,
w3c.dom;bundle-version=1.1.0,
org.lucee.commons.email;bundle-version=1.2.0,
com.github.mwiede.jsch;bundle-version=0.2.11,
org.lucee.jsch;bundle-version=0.1.55,
org.lucee.jzlib;bundle-version=1.1.3,
org.lucee.argon2;bundle-version=2.7.0,
com.sun.jna;bundle-version=5.13.0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package lucee.runtime.config.maven;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.SequenceInputStream;
Expand All @@ -19,19 +18,17 @@
import org.osgi.framework.Version;
import org.xml.sax.SAXException;

import lucee.commons.io.IOUtil;
import lucee.commons.lang.StringUtil;
import lucee.commons.net.http.HTTPResponse;
import lucee.commons.net.http.Header;
import lucee.commons.net.http.httpclient.HTTPEngine4Impl;
import lucee.runtime.exp.PageException;
import lucee.runtime.op.Caster;
import lucee.runtime.op.date.DateCaster;
import lucee.runtime.osgi.OSGiUtil;

public class MavenUpdateProvider {

public static final int CONNECTION_TIMEOUT = 1000;
public static final int CONNECTION_TIMEOUT = 10000;

public static final String DEFAULT_LIST_PROVIDER = "https://oss.sonatype.org/service/local/lucene/search";
// public static final String DEFAULT_REPOSITORY = "https://repo1.maven.org/maven2";
Expand All @@ -54,20 +51,6 @@ public class MavenUpdateProvider {
private String repoSnapshots;
private String repoReleases;

public static void main(String[] args) throws Exception {
MavenUpdateProvider provider = new MavenUpdateProvider();

// print.e(provider.list());

// print.e(provider.detail(OSGiUtil.toVersion("5.3.8.100-SNAPSHOT")));
// print.e(provider.detail(OSGiUtil.toVersion("6.0.0.561-RC")));

IOUtil.copy(provider.getLoader(OSGiUtil.toVersion("5.3.8.100-SNAPSHOT")), new FileOutputStream("/Users/mic/tmp8/5.3.8.100-SNAPSHOT.jar.zip"), true, true);
IOUtil.copy(provider.getLoader(OSGiUtil.toVersion("6.0.0.572-RC")), new FileOutputStream("/Users/mic/tmp8/6.0.0.572-RC.jar.zip"), true, true);
IOUtil.copy(provider.getCore(OSGiUtil.toVersion("5.3.8.100-SNAPSHOT")), new FileOutputStream("/Users/mic/tmp8/5.3.8.100-SNAPSHOT.lco.zip"), true, true);

}

public MavenUpdateProvider() {
this.listProvider = DEFAULT_LIST_PROVIDER;
this.repoSnapshots = DEFAULT_REPOSITORY_SNAPSHOT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public final class S3UpdateProvider extends DefaultHandler {

static {
try {
DEFAULT_PROVIDER_LIST = new URL("https://s3.us-west-1.wasabisys.com/lucee-downloads/");
DEFAULT_PROVIDER_LIST = new URL("https://lucee-downloads.s3.amazonaws.com/");
DEFAULT_PROVIDER_DETAILS = new URL[] { new URL("https://cdn.lucee.org/"), DEFAULT_PROVIDER_LIST };
}
catch (MalformedURLException e) {
Expand Down Expand Up @@ -251,7 +251,7 @@ else if (insideContents) {

element.addKey(lastKey);

if (last3 == null || !last3.equals(element.getVersion().toString().substring(0, 6))) {
if (element.getVersion() != null && (last3 == null || !last3.equals(element.getVersion().toString().substring(0, 6)))) {
last3P = last3;
last3PKey = last3Key;
last3 = element.getVersion().toString().substring(0, 6);
Expand Down
4 changes: 2 additions & 2 deletions loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.mwiede</groupId>
<groupId>org.lucee</groupId>
<artifactId>jsch</artifactId>
<version>0.2.8</version>
<version>0.1.55</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
30 changes: 30 additions & 0 deletions test/general/ListVersion.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
component extends="org.lucee.cfml.test.LuceeTestCase" skip="true"{
function beforeAll(){

}

function run( testResults , testBox ) {
describe( "test listing external versions", function() {


it( title='test version listing', body=function( currentSpec ) {
var versions=LuceeVersionsList();
expect(isArray(versions)).toBeTrue();
expect(arrayLen(versions)>100).toBeTrue();
});

it( title='test Maven specific version listing', body=function( currentSpec ) {
var versions=LuceeVersionsListMvn();
expect(isArray(versions)).toBeTrue();
expect(arrayLen(versions)>100).toBeTrue();
});

it( title='test S3 specific version listing', body=function( currentSpec ) {
var versions=LuceeVersionsListS3();
expect(isQuery(versions)).toBeTrue();
expect(versions.recordcount>100).toBeTrue();
});
});
}

}

0 comments on commit 620bacf

Please sign in to comment.