diff --git a/README.md b/README.md index 5f72b7871b..16a2c23c89 100644 --- a/README.md +++ b/README.md @@ -204,7 +204,10 @@ sh ./scripts/build.sh By default, Docker volumes named dev_db, dev_elastic, and dev_files will be created for the MongoDB, Elasticsearch, and MinIO instances. -Add the following line to your /etc/hosts file +Add the following lines to your hosts file: + +- **macOS / Linux:** `/etc/hosts` +- **Windows:** `C:\Windows\System32\drivers\etc\hosts` ```plain 127.0.0.1 huly.local diff --git a/common/config/rush/command-line.json b/common/config/rush/command-line.json index ca0c052aa3..52cd4372ee 100644 --- a/common/config/rush/command-line.json +++ b/common/config/rush/command-line.json @@ -245,7 +245,7 @@ "summary": "Build docker with platform", "description": "use to build all docker containers required for platform", "safeForSimultaneousRushProcesses": true, - "shellCommand": "./common/scripts/docker.sh" + "shellCommand": "node common/scripts/docker.js" }, { "commandKind": "global", @@ -253,7 +253,7 @@ "summary": "Build docker with platform", "description": "use to build all docker containers required for platform", "safeForSimultaneousRushProcesses": true, - "shellCommand": "./common/scripts/docker-server.sh && rush docker:up:server" + "shellCommand": "node common/scripts/docker-server.js && rush docker:up:server" }, { "commandKind": "global", @@ -261,7 +261,7 @@ "summary": "Up development build", "description": "Up development build", "safeForSimultaneousRushProcesses": true, - "shellCommand": "cd ./dev && docker compose up -d --force-recreate" + "shellCommand": "docker compose -f dev/docker-compose.yaml up -d --force-recreate" }, { "commandKind": "global", @@ -269,7 +269,7 @@ "summary": "Up development build", "description": "Up development build", "safeForSimultaneousRushProcesses": true, - "shellCommand": "cd ./dev && docker compose up -d --force-recreate transactor_cockroach" + "shellCommand": "docker compose -f dev/docker-compose.yaml up -d --force-recreate transactor_cockroach" }, { "commandKind": "global", @@ -277,7 +277,7 @@ "summary": "Up development build", "description": "Up development build", "safeForSimultaneousRushProcesses": true, - "shellCommand": "cd ./dev/local-mongo && docker compose -p dev up -d --force-recreate" + "shellCommand": "docker compose -f dev/local-mongo/docker-compose.yaml -p dev up -d --force-recreate" }, { "commandKind": "global", diff --git a/common/scripts/docker-server.js b/common/scripts/docker-server.js new file mode 100644 index 0000000000..f3c0bce53d --- /dev/null +++ b/common/scripts/docker-server.js @@ -0,0 +1,23 @@ +// +// Copyright © 2024 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +const path = require('path') +const { spawnSync } = require('child_process') + +const repoRoot = path.resolve(__dirname, '..', '..') +const args = ['docker:build', '-p', '20', '--to', '@hcengineering/pod-server', '--to', '@hcengineering/tool'] +const result = spawnSync('rush', args, { stdio: 'inherit', cwd: repoRoot }) +// Mimic "|| true" - always exit 0 so rush docker-server can continue to docker:up:server +process.exit(0) diff --git a/common/scripts/docker.js b/common/scripts/docker.js new file mode 100644 index 0000000000..3311ad7773 --- /dev/null +++ b/common/scripts/docker.js @@ -0,0 +1,55 @@ +// +// Copyright © 2024 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +const path = require('path') +const { spawnSync } = require('child_process') + +const repoRoot = path.resolve(__dirname, '..', '..') +const packages = [ + '@hcengineering/pod-server', + '@hcengineering/pod-front', + '@hcengineering/prod', + '@hcengineering/pod-account', + '@hcengineering/pod-workspace', + '@hcengineering/pod-collaborator', + '@hcengineering/tool', + '@hcengineering/pod-print', + '@hcengineering/pod-sign', + '@hcengineering/pod-analytics-collector', + '@hcengineering/rekoni-service', + '@hcengineering/pod-ai-bot', + '@hcengineering/import-tool', + '@hcengineering/pod-stats', + '@hcengineering/pod-fulltext', + '@hcengineering/pod-love', + '@hcengineering/pod-mail', + '@hcengineering/pod-datalake', + '@hcengineering/pod-mail-worker', + '@hcengineering/pod-export', + '@hcengineering/pod-media', + '@hcengineering/pod-preview', + '@hcengineering/pod-link-preview', + '@hcengineering/pod-external', + '@hcengineering/pod-backup', + '@hcengineering/backup-api-pod', + '@hcengineering/pod-billing', + '@hcengineering/pod-process', + '@hcengineering/pod-rating', + '@hcengineering/pod-payment' +] + +const args = ['docker:build', '-p', '20', ...packages.flatMap(p => ['--to', p])] +const result = spawnSync('rush', args, { stdio: 'inherit', cwd: repoRoot }) +process.exit(result.status !== null ? result.status : 1) diff --git a/common/scripts/docker_build.js b/common/scripts/docker_build.js new file mode 100644 index 0000000000..b365c97c5e --- /dev/null +++ b/common/scripts/docker_build.js @@ -0,0 +1,55 @@ +// +// Copyright © 2024 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +const fs = require('fs') +const path = require('path') +const { execSync, spawnSync } = require('child_process') + +const image = process.argv[2] +if (!image) { + console.error('Usage: node docker_build.js [.]') + process.exit(1) +} + +const version = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim() +const cleanup = process.env.DOCKER_BUILD_CLEANUP === 'true' +const extra = (process.env.DOCKER_EXTRA || '').trim().split(/\s+/).filter(Boolean) + +console.log('Building version:', version) + +const dockerArgs = ['build', '-t', image, '-t', `${image}:${version}`, ...extra, '.'] +const result = spawnSync('docker', dockerArgs, { stdio: 'inherit', cwd: process.cwd() }) +if (result.status !== 0) { + process.exit(result.status) +} + +if (cleanup) { + console.log('Cleaning up build artifacts...') + const dirs = ['bundle', 'dist', '.rush'] + for (const dir of dirs) { + const fullPath = path.join(process.cwd(), dir) + if (fs.existsSync(fullPath)) { + console.log(' Removing', dir + '/') + fs.rmSync(fullPath, { recursive: true, force: true }) + } + } + // Skip du -sh on Windows (no du); optional on Unix + try { + const size = execSync('du -sh . 2>/dev/null | cut -f1', { encoding: 'utf8' }).trim() + if (size) console.log(' Size after cleanup:', size) + } catch (_) { + // ignore + } +} diff --git a/common/scripts/package-desktop-copy.js b/common/scripts/package-desktop-copy.js new file mode 100644 index 0000000000..0b7a636244 --- /dev/null +++ b/common/scripts/package-desktop-copy.js @@ -0,0 +1,48 @@ +// +// Copyright © 2024 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +const fs = require('fs') +const path = require('path') + +const withIcons = process.argv.includes('--with-icons') + +// Run from desktop-package or qms-desktop-package directory (cwd = package dir) +const distDir = path.join(process.cwd(), 'dist') +const desktopDist = path.join(process.cwd(), '..', 'desktop', 'dist') +const desktopEnv = path.join(process.cwd(), '..', 'desktop', '.env') + +if (fs.existsSync(distDir)) { + fs.rmSync(distDir, { recursive: true, force: true }) +} + +fs.cpSync(desktopDist, distDir, { recursive: true }) + +if (fs.existsSync(desktopEnv)) { + fs.cpSync(desktopEnv, path.join(distDir, '.env')) +} + +if (withIcons) { + const publicDir = path.join(distDir, 'ui', 'public') + fs.mkdirSync(publicDir, { recursive: true }) + const srcDir = path.join(process.cwd(), 'src') + const iconPng = path.join(srcDir, 'AppIcon.png') + const iconIco = path.join(srcDir, 'AppIcon.ico') + if (fs.existsSync(iconPng)) { + fs.cpSync(iconPng, path.join(publicDir, 'AppIcon.png')) + } + if (fs.existsSync(iconIco)) { + fs.cpSync(iconIco, path.join(publicDir, 'AppIcon.ico')) + } +} diff --git a/common/scripts/package-pod-front-copy.js b/common/scripts/package-pod-front-copy.js new file mode 100644 index 0000000000..6fcdc42dc7 --- /dev/null +++ b/common/scripts/package-pod-front-copy.js @@ -0,0 +1,42 @@ +// +// Copyright © 2024 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +const fs = require('fs') +const path = require('path') + +const cwd = process.cwd() +const distDir = path.join(cwd, 'dist') +const prodDist = path.join(cwd, '..', '..', 'dev', 'prod', 'dist') +const prodPublic = path.join(cwd, '..', '..', 'dev', 'prod', 'public') + +if (fs.existsSync(distDir)) { + fs.rmSync(distDir, { recursive: true, force: true }) +} + +fs.cpSync(prodDist, distDir, { recursive: true }) + +if (fs.existsSync(prodPublic)) { + const entries = fs.readdirSync(prodPublic, { withFileTypes: true }) + for (const entry of entries) { + const src = path.join(prodPublic, entry.name) + const dest = path.join(distDir, entry.name) + fs.cpSync(src, dest, { recursive: true }) + } +} + +const configJson = path.join(distDir, 'config.json') +if (fs.existsSync(configJson)) { + fs.rmSync(configJson, { force: true }) +} diff --git a/common/scripts/run-with-version.js b/common/scripts/run-with-version.js new file mode 100644 index 0000000000..c732f70867 --- /dev/null +++ b/common/scripts/run-with-version.js @@ -0,0 +1,32 @@ +// +// Copyright © 2026 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +const path = require('path') +const { execSync, spawnSync } = require('child_process') + +const scriptsDir = __dirname +const modelVersion = execSync('node show_version.js', { encoding: 'utf8', cwd: scriptsDir }).trim() +const version = execSync('node show_tag.js', { encoding: 'utf8', cwd: scriptsDir }).trim() + +process.env.MODEL_VERSION = modelVersion +process.env.VERSION = version + +const [cmd, ...args] = process.argv.slice(2) +if (!cmd) { + process.exit(1) +} +const command = [cmd, ...args].join(' ') +const result = spawnSync(command, { stdio: 'inherit', env: process.env, shell: true }) +process.exit(result.status !== null ? result.status : 1) diff --git a/common/scripts/show_tag.js b/common/scripts/show_tag.js index bd41cebf68..caa08ab0a6 100644 --- a/common/scripts/show_tag.js +++ b/common/scripts/show_tag.js @@ -13,19 +13,25 @@ // limitations under the License. // -const exec = require('child_process').exec +const execSync = require('child_process').execSync -exec('git describe --tags --abbrev=0', (err, stdout, stderr) => { - if (err !== null) { - console.log('"0.6.0"') - } - const rawVersion = stdout.trim().replace('v', '').replace('s', '').split('.') - if (rawVersion.length === 3) { - const version = { - major: parseInt(rawVersion[0]), - minor: parseInt(rawVersion[1]), - patch: parseInt(rawVersion[2]) +function main() { + try { + const stdout = execSync('git describe --tags --abbrev=0', { encoding: 'utf8' }) + const rawVersion = stdout.trim().replace('v', '').replace('s', '').split('.') + if (rawVersion.length === 3) { + const version = { + major: parseInt(rawVersion[0]), + minor: parseInt(rawVersion[1]), + patch: parseInt(rawVersion[2]) + } + console.log(`"${version.major}.${version.minor}.${version.patch}"`) + return } - console.log(`"${version.major}.${version.minor}.${version.patch}"`) + } catch (err) { + // git failed or no tags } -}) + console.log('"0.6.0"') +} + +main() diff --git a/common/scripts/show_version.js b/common/scripts/show_version.js index 7a49a74d5f..880a14eba1 100644 --- a/common/scripts/show_version.js +++ b/common/scripts/show_version.js @@ -15,25 +15,23 @@ const fs = require('fs') const path = require('path') -const exec = require('child_process').exec +const execSync = require('child_process').execSync function main() { - exec('git describe --tags --abbrev=0', (err, stdout) => { - if (err !== null) { - console.log('"0.6.0"') - return - } - // Take version from file - let version - try { - const versionFilePath = path.resolve(__dirname, 'version.txt') - version = fs.readFileSync(versionFilePath, 'utf8').trim() - } catch (error) { - version = '"0.6.0"' - } - - console.log(version) - }) + try { + execSync('git describe --tags --abbrev=0', { encoding: 'utf8' }) + } catch (err) { + console.log('"0.6.0"') + return + } + let version + try { + const versionFilePath = path.resolve(__dirname, 'version.txt') + version = fs.readFileSync(versionFilePath, 'utf8').trim() + } catch (error) { + version = '"0.6.0"' + } + console.log(version) } main() diff --git a/desktop-package/package.json b/desktop-package/package.json index 3868f8073c..e240ebbea0 100644 --- a/desktop-package/package.json +++ b/desktop-package/package.json @@ -6,7 +6,7 @@ "template": "@hcengineering/default-package", "scripts": { "_phase:package": "rushx package", - "package": "rm -rf ./dist && cp -r ../desktop/dist . && cp ../desktop/.env ./dist && echo 'done'", + "package": "node ../common/scripts/package-desktop-copy.js && echo done", "dist": "cross-env CSC_IDENTITY_AUTO_DISCOVERY=false NODE_ENV=production VERSION=$(node ../common/scripts/show_tag.js) MODEL_VERSION=$(node ../common/scripts/show_version.js) electron-builder build -p onTag", "dist-local": "cross-env CSC_IDENTITY_AUTO_DISCOVERY=false NODE_ENV=production VERSION=$(node ../common/scripts/show_tag.js) MODEL_VERSION=$(node ../common/scripts/show_version.js) electron-builder build", "dist-signed": "cross-env CSC_IDENTITY_AUTO_DISCOVERY=true NODE_ENV=production VERSION=$(node ../common/scripts/show_tag.js) MODEL_VERSION=$(node ../common/scripts/show_version.js) electron-builder build -c.afterSign=scripts/notarize.js -p onTag", diff --git a/desktop/package.json b/desktop/package.json index 7fe030affb..c39ffe2ea2 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -1,6 +1,6 @@ { "name": "@hcengineering/desktop", - "version": "0.7.208", + "version": "0.7.327", "main": "dist/main/electron.js", "template": "@hcengineering/webpack-package", "scripts": { @@ -9,12 +9,12 @@ "_phase:package": "rushx package", "_phase:validate": "compile validate", "_phase:test": "jest --passWithNoTests --silent --forceExit --detectOpenHandles", - "package": "rushx bump && cross-env MODEL_VERSION=$(node ../common/scripts/show_version.js) VERSION=$(node ../common/scripts/show_tag.js) NODE_ENV=production NODE_OPTIONS='--max-old-space-size=4094' webpack --stats-error-details && echo 'done'", - "webpack": "cross-env MODEL_VERSION=$(node ../common/scripts/show_version.js) VERSION=$(node ../common/scripts/show_tag.js) NODE_ENV=development webpack --stats-error-details --progress -w", - "devp": "cross-env MODEL_VERSION=$(node ../common/scripts/show_version.js) VERSION=$(node ../common/scripts/show_tag.js) NODE_ENV=production CLIENT_TYPE=dev webpack --progress -w", - "dev": "cross-env MODEL_VERSION=$(node ../common/scripts/show_version.js) VERSION=$(node ../common/scripts/show_tag.js) NODE_ENV=development webpack --progress -w", - "start": "cross-env MODEL_VERSION=$(node ../common/scripts/show_version.js) VERSION=$(node ../common/scripts/show_tag.js) NODE_ENV=production electron --no-sandbox .", - "start-dev": "cross-env MODEL_VERSION=$(node ../common/scripts/show_version.js) VERSION=$(node ../common/scripts/show_tag.js) NODE_ENV=development electron --no-sandbox .", + "package": "rushx bump && node ../common/scripts/run-with-version.js cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=4094 webpack --stats-error-details && echo done", + "webpack": "node ../common/scripts/run-with-version.js cross-env NODE_ENV=development webpack --stats-error-details --progress -w", + "devp": "node ../common/scripts/run-with-version.js cross-env NODE_ENV=production CLIENT_TYPE=dev webpack --progress -w", + "dev": "node ../common/scripts/run-with-version.js cross-env NODE_ENV=development webpack --progress -w", + "start": "node ../common/scripts/run-with-version.js cross-env NODE_ENV=production electron --no-sandbox .", + "start-dev": "node ../common/scripts/run-with-version.js cross-env NODE_ENV=development electron --no-sandbox .", "test": "jest --passWithNoTests --silent --forceExit --verbose --detectOpenHandles", "test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --no-cache", "format": "format", diff --git a/dev/import-tool/package.json b/dev/import-tool/package.json index 3e538b20ba..c239b2a0f2 100644 --- a/dev/import-tool/package.json +++ b/dev/import-tool/package.json @@ -15,7 +15,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../common/scripts/esbuild.js --entry=src/__start.ts --keep-names=true --define=MODEL_VERSION --define=GIT_REVISION --sourcemap=external", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/import-tool", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/import-tool", "docker:tbuild": "docker build -t hardcoreeng/import-tool . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/import-tool", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/import-tool staging", "docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/import-tool", diff --git a/dev/prod/package.json b/dev/prod/package.json index be3d41825c..06fa593867 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -5,9 +5,9 @@ "license": "EPL-2.0", "scripts": { "_phase:package": "rushx package", - "_phase:validate": "rm -rf ./types && compile validate", - "package": "rm -rf ./dist && cross-env NODE_ENV=production webpack --stats-error-details && echo 'done'", - "analyze": "rm -rf ./dist && cross-env NODE_ENV=production webpack --profile --json > stats.json", + "_phase:validate": "node -e \"require('fs').rmSync('./types',{recursive:true,force:true})\" && compile validate", + "package": "node -e \"require('fs').rmSync('./dist',{recursive:true,force:true})\" && cross-env NODE_ENV=production webpack --stats-error-details && echo done", + "analyze": "node -e \"require('fs').rmSync('./dist',{recursive:true,force:true})\" && cross-env NODE_ENV=production webpack --profile --json > stats.json", "show": "webpack-bundle-analyzer stats.json dist", "dev-server": "cross-env USE_CACHE=false CLIENT_TYPE=dev-server webpack serve", "dev-server-test": "cross-env USE_CACHE=false CLIENT_TYPE=dev-server-test webpack serve", diff --git a/dev/tool/package.json b/dev/tool/package.json index 120582d14f..3686df1287 100644 --- a/dev/tool/package.json +++ b/dev/tool/package.json @@ -15,7 +15,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../common/scripts/esbuild.js --entry=src/__start.ts --keep-names=true --external=snappy --sourcemap=external --define:MODEL_VERSION --define:GIT_REVISION", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/tool", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/tool", "docker:tbuild": "docker build -t hardcoreeng/tool . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/tool", "docker:abuild": "docker build -t hardcoreeng/tool . --platform=linux/arm64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/tool", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/tool staging", diff --git a/foundations/net/common/scripts/docker_build.js b/foundations/net/common/scripts/docker_build.js new file mode 100644 index 0000000000..b365c97c5e --- /dev/null +++ b/foundations/net/common/scripts/docker_build.js @@ -0,0 +1,55 @@ +// +// Copyright © 2024 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +const fs = require('fs') +const path = require('path') +const { execSync, spawnSync } = require('child_process') + +const image = process.argv[2] +if (!image) { + console.error('Usage: node docker_build.js [.]') + process.exit(1) +} + +const version = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim() +const cleanup = process.env.DOCKER_BUILD_CLEANUP === 'true' +const extra = (process.env.DOCKER_EXTRA || '').trim().split(/\s+/).filter(Boolean) + +console.log('Building version:', version) + +const dockerArgs = ['build', '-t', image, '-t', `${image}:${version}`, ...extra, '.'] +const result = spawnSync('docker', dockerArgs, { stdio: 'inherit', cwd: process.cwd() }) +if (result.status !== 0) { + process.exit(result.status) +} + +if (cleanup) { + console.log('Cleaning up build artifacts...') + const dirs = ['bundle', 'dist', '.rush'] + for (const dir of dirs) { + const fullPath = path.join(process.cwd(), dir) + if (fs.existsSync(fullPath)) { + console.log(' Removing', dir + '/') + fs.rmSync(fullPath, { recursive: true, force: true }) + } + } + // Skip du -sh on Windows (no du); optional on Unix + try { + const size = execSync('du -sh . 2>/dev/null | cut -f1', { encoding: 'utf8' }).trim() + if (size) console.log(' Size after cleanup:', size) + } catch (_) { + // ignore + } +} diff --git a/foundations/net/pods/network-pod/package.json b/foundations/net/pods/network-pod/package.json index de2ee912ee..5b0fdfd26b 100644 --- a/foundations/net/pods/network-pod/package.json +++ b/foundations/net/pods/network-pod/package.json @@ -24,7 +24,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../common/scripts/esbuild.js --entry=src/index.ts --keep-names=true --bundle=true --sourcemap=external --external=*.node --external=zeromq", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/network-pod", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/network-pod", "docker:tbuild": "docker build -t hardcoreeng/network-pod . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/network-pod", "docker:abuild": "docker build -t hardcoreeng/network-pod . --platform=linux/arm64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/network-pod", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/network-pod staging", diff --git a/foundations/net/pods/network-tool/package.json b/foundations/net/pods/network-tool/package.json index 2a7a8b99f5..fb7ed57b9b 100644 --- a/foundations/net/pods/network-tool/package.json +++ b/foundations/net/pods/network-tool/package.json @@ -23,7 +23,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../common/scripts/esbuild.js --entry=src/index.ts --keep-names=true --bundle=true --sourcemap=external --external=zeromq", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/network-tool", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/network-tool", "docker:tbuild": "docker build -t hardcoreeng/network-tool . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/network-tool", "docker:abuild": "docker build -t hardcoreeng/network-tool . --platform=linux/arm64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/network-tool", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/network-tool staging", diff --git a/pods/account/package.json b/pods/account/package.json index aab09111e2..8b708c9576 100644 --- a/pods/account/package.json +++ b/pods/account/package.json @@ -15,7 +15,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../common/scripts/esbuild.js --entry=src/__start.ts --keep-names=true --define=MODEL_VERSION --sourcemap=external --external=*.node --external=snappy", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/account", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/account", "docker:tbuild": "docker build -t hardcoreeng/account . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/account", "docker:abuild": "docker build -t hardcoreeng/account . --platform=linux/arm64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/account", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/account staging", diff --git a/pods/backup/package.json b/pods/backup/package.json index a1f8dba71f..73759670ac 100644 --- a/pods/backup/package.json +++ b/pods/backup/package.json @@ -16,7 +16,7 @@ "_phase:docker-staging": "rushx docker:staging", "get-model": "node ../../common/scripts/esbuild.js --entry=src/get-model.ts --keep-names=true --bundle=true --define=MODEL_VERSION --define=VERSION --define=GIT_REVISION && node ./bundle/bundle.js > ./bundle/model.json", "bundle": "rushx get-model && node ../../common/scripts/esbuild.js --entry=src/index.ts --keep-names=true --bundle=true --sourcemap=external --external=*.node", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/backup", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/backup", "docker:tbuild": "docker build -t hardcoreeng/backup . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/backup", "docker:abuild": "docker build -t hardcoreeng/backup . --platform=linux/arm64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/backup", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/backup staging", diff --git a/pods/collaborator/package.json b/pods/collaborator/package.json index 8382c53dff..8eb2e17b9a 100644 --- a/pods/collaborator/package.json +++ b/pods/collaborator/package.json @@ -14,7 +14,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../common/scripts/esbuild.js --entry=src/__start.ts --keep-names=true --sourcemap=external --external=*.node --external=snappy --external=bufferutil", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/collaborator", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/collaborator", "docker:tbuild": "docker build -t hardcoreeng/collaborator . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/collaborator", "docker:abuild": "docker build -t hardcoreeng/collaborator . --platform=linux/arm64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/collaborator", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/collaborator staging", diff --git a/pods/external/bin/build.js b/pods/external/bin/build.js new file mode 100644 index 0000000000..7b2927d068 --- /dev/null +++ b/pods/external/bin/build.js @@ -0,0 +1,76 @@ +// +// Copyright © 2024 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +const fs = require('fs') +const path = require('path') +const { spawnSync } = require('child_process') + +const cwd = process.cwd() +const registry = 'hardcoreeng' +const tag = 'latest' +const servicesDir = path.join(cwd, 'services.d') +const tempDir = path.join(cwd, '.build-cache') + +fs.mkdirSync(tempDir, { recursive: true }) + +const gitignorePath = path.join(cwd, '.gitignore') +const gitignoreEntry = '.build-cache' +if (fs.existsSync(gitignorePath)) { + const content = fs.readFileSync(gitignorePath, 'utf8') + if (!content.split(/\r?\n/).some(line => line.trim() === gitignoreEntry)) { + fs.appendFileSync(gitignorePath, '\n' + gitignoreEntry + '\n') + } +} else { + fs.writeFileSync(gitignorePath, gitignoreEntry + '\n') +} + +function getFirstLine(filePath) { + const content = fs.readFileSync(filePath, 'utf8') + const lines = content.split(/\r?\n/) + for (const line of lines) { + const trimmed = line.trim() + if (trimmed && !trimmed.startsWith('#')) { + return trimmed + } + } + return '' +} + +function dockerImageExists(image) { + const r = spawnSync('docker', ['image', 'inspect', image], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] }) + return r.status === 0 +} + +const serviceFiles = fs.readdirSync(servicesDir, { withFileTypes: true }) + .filter(d => d.isFile() && d.name.endsWith('.service') && !d.name.startsWith('-')) + .map(d => path.join(servicesDir, d.name)) + .sort() + +for (const file of serviceFiles) { + const line = getFirstLine(file) + const parts = line.split(/\s+/).map(p => p.trim()).filter(Boolean) + const targetRepo = parts[0] + const source = parts[1] + if (!targetRepo || !source) continue + + const target = `${registry}/${targetRepo}:${tag}` + if (dockerImageExists(target)) { + console.log('Exists (skipping):', target) + continue + } + spawnSync('docker', ['pull', '--quiet', source], { stdio: 'inherit', cwd }) + spawnSync('docker', ['tag', source, target], { stdio: 'inherit', cwd }) + console.log('Pull&Tag:', source, '->', target) +} diff --git a/pods/external/bin/push.js b/pods/external/bin/push.js new file mode 100644 index 0000000000..384fbe371e --- /dev/null +++ b/pods/external/bin/push.js @@ -0,0 +1,52 @@ +// +// Copyright © 2024 Hardcore Engineering Inc. +// +// Licensed under the Eclipse Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. You may +// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +const fs = require('fs') +const path = require('path') +const { execSync, spawnSync } = require('child_process') + +const cwd = process.cwd() +const registry = 'hardcoreeng' +const tag = execSync('git describe --tags --abbrev=0', { encoding: 'utf8', cwd }).trim() +const servicesDir = path.join(cwd, 'services.d') + +function getFirstLine(filePath) { + const content = fs.readFileSync(filePath, 'utf8') + const lines = content.split(/\r?\n/) + for (const line of lines) { + const trimmed = line.trim() + if (trimmed && !trimmed.startsWith('#')) { + return trimmed + } + } + return '' +} + +const serviceFiles = fs.readdirSync(servicesDir, { withFileTypes: true }) + .filter(d => d.isFile() && d.name.endsWith('.service') && !d.name.startsWith('-')) + .map(d => path.join(servicesDir, d.name)) + .sort() + +for (const file of serviceFiles) { + const line = getFirstLine(file) + const parts = line.split(/\s+/).map(p => p.trim()).filter(Boolean) + const targetRepo = parts[0] + const source = parts[1] + if (!targetRepo || !source) continue + + const target = `${registry}/${targetRepo}:${tag}` + spawnSync('docker', ['buildx', 'imagetools', 'create', '--tag', target, source], { stdio: 'inherit', cwd }) + console.log('Copy:', source, '->', target) +} diff --git a/pods/external/package.json b/pods/external/package.json index 642c034af5..673ee1d0c9 100644 --- a/pods/external/package.json +++ b/pods/external/package.json @@ -5,8 +5,8 @@ "license": "EPL-2.0", "scripts": { "_phase:docker-build": "rushx docker:build", - "docker:build": "sh bin/build.sh", - "docker:push": "sh bin/push.sh", + "docker:build": "node bin/build.js", + "docker:push": "node bin/push.js", "format": "true" }, "devDependencies": { diff --git a/pods/front/package.json b/pods/front/package.json index 0dcafc4bf4..13a44da5a5 100644 --- a/pods/front/package.json +++ b/pods/front/package.json @@ -15,8 +15,8 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../common/scripts/esbuild.js --entry=src/__start.ts --keep-names=true --define=MODEL_VERSION --define=VERSION --sourcemap=external --minify --external=sharp", - "package": "rm -rf ./dist && cp -r ../../dev/prod/dist . && cp -r ../../dev/prod/public/* ./dist/ && rm ./dist/config.json", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/front", + "package": "node ../../common/scripts/package-pod-front-copy.js", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/front", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/front staging", "docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/front", "docker:tbuild": "docker build -t hardcoreeng/front . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/front", diff --git a/pods/fulltext/package.json b/pods/fulltext/package.json index 9a1e495505..65cefcdd7d 100644 --- a/pods/fulltext/package.json +++ b/pods/fulltext/package.json @@ -16,7 +16,7 @@ "_phase:docker-staging": "rushx docker:staging", "get-model": "node ../../common/scripts/esbuild.js --entry=src/get-model.ts --keep-names=true --bundle=true --define=MODEL_VERSION --define=VERSION --define=GIT_REVISION && node ./bundle/bundle.js > ./bundle/model.json", "bundle": "rushx get-model && node ../../common/scripts/esbuild.js --keep-names=true --bundle=true --external=*.node --external=snappy --sourcemap=external", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/fulltext", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/fulltext", "docker:tbuild": "docker build -t hardcoreeng/fulltext . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/fulltext", "docker:abuild": "docker build -t hardcoreeng/fulltext . --platform=linux/arm64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/fulltext", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/fulltext staging", diff --git a/pods/link-preview/package.json b/pods/link-preview/package.json index 2e38b6030d..7146d362b2 100644 --- a/pods/link-preview/package.json +++ b/pods/link-preview/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../common/scripts/esbuild.js --keep-names=true --sourcemap=external", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/link-preview", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/link-preview", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/link-preview staging", "docker:abuild": "docker build -t hardcoreeng/link-preview . --platform=linux/arm64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/link-preview", "docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/link-preview", diff --git a/pods/media/package.json b/pods/media/package.json index cc247593ae..e6ea6dfcd7 100644 --- a/pods/media/package.json +++ b/pods/media/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../common/scripts/esbuild.js --external=ws", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/media", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/media", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/media staging", "docker:abuild": "docker build -t hardcoreeng/media . --platform=linux/arm64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/media", "docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/media", diff --git a/pods/preview/package.json b/pods/preview/package.json index 8d199f98bc..10a7bf3502 100644 --- a/pods/preview/package.json +++ b/pods/preview/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../common/scripts/esbuild.js --keep-names=true --sourcemap=external --external=sharp", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/preview", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/preview", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/preview staging", "docker:abuild": "docker build -t hardcoreeng/preview . --platform=linux/arm64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/preview", "docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/preview", diff --git a/pods/server/package.json b/pods/server/package.json index 6a2485129f..ada905e1a5 100644 --- a/pods/server/package.json +++ b/pods/server/package.json @@ -18,7 +18,7 @@ "_phase:docker-staging": "rushx docker:staging", "get-model": "node ../../common/scripts/esbuild.js --entry=src/get-model.ts -keep-names=true --define=MODEL_VERSION --define=VERSION --define=GIT_REVISION --bundle=true && node ./bundle/bundle.js > ./bundle/model.json", "bundle": "rushx get-model && node ../../common/scripts/esbuild.js --entry=src/__start.ts --keep-names=true --bundle=true --sourcemap=external --external=*.node --external=bufferutil --external=snappy --define=MODEL_VERSION --define=VERSION --define=GIT_REVISION --external=utf-8-validate --external=msgpackr-extract", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/transactor", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/transactor", "docker:tbuild": "docker build -t hardcoreeng/transactor . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/transactor", "docker:abuild": "docker build -t hardcoreeng/transactor . --platform=linux/arm64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/transactor", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/transactor staging", diff --git a/pods/stats/package.json b/pods/stats/package.json index 511b957a5e..cc8f4bc8e6 100644 --- a/pods/stats/package.json +++ b/pods/stats/package.json @@ -15,7 +15,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../common/scripts/esbuild.js --entry=src/__start.ts --keep-names=true --sourcemap=external --define=MODEL_VERSION --external=*.node --external=snappy", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/stats", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/stats", "docker:tbuild": "docker build -t hardcoreeng/stats . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/stats", "docker:abuild": "docker build -t hardcoreeng/stats . --platform=linux/arm64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/stats", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/stats staging", diff --git a/pods/workspace/package.json b/pods/workspace/package.json index b62745cb84..d3e77eb8ec 100644 --- a/pods/workspace/package.json +++ b/pods/workspace/package.json @@ -15,7 +15,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../common/scripts/esbuild.js --entry=src/__start.ts --keep-names=true --sourcemap=external --external=*.node --define=MODEL_VERSION --external=snappy --minify=true", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/workspace", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/workspace", "docker:tbuild": "docker build -t hardcoreeng/workspace . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/workspace", "docker:abuild": "docker build -t hardcoreeng/workspace . --platform=linux/arm64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/workspace", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/workspace staging", diff --git a/qms-desktop-package/package.json b/qms-desktop-package/package.json index 27b3843c5d..c9f17a134f 100644 --- a/qms-desktop-package/package.json +++ b/qms-desktop-package/package.json @@ -6,7 +6,7 @@ "template": "@hcengineering/default-package", "scripts": { "_phase:package": "rushx package", - "package": "rm -rf ./dist && cp -r ../desktop/dist . && cp ../desktop/.env ./dist && cp src/AppIcon.png ./dist/ui/public && cp src/AppIcon.ico ./dist/ui/public && echo 'done'", + "package": "node ../common/scripts/package-desktop-copy.js --with-icons && echo done", "dist": "cross-env CSC_IDENTITY_AUTO_DISCOVERY=false NODE_ENV=production VERSION=$(node ../common/scripts/show_tag.js) MODEL_VERSION=$(node ../common/scripts/show_version.js) electron-builder build -p onTag", "dist-local": "cross-env CSC_IDENTITY_AUTO_DISCOVERY=false NODE_ENV=production VERSION=$(node ../common/scripts/show_tag.js) MODEL_VERSION=$(node ../common/scripts/show_version.js) electron-builder build", "dist-signed": "cross-env CSC_IDENTITY_AUTO_DISCOVERY=true NODE_ENV=production VERSION=$(node ../common/scripts/show_tag.js) MODEL_VERSION=$(node ../common/scripts/show_version.js) electron-builder build -c.afterSign=scripts/notarize.js -p onTag", diff --git a/services/ai-bot/love-agent/package.json b/services/ai-bot/love-agent/package.json index 3604096cc6..98ed2a2096 100644 --- a/services/ai-bot/love-agent/package.json +++ b/services/ai-bot/love-agent/package.json @@ -13,7 +13,7 @@ "type": "module", "scripts": { "build": "node esbuild.config.js", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/love-agent", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/love-agent", "docker:push": "../../../common/scripts/docker_tag.sh hardcoreeng/love-agent", "lint": "eslint src/**/*.ts", "lint:fix": "eslint --fix src/**/*.ts", diff --git a/services/ai-bot/pod-ai-bot/package.json b/services/ai-bot/pod-ai-bot/package.json index 335184a08e..e0275100d3 100644 --- a/services/ai-bot/pod-ai-bot/package.json +++ b/services/ai-bot/pod-ai-bot/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/ai-bot", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/ai-bot", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/ai-bot staging", "docker:push": "../../../common/scripts/docker_tag.sh hardcoreeng/ai-bot", "docker:tbuild": "rush bundle --to @hcengineering/pod-ai-bot && docker build -t hardcoreeng/ai-bot . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/ai-bot", diff --git a/services/analytics-collector/pod-analytics-collector/package.json b/services/analytics-collector/pod-analytics-collector/package.json index 5dd90a2eee..a335141d18 100644 --- a/services/analytics-collector/pod-analytics-collector/package.json +++ b/services/analytics-collector/pod-analytics-collector/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/analytics-collector", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/analytics-collector", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/analytics-collector staging", "docker:push": "../../../common/scripts/docker_tag.sh hardcoreeng/analytics-collector", "docker:tbuild": "rush bundle --to @hcengineering/pod-analytics-collector && docker build -t hardcoreeng/analytics-collector . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/analytics-collector", diff --git a/services/backup/backup-api-pod/package.json b/services/backup/backup-api-pod/package.json index 1cc005d2e4..a7c706c485 100644 --- a/services/backup/backup-api-pod/package.json +++ b/services/backup/backup-api-pod/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js --keep-names=true --sourcemap=external", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/backup-api", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/backup-api", "docker:tbuild": "docker build -t hardcoreeng/backup-api . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/backup-api", "docker:abuild": "docker build -t hardcoreeng/backup-api . --platform=linux/arm64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/backup-api", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/backup-api staging", diff --git a/services/billing/pod-billing/package.json b/services/billing/pod-billing/package.json index 25ca193fcf..7b3b9696db 100644 --- a/services/billing/pod-billing/package.json +++ b/services/billing/pod-billing/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js --keep-names=true --sourcemap=external", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/billing", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/billing", "docker:tbuild": "docker build -t hardcoreeng/billing . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/billing", "docker:abuild": "docker build -t hardcoreeng/billing . --platform=linux/arm64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/billing", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/billing staging", diff --git a/services/calendar/pod-calendar-mailer/package.json b/services/calendar/pod-calendar-mailer/package.json index 16f11c2d50..e20ca18aea 100644 --- a/services/calendar/pod-calendar-mailer/package.json +++ b/services/calendar/pod-calendar-mailer/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js --external=ws", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/calendar-mailer", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/calendar-mailer", "docker:tbuild": "docker build -t hardcoreeng/calendar-mailer . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/calendar-mailer", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/calendar-mailer staging", "docker:push": "../../../common/scripts/docker_tag.sh hardcoreeng/calendar-mailer", diff --git a/services/calendar/pod-calendar/package.json b/services/calendar/pod-calendar/package.json index 6e36ed3bbf..cbfbe3bc5a 100644 --- a/services/calendar/pod-calendar/package.json +++ b/services/calendar/pod-calendar/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/calendar", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/calendar", "docker:tbuild": "docker build -t hardcoreeng/calendar . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/calendar", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/calendar staging", "docker:push": "../../../common/scripts/docker_tag.sh hardcoreeng/calendar", diff --git a/services/datalake/pod-datalake/package.json b/services/datalake/pod-datalake/package.json index 29e18e1d50..8fdc13f9cc 100644 --- a/services/datalake/pod-datalake/package.json +++ b/services/datalake/pod-datalake/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js --keep-names=true --sourcemap=external", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/datalake", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/datalake", "docker:tbuild": "docker build -t hardcoreeng/datalake . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/datalake", "docker:abuild": "docker build -t hardcoreeng/datalake . --platform=linux/arm64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/datalake", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/datalake staging", diff --git a/services/export/pod-export/package.json b/services/export/pod-export/package.json index 244e6aadc7..00cde3ce7f 100644 --- a/services/export/pod-export/package.json +++ b/services/export/pod-export/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js --keep-names=true", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/export", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/export", "docker:tbuild": "docker build -t hardcoreeng/export . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/export", "docker:abuild": "docker build -t hardcoreeng/export . --platform=linux/arm64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/export", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/export staging", diff --git a/services/github/pod-github/package.json b/services/github/pod-github/package.json index 5ef2266136..94b3a07aa7 100644 --- a/services/github/pod-github/package.json +++ b/services/github/pod-github/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js --sourcemap=external", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/github", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/github", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/github staging", "docker:push": "../../../common/scripts/docker_tag.sh hardcoreeng/github", "docker:tbuild": "rush bundle --to @hcengineering/pod-github && docker build -t hardcoreeng/github . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/github", diff --git a/services/gmail/pod-gmail/package.json b/services/gmail/pod-gmail/package.json index ae4d643498..ed43d653e7 100644 --- a/services/gmail/pod-gmail/package.json +++ b/services/gmail/pod-gmail/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/gmail", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/gmail", "docker:tbuild": "docker build -t hardcoreeng/gmail . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/gmail", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/gmail staging", "docker:push": "../../../common/scripts/docker_tag.sh hardcoreeng/gmail", diff --git a/services/love/package.json b/services/love/package.json index 1282ffaad1..991c9bb747 100644 --- a/services/love/package.json +++ b/services/love/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../common/scripts/esbuild.js", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/love .", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/love .", "docker:tbuild": "docker build -t hardcoreeng/love . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/love", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/love staging", "docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/love", diff --git a/services/mail/pod-mail-worker/package.json b/services/mail/pod-mail-worker/package.json index 575f09c891..c81fdccf7f 100644 --- a/services/mail/pod-mail-worker/package.json +++ b/services/mail/pod-mail-worker/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js --external=ws", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/mail-worker", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/mail-worker", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/mail-worker staging", "docker:abuild": "docker build -t hardcoreeng/mail-worker . --platform=linux/arm64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/mail-worker", "docker:push": "../../../common/scripts/docker_tag.sh hardcoreeng/mail-worker", diff --git a/services/mail/pod-mail/package.json b/services/mail/pod-mail/package.json index 19132ab542..fa01576b26 100644 --- a/services/mail/pod-mail/package.json +++ b/services/mail/pod-mail/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/mail", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/mail", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/mail staging", "docker:abuild": "docker build -t hardcoreeng/mail . --platform=linux/arm64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/mail", "docker:push": "../../../common/scripts/docker_tag.sh hardcoreeng/mail", diff --git a/services/notification/pod-notification/package.json b/services/notification/pod-notification/package.json index b7c1f001ed..9acb57c093 100644 --- a/services/notification/pod-notification/package.json +++ b/services/notification/pod-notification/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/notification", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/notification", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/notification staging", "docker:abuild": "docker build -t hardcoreeng/notification . --platform=linux/arm64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/notification", "docker:push": "../../../common/scripts/docker_tag.sh hardcoreeng/notification", diff --git a/services/payment/pod-payment/package.json b/services/payment/pod-payment/package.json index 3873e848a3..42e3b141df 100644 --- a/services/payment/pod-payment/package.json +++ b/services/payment/pod-payment/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js --keep-names=true --sourcemap=external", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/payment", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/payment", "docker:tbuild": "docker build -t hardcoreeng/payment . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/payment", "docker:abuild": "docker build -t hardcoreeng/payment . --platform=linux/arm64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/payment", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/payment staging", diff --git a/services/print/pod-print/package.json b/services/print/pod-print/package.json index 288c52acf5..8d505390fb 100644 --- a/services/print/pod-print/package.json +++ b/services/print/pod-print/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js --keep-names=true", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/print", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/print", "docker:tbuild": "docker build -t hardcoreeng/print . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/print", "docker:abuild": "docker build -t hardcoreeng/print . --platform=linux/arm64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/print", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/print staging", diff --git a/services/process/package.json b/services/process/package.json index 1bfba81d09..7b239aafbf 100644 --- a/services/process/package.json +++ b/services/process/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../common/scripts/esbuild.js", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/process .", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/process .", "docker:tbuild": "docker build -t hardcoreeng/process . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/process", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/process staging", "docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/process", diff --git a/services/rating/package.json b/services/rating/package.json index 18ec4992eb..1c92143899 100644 --- a/services/rating/package.json +++ b/services/rating/package.json @@ -16,7 +16,7 @@ "_phase:docker-staging": "rushx docker:staging", "get-model": "node ../../common/scripts/esbuild.js --entry=src/get-model.ts --keep-names=true --bundle=true --define=MODEL_VERSION --define=VERSION --define=GIT_REVISION && node ./bundle/bundle.js > ./bundle/model.json", "bundle": "rushx get-model && node ../../common/scripts/esbuild.js --entry=./src/__start__.ts --keep-names=true --bundle=true --external=*.node --external=snappy --sourcemap=external", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/rating", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/rating", "docker:tbuild": "docker build -t hardcoreeng/rating . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/rating", "docker:abuild": "docker build -t hardcoreeng/rating . --platform=linux/arm64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/rating", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/rating staging", diff --git a/services/rekoni/package.json b/services/rekoni/package.json index 357fa2bc9e..c8e3e64a81 100644 --- a/services/rekoni/package.json +++ b/services/rekoni/package.json @@ -16,7 +16,7 @@ "_phase:bundle": "rushx bundle", "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/rekoni-service", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/rekoni-service", "docker:tbuild": "docker build -t hardcoreeng/rekoni-service . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/rekoni-service", "docker:abuild": "docker build -t hardcoreeng/rekoni-service . --platform=linux/arm64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/rekoni-service", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/rekoni-service staging", diff --git a/services/sign/pod-sign/package.json b/services/sign/pod-sign/package.json index 1191a76218..e0276bba7f 100644 --- a/services/sign/pod-sign/package.json +++ b/services/sign/pod-sign/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/sign", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/sign", "docker:tbuild": "docker build -t hardcoreeng/sign . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/sign", "docker:abuild": "docker build -t hardcoreeng/sign . --platform=linux/arm64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/sign", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/sign staging", diff --git a/services/telegram-bot/pod-telegram-bot/package.json b/services/telegram-bot/pod-telegram-bot/package.json index f6221c2ccd..2c5816c211 100644 --- a/services/telegram-bot/pod-telegram-bot/package.json +++ b/services/telegram-bot/pod-telegram-bot/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/telegram-bot", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/telegram-bot", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/telegram-bot staging", "docker:push": "../../../common/scripts/docker_tag.sh hardcoreeng/telegram-bot", "run-local": "cross-env ts-node src/index.ts", diff --git a/services/telegram/pod-telegram/package.json b/services/telegram/pod-telegram/package.json index 4ba49a133e..dc0199cde9 100644 --- a/services/telegram/pod-telegram/package.json +++ b/services/telegram/pod-telegram/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../../common/scripts/esbuild.js", - "docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/telegram", + "docker:build": "node ../../../common/scripts/docker_build.js hardcoreeng/telegram", "docker:tbuild": "docker build -t hardcoreeng/telegram . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/telegram", "docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/telegram staging", "docker:push": "../../../common/scripts/docker_tag.sh hardcoreeng/telegram", diff --git a/services/translate/package.json b/services/translate/package.json index 9fd4f14bc6..1d3f20f477 100644 --- a/services/translate/package.json +++ b/services/translate/package.json @@ -18,7 +18,7 @@ "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", "bundle": "node ../../common/scripts/esbuild.js", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/translate .", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/translate .", "docker:tbuild": "docker build -t hardcoreeng/translate . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/translate", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/translate staging", "docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/translate", diff --git a/services/worker/package.json b/services/worker/package.json index e612d0bd82..cad4fb5af7 100644 --- a/services/worker/package.json +++ b/services/worker/package.json @@ -18,7 +18,7 @@ "_phase:bundle": "rushx bundle", "_phase:docker-build": "rushx docker:build", "_phase:docker-staging": "rushx docker:staging", - "docker:build": "../../common/scripts/docker_build.sh hardcoreeng/worker .", + "docker:build": "node ../../common/scripts/docker_build.js hardcoreeng/worker .", "docker:tbuild": "docker build -t hardcoreeng/worker . --platform=linux/amd64 && ../../common/scripts/docker_tag_push.sh hardcoreeng/worker", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/worker staging", "docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/worker",