Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions .github/workflows/code_sample_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@ jobs:
- name: Check code samples
run: |
npm run check-code-samples

- name: Upload remote controller logs if test run fails
uses: actions/upload-artifact@v4
if: failure()
with:
name: rc-logs-${{ matrix.os }}
path: |
rc_stderr.log
rc_stdout.log
118 changes: 19 additions & 99 deletions scripts/download-rc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ const downloadRC = () => {
const os = require('os');
const {spawnSync} = require('child_process');

const ON_WINDOWS = os.platform() === 'win32';
const HAZELCAST_ENTERPRISE_KEY = process.env.HAZELCAST_ENTERPRISE_KEY ? process.env.HAZELCAST_ENTERPRISE_KEY : '';

let REPO;
let ENTERPRISE_REPO;
let TEST_REPO;
Expand All @@ -36,118 +33,41 @@ const downloadRC = () => {
TEST_REPO = RELEASE_REPO;
}

if (fs.existsSync(`hazelcast-remote-controller-${HAZELCAST_RC_VERSION}.jar`)) {
console.log('remote controller already exists, not downloading from maven.');
} else {
console.log('Downloading: remote-controller jar com.hazelcast:hazelcast-remote-controller:'
+ HAZELCAST_RC_VERSION);
const subprocess = spawnSync('mvn',
[
'-q',
'org.apache.maven.plugins:maven-dependency-plugin:2.10:get',
'-Dtransitive=false',
`-DremoteRepositories=${ENTERPRISE_SNAPSHOT_REPO}`,
`-Dartifact=com.hazelcast:hazelcast-remote-controller:${HAZELCAST_RC_VERSION}`,
`-Ddest=hazelcast-remote-controller-${HAZELCAST_RC_VERSION}.jar`
], {
stdio: 'inherit',
shell: ON_WINDOWS
});
if (subprocess.status !== 0) {
const subprocessTrace = subprocess.error ? subprocess.error.stack : '';
throw 'Failed download remote-controller jar '
+ `com.hazelcast:hazelcast-remote-controller:${HAZELCAST_RC_VERSION} ${subprocessTrace}`;
}
}
downloadArtifact(ENTERPRISE_SNAPSHOT_REPO, 'hazelcast-remote-controller', HAZELCAST_RC_VERSION);
downloadArtifact(TEST_REPO, 'hazelcast', HAZELCAST_TEST_VERSION, 'tests');
downloadArtifact(REPO, 'hazelcast-sql', HAZELCAST_VERSION);

if (fs.existsSync(`hazelcast-${HAZELCAST_TEST_VERSION}-tests.jar`)) {
console.log('hazelcast-test.jar already exists, not downloading from maven.');
if (process.env.HAZELCAST_ENTERPRISE_KEY) {
downloadArtifact(ENTERPRISE_REPO, 'hazelcast-enterprise', HAZELCAST_ENTERPRISE_VERSION);
} else {
console.log(`Downloading: hazelcast test jar com.hazelcast:hazelcast:${HAZELCAST_TEST_VERSION}:jar:tests`);
const subprocess = spawnSync('mvn',
[
'-q',
'org.apache.maven.plugins:maven-dependency-plugin:2.10:get',
'-Dtransitive=false',
`-DremoteRepositories=${TEST_REPO}`,
`-Dartifact=com.hazelcast:hazelcast:${HAZELCAST_TEST_VERSION}:jar:tests`,
`-Ddest=hazelcast-${HAZELCAST_TEST_VERSION}-tests.jar`
], {
stdio: 'inherit',
shell: ON_WINDOWS
});
if (subprocess.status !== 0) {
const subprocessTrace = subprocess.error ? subprocess.error.stack : '';
throw 'Failed download hazelcast test jar com.hazelcast:hazelcast:'
+ `${HAZELCAST_TEST_VERSION}:jar:tests ${subprocessTrace}`;
}
downloadArtifact(REPO, 'hazelcast', HAZELCAST_VERSION);
}

if (fs.existsSync(`hazelcast-sql-${HAZELCAST_VERSION}.jar`)) {
console.log('hazelcast-sql.jar already exists, not downloading from maven.');
} else {
console.log(`Downloading: hazelcast sql jar com.hazelcast:hazelcast-sql:${HAZELCAST_VERSION}`);
const subprocess = spawnSync('mvn', [
'-q',
'org.apache.maven.plugins:maven-dependency-plugin:2.10:get',
'-Dtransitive=false',
`-DremoteRepositories=${REPO}`,
`-Dartifact=com.hazelcast:hazelcast-sql:${HAZELCAST_VERSION}`,
`-Ddest=hazelcast-sql-${HAZELCAST_VERSION}.jar`
], {
stdio: 'inherit',
shell: ON_WINDOWS
});
if (subprocess.status !== 0) {
const subprocessTrace = subprocess.error ? subprocess.error.stack : '';
throw 'Failed download hazelcast sql jar'
+ `com.hazelcast:hazelcast-sql:${HAZELCAST_VERSION} ${subprocessTrace}`;
function downloadArtifact(repo, artifactId, version, classifier = '') {
const filename = classifier ? `${artifactId}-${version}-${classifier}.jar` : `${artifactId}-${version}.jar`;
let artifact = `com.hazelcast:${artifactId}:${version}:jar`;
if (classifier) {
artifact += `:${classifier}`;
}
}

if (HAZELCAST_ENTERPRISE_KEY) {
if (fs.existsSync(`hazelcast-enterprise-${HAZELCAST_ENTERPRISE_VERSION}.jar`)) {
console.log('hazelcast-enterprise.jar already exists, not downloading from maven.');
} else {
console.log('Downloading: hazelcast enterprise jar '
+ `com.hazelcast:hazelcast-enterprise:${HAZELCAST_ENTERPRISE_VERSION}`);
const subprocess = spawnSync('mvn', [
'-q',
'org.apache.maven.plugins:maven-dependency-plugin:2.10:get',
'-Dtransitive=false',
`-DremoteRepositories=${ENTERPRISE_REPO}`,
`-Dartifact=com.hazelcast:hazelcast-enterprise:${HAZELCAST_ENTERPRISE_VERSION}`,
`-Ddest=hazelcast-enterprise-${HAZELCAST_ENTERPRISE_VERSION}.jar`
], {
stdio: 'inherit',
shell: ON_WINDOWS
});
if (subprocess.status !== 0) {
const subprocessTrace = subprocess.error ? subprocess.error.stack : '';
throw 'Failed download hazelcast enterprise jar '
+ `com.hazelcast:hazelcast-enterprise:${HAZELCAST_ENTERPRISE_VERSION} ${subprocessTrace}`;
}
}
console.log('Starting Remote Controller ... enterprise ...');
} else {
if (fs.existsSync(`hazelcast-${HAZELCAST_VERSION}.jar`)) {
console.log('hazelcast.jar already exists, not downloading from maven.');
if (fs.existsSync(filename)) {
console.log('${filename} already exists, download not required');
} else {
console.log(`Downloading: hazelcast jar com.hazelcast:hazelcast:${HAZELCAST_VERSION}`);
console.log(`Downloading: ${artifact} to ${filename}`);
const subprocess = spawnSync('mvn', [
'-q',
'org.apache.maven.plugins:maven-dependency-plugin:2.10:get',
'-Dtransitive=false',
`-DremoteRepositories=${REPO}`,
`-Dartifact=com.hazelcast:hazelcast:${HAZELCAST_VERSION}`,
`-Ddest=hazelcast-${HAZELCAST_VERSION}.jar`
`-DremoteRepositories=${repo}`,
`-Dartifact=${artifact}`,
`-Ddest=${filename}`
], {
stdio: 'inherit',
shell: ON_WINDOWS
shell: os.platform() === 'win32'
});
if (subprocess.status !== 0) {
const subprocessTrace = subprocess.error ? subprocess.error.stack : '';
throw `Failed download hazelcast jar com.hazelcast:hazelcast:${HAZELCAST_VERSION} ${subprocessTrace}`;
throw `Failed to download ${artifact} to ${filename} - ${subprocessTrace}`;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const getRC = () => {
};

const startRC = async () => {
console.log('Starting Hazelcast Remote Controller ... oss ...');
console.log('Starting Hazelcast Remote Controller ...');
if (ON_WINDOWS) {
const outFD = fs.openSync('rc_stdout.log', 'w');
const errFD = fs.openSync('rc_stderr.log', 'w');
Expand Down
Loading