Skip to content

Commit

Permalink
[jenkins] update Jenkinsfile, build scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Dumais <marc.dumais@ericsson.com>
  • Loading branch information
marcdumais-work committed Jul 4, 2023
1 parent 3597394 commit 9c19c70
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 70 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
shell: bash
run: |
yarn --skip-integrity-check --network-timeout 100000
yarn build
yarn electron package:preview
yarn build:dev
yarn package:applications:preview
env:
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9
Expand Down
41 changes: 23 additions & 18 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -245,30 +245,35 @@ spec:
}

def buildInstaller(int sleepBetweenRetries, boolean excludeBrowser) {
int MAX_RETRY = 3
int maxRetry = 3
String buildPackageCmd

checkout scm
if (excludeBrowser) {
sh "npm install -g ts-node typescript '@types/node'"
sh "ts-node scripts/patch-workspaces.ts"
buildPackageCmd = 'yarn --frozen-lockfile --force && \
yarn build:application:electron'
} else {
buildPackageCmd = 'yarn --frozen-lockfile --force && \
yarn build:applications'
}
sh "node --version"
sh "export NODE_OPTIONS=--max_old_space_size=4096"
sh "printenv && yarn cache dir"
sh "yarn cache clean"

sh 'node --version'
sh 'export NODE_OPTIONS=--max_old_space_size=4096'
sh 'printenv && yarn cache dir'
try {
sh(script: 'yarn --frozen-lockfile --force && yarn build')
} catch(error) {
retry(MAX_RETRY) {
sh(script: buildPackageCmd)
} catch (error) {
retry(maxRetry) {
sleep(sleepBetweenRetries)
echo "yarn failed - Retrying"
sh(script: 'yarn --frozen-lockfile --force && yarn build')
echo 'yarn failed - Retrying'
sh(script: buildPackageCmd)
}
}

sh "rm -rf ./${distFolder}"
// sh "rm -rf ./${distFolder}"
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
sh "yarn electron deploy"
// sh 'yarn electron deploy'
sh 'yarn package:applications:prod'
}
}

Expand Down Expand Up @@ -323,17 +328,17 @@ def notarizeInstaller(String ext) {
}

def updateMetadata(String executable, String yaml, String platform, int sleepBetweenRetries) {
int MAX_RETRY = 4
int maxRetry = 4
try {
sh "export NODE_OPTIONS=--max_old_space_size=4096"
sh "yarn install --force && yarn build:prod"
sh "yarn install --force && yarn build"
sh "yarn electron update:blockmap -e ${executable}"
sh "yarn electron update:checksum -e ${executable} -y ${yaml} -p ${platform}"
} catch(error) {
retry(MAX_RETRY) {
retry(maxRetry) {
sleep(sleepBetweenRetries)
echo "yarn failed - Retrying"
sh "yarn install --force && yarn build:prod"
sh "yarn install --force && yarn build"
sh "yarn electron update:blockmap -e ${executable}"
sh "yarn electron update:checksum -e ${executable} -y ${yaml} -p ${platform}"
}
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,30 @@ Documentation on how to package Theia as a Desktop Product may be found [here](h

### Build

For development and casual testing of Blueprint and its various packagings:

```sh
# quicker, uses less resources, but the front end app is not "minified"
yarn && yarn build:dev
# pre-packaged version of the app. Look under `applications/electron/dist/`
yarn package:applications:preview

# build packages based on dev build
yarn package:applications # will build .AppImage and .deb packages on Linux
yarn package:applications:prod
```

To produce production packages:

Which packages are produced vary by operating system. See `electron-builder.yml` for the details.

```sh
yarn && yarn build
# generate unpacked, pre-packaged app - good for early testing
yarn package:applications:preview
# when all looks good, produce "production" packages. They will be under
# e.g. `applications/electron/dist`
yarn package:applications:prod
```

### Package the Electron Application
Expand Down
8 changes: 3 additions & 5 deletions applications/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,11 @@
},
"scripts": {
"clean": "theia clean && rimraf node_modules",
"build": "yarn bundle",
"build:prod": "yarn bundle:prod",
"bundle": "theia build --app-target=\"browser\" --mode development",
"bundle:prod": "theia build --app-target=\"browser\"",
"build": "theia build --app-target=\"browser\" --mode development",
"build:prod": "theia build --app-target=\"browser\"",
"rebuild": "theia rebuild:browser --cacheRoot ../..",
"start": "yarn -s rebuild && theia start --plugins=local-dir:../../plugins",
"watch": "concurrently --kill-others -n tsc,bundle -c red,yellow \"tsc -b -w --preserveWatchOutput\" \"yarn -s watch:bundle\"",
"watch": "concurrently --kill-others -n tsc,build -c red,yellow \"tsc -b -w --preserveWatchOutput\" \"yarn -s watch:bundle\"",
"update:next": "ts-node ../../scripts/update-theia-to-next.ts"
}
}
18 changes: 8 additions & 10 deletions applications/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,19 @@
"scripts": {
"clean": "theia clean && rimraf node_modules",
"clean:dist": "rimraf dist",
"build": "yarn -s bundle",
"build:prod": "yarn -s bundle:prod",
"bundle": "theia build --app-target=\"electron\" --mode development",
"bundle:prod": "theia build --app-target=\"electron\"",
"build": "theia build --app-target=\"electron\" --mode development",
"build:prod": "theia build --app-target=\"electron\"",
"rebuild": "theia rebuild:electron --cacheRoot ../..",
"watch": "concurrently -n compile,bundle \"theiaext watch --preserveWatchOutput\" \"theia build --watch --mode development\"",
"start": "yarn -s rebuild && electron scripts/theia-electron-main.js --plugins=local-dir:../../plugins",
"watch": "concurrently -n compile,build \"theiaext watch --preserveWatchOutput\" \"theia build --watch --mode development\"",
"start": "yarn rebuild && electron scripts/theia-electron-main.js --plugins=local-dir:../../plugins",
"start:debug": "yarn start --log-level=debug",
"package": "yarn clean:dist && yarn -s rebuild && electron-builder -c.mac.identity=null --publish never",
"deploy": "yarn clean:dist && yarn -s rebuild && electron-builder -c.mac.identity=null --publish always",
"package:preview": "yarn clean:dist && yarn -s rebuild && electron-builder -c.mac.identity=null --dir",
"package": "yarn clean:dist && yarn rebuild && electron-builder -c.mac.identity=null --publish never",
"package:prod": "yarn deploy",
"deploy": "yarn clean:dist && yarn rebuild && electron-builder -c.mac.identity=null --publish always",
"package:preview": "yarn clean:dist && yarn rebuild && electron-builder -c.mac.identity=null --dir",
"update:checksum": "ts-node scripts/update-checksum.ts",
"update:blockmap": "ts-node scripts/update-blockmap.ts",
"update:next": "ts-node ../../scripts/update-theia-to-next.ts",

"test": "mocha --timeout 60000 \"./test/*.spec.js\""
}
}
2 changes: 1 addition & 1 deletion applications/electron/scripts/theia-electron-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const os = require('os')
// process.env.VSCODE_API_VERSION = '1.50.0'

// Use a set of builtin plugins in our application.
process.env.THEIA_DEFAULT_PLUGINS = `local-dir:${path.resolve(__dirname, '..', 'plugins')}`
process.env.THEIA_DEFAULT_PLUGINS = `local-dir:${path.resolve(__dirname, '../', 'plugins')}`

// Lookup inside the user's home folder for more plugins, and accept user-defined paths.
process.env.THEIA_PLUGINS = [
Expand Down
15 changes: 12 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,23 @@
"yargs": "17.2.1"
},
"scripts": {

"lint": "lerna run lint",
"lint:fix": "lerna run lint:fix",
"clean": "lerna run clean && rimraf node_modules",
"build": "yarn build:extensions && yarn build:applications && yarn download:plugins",
"build:dev": "yarn build:base && yarn build:applications:dev",
"build:base": "yarn build:extensions && yarn download:plugins",
"build": "yarn build:base && yarn build:applications",
"build:extensions": "lerna run --scope=\"blueprint*ext\" build",
"build:applications": "lerna run --scope=\"blueprint*app\" build --concurrency 1",
"build:applications:dev": "yarn build:base && lerna run --scope=\"blueprint*app\" build --concurrency 1",
"build:applications:electron:dev": "yarn build:base && lerna run --scope=\"blueprint-electron-app\" build --concurrency 1",
"build:applications:browser:dev": "yarn build:base && lerna run --scope=\"blueprint-browser-app\" build --concurrency 1",
"build:applications": "yarn build:base && lerna run --scope=\"blueprint*app\" build:prod --concurrency 1",
"build:application:electron": "yarn build:base && lerna run --scope=\"blueprint-electron-app\" build:prod --concurrency 1",
"build:application:browser": "yarn build:base && lerna run --scope=\"blueprint-browser-app\" build:prod --concurrency 1",
"download:plugins": "theia download:plugins --rate-limit=15 --parallel=false --ignore-errors",
"package:applications": "lerna run --scope=\"blueprint*app\" package --concurrency 1",
"package:applications:preview": "lerna run --scope=\"blueprint*app\" package:preview --concurrency 1",
"package:applications:prod": "lerna run --scope=\"blueprint*app\" package:prod --concurrency 1",
"watch": "lerna run --parallel watch",
"test": "lerna run test",
"electron": "yarn --cwd applications/electron",
Expand Down
31 changes: 0 additions & 31 deletions scripts/patch-workspaces.ts

This file was deleted.

0 comments on commit 9c19c70

Please sign in to comment.