Skip to content

Commit

Permalink
Handle v prefix in release name (#287)
Browse files Browse the repository at this point in the history
* Handle v prefix in release name

* Return

* Everywhere arg0 not version

* docker image prune in CI to clean up unused images
  • Loading branch information
eatonphil committed Aug 11, 2022
1 parent 4a11125 commit 7abdb12
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 19 deletions.
12 changes: 7 additions & 5 deletions desktop/scripts/release.build
Expand Up @@ -2,12 +2,14 @@ rm -rf build
yarn
setenv UI_ESBUILD_ARGS "--minify"
setenv VERSION {arg0}
# Remove v prefix from version. v12 -> 12
stripleft VERSION "v"
yarn build-desktop

prepend "window.DS_CONFIG_MODE='desktop';" build/ui.js
prepend "window.DS_CONFIG_VERSION='{arg0}';" build/ui.js
prepend "window.DS_CONFIG_VERSION='{arg0}';" build/desktop_runner.js
prepend "global.DS_CONFIG_VERSION='{arg0}';" build/desktop.js
prepend "window.DS_CONFIG_VERSION='{VERSION}';" build/ui.js
prepend "window.DS_CONFIG_VERSION='{VERSION}';" build/desktop_runner.js
prepend "global.DS_CONFIG_VERSION='{VERSION}';" build/desktop.js
cp icon.png build/icon.png
cp icon.ico build/icon.ico
cp icon.icns build/icon.icns
Expand Down Expand Up @@ -41,5 +43,5 @@ rm -rf releases
yarn electron-rebuild

# Build and package
yarn electron-packager --asar --overwrite --icon=build/icon.png --out=releases --build-version={arg0} --app-version={arg0} . "DataStation Desktop CE"
zip -9 -r releases/datastation-{os}-{arch}-{arg0}.zip "releases/DataStation Desktop CE-{os}-{arch}"
yarn electron-packager --asar --overwrite --icon=build/icon.png --out=releases --build-version={VERSION} --app-version={VERSION} . "DataStation Desktop CE"
zip -9 -r releases/datastation-{os}-{arch}-{VERSION}.zip "releases/DataStation Desktop CE-{os}-{arch}"
2 changes: 1 addition & 1 deletion integration/clickhouse.test.js
@@ -1,7 +1,7 @@
const cp = require('child_process');

const { basicDatabaseTest } = require('../desktop/panel/testutil');
const { withDocker } = require('./testutil');
const { withDocker } = require('./docker');

const BASIC_TESTS = [
{
Expand Down
2 changes: 1 addition & 1 deletion integration/cockroachdb.test.js
@@ -1,7 +1,7 @@
const cp = require('child_process');

const { basicDatabaseTest } = require('../desktop/panel/testutil');
const { withDocker } = require('./testutil');
const { withDocker } = require('./docker');

const BASIC_TESTS = [
{
Expand Down
2 changes: 1 addition & 1 deletion integration/cratedb.test.js
@@ -1,5 +1,5 @@
const { basicDatabaseTest } = require('../desktop/panel/testutil');
const { withDocker } = require('./testutil');
const { withDocker } = require('./docker');

const BASIC_TESTS = [
{
Expand Down
6 changes: 6 additions & 0 deletions integration/testutil.js → integration/docker.js
Expand Up @@ -138,6 +138,12 @@ module.exports.withDocker = async function (opts, cb) {
CONTAINERS[opts.image] = CONTAINERS[opts.image].filter(
(c) => c === containerId
);

if (process.env.CI == 'true') {
// Clear up disk space if possible since Github Actions doesn't
// have a massive disk.
cp.execSync('docker image prune -a', { stdio: 'inherit' });
}
}
};

Expand Down
2 changes: 1 addition & 1 deletion integration/elasticsearch.test.js
Expand Up @@ -6,7 +6,7 @@ const fetch = require('node-fetch');
const { getProjectResultsFile } = require('../desktop/store');
const { DatabasePanelInfo, DatabaseConnectorInfo } = require('../shared/state');
const { withSavedPanels, RUNNERS } = require('../desktop/panel/testutil');
const { withDocker } = require('./testutil');
const { withDocker } = require('./docker');

describe('elasticsearch testdata/documents tests', () => {
const tests = [
Expand Down
2 changes: 1 addition & 1 deletion integration/influx.test.js
Expand Up @@ -9,7 +9,7 @@ const {
DatabaseConnectorInfo,
} = require('../shared/state');
const { withSavedPanels, RUNNERS } = require('../desktop/panel/testutil');
const { withDocker, DEFAULT_TIMEOUT } = require('./testutil');
const { withDocker, DEFAULT_TIMEOUT } = require('./docker');

async function testBasicInflux(testcase) {
const connectors = [
Expand Down
2 changes: 1 addition & 1 deletion integration/mongo.test.js
Expand Up @@ -8,7 +8,7 @@ const {
DatabaseConnectorInfo,
} = require('../shared/state');
const { withSavedPanels, RUNNERS } = require('../desktop/panel/testutil');
const { withDocker, DEFAULT_TIMEOUT } = require('./testutil');
const { withDocker, DEFAULT_TIMEOUT } = require('./docker');

function testWithDocker(name, cb) {
test(
Expand Down
2 changes: 1 addition & 1 deletion integration/mysql.test.js
@@ -1,7 +1,7 @@
const cp = require('child_process');

const { basicDatabaseTest } = require('../desktop/panel/testutil');
const { withDocker } = require('./testutil');
const { withDocker } = require('./docker');

const BASIC_TESTS = [
{
Expand Down
2 changes: 1 addition & 1 deletion integration/neo4j.test.js
Expand Up @@ -7,7 +7,7 @@ const {
DatabaseConnectorInfo,
} = require('../shared/state');
const { withSavedPanels, RUNNERS } = require('../desktop/panel/testutil');
const { withDocker } = require('./testutil');
const { withDocker } = require('./docker');

describe('basic neo4j tests', () => {
test('basic test', async () => {
Expand Down
2 changes: 1 addition & 1 deletion integration/oracle.test.js
@@ -1,5 +1,5 @@
const { basicDatabaseTest } = require('../desktop/panel/testutil');
const { withDocker, DEFAULT_TIMEOUT } = require('./testutil');
const { withDocker, DEFAULT_TIMEOUT } = require('./docker');

const BASIC_TESTS = [
{
Expand Down
2 changes: 1 addition & 1 deletion integration/postgres.test.js
@@ -1,5 +1,5 @@
const { basicDatabaseTest } = require('../desktop/panel/testutil');
const { withDocker } = require('./testutil');
const { withDocker } = require('./docker');

const BASIC_TESTS = [
{
Expand Down
2 changes: 1 addition & 1 deletion integration/prometheus.test.js
Expand Up @@ -5,7 +5,7 @@ const fetch = require('node-fetch');
const { getProjectResultsFile } = require('../desktop/store');
const { DatabasePanelInfo, DatabaseConnectorInfo } = require('../shared/state');
const { withSavedPanels, RUNNERS } = require('../desktop/panel/testutil');
const { withDocker } = require('./testutil');
const { withDocker } = require('./docker');

describe('basic prometheus tests', () => {
test('basic test', async () => {
Expand Down
2 changes: 1 addition & 1 deletion integration/questdb.test.js
@@ -1,5 +1,5 @@
const { basicDatabaseTest } = require('../desktop/panel/testutil');
const { withDocker } = require('./testutil');
const { withDocker } = require('./docker');

const BASIC_TESTS = [
{
Expand Down
2 changes: 1 addition & 1 deletion integration/scylla.test.js
Expand Up @@ -7,7 +7,7 @@ const {
DatabaseConnectorInfo,
} = require('../shared/state');
const { withSavedPanels, RUNNERS } = require('../desktop/panel/testutil');
const { withDocker } = require('./testutil');
const { withDocker } = require('./docker');

describe('basic cassandra/scylladb tests', () => {
test(`runs basic cql query`, async () => {
Expand Down
2 changes: 1 addition & 1 deletion integration/sqlserver.test.js
@@ -1,5 +1,5 @@
const { basicDatabaseTest } = require('../desktop/panel/testutil');
const { withDocker } = require('./testutil');
const { withDocker } = require('./docker');

const BASIC_TESTS = [
{
Expand Down
5 changes: 5 additions & 0 deletions scripts/build.py
Expand Up @@ -162,6 +162,11 @@ def eval_line(line):
with open(to, 'a') as to:
to.write('\n'+what)
return
elif line[0] == 'stripleft':
var = line[1]
what = line[2]
os.environ[var] = os.environ[var].lstrip(what)
return
elif line[0] == 'prepend':
what = line[1]
to = line[2]
Expand Down

0 comments on commit 7abdb12

Please sign in to comment.