-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to build Theia IDE based on local Theia sources #304
Build on Eclipse CI Contributed on behalf of STMicroelectronics Signed-off-by: Johannes Faltermeier <[email protected]>
- Loading branch information
1 parent
40c7244
commit b427187
Showing
1 changed file
with
107 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,7 @@ spec: | |
container('theia-dev') { | ||
withCredentials([string(credentialsId: "github-bot-token", variable: 'GITHUB_TOKEN')]) { | ||
script { | ||
buildNext(false, 1200) | ||
buildNext() | ||
} | ||
} | ||
} | ||
|
@@ -78,7 +78,8 @@ spec: | |
} | ||
steps { | ||
script { | ||
buildNext(false, 60) | ||
sh "ls -al" | ||
// buildNext() | ||
} | ||
} | ||
post { | ||
|
@@ -94,8 +95,8 @@ spec: | |
steps { | ||
script { | ||
sh "npm config set msvs_version 2017" | ||
sh "npx node-gyp install 14.20.0" | ||
buildNext(true, 60) | ||
// sh "npx node-gyp@9.4.0 install 14.20.0" | ||
// buildNext() | ||
} | ||
} | ||
post { | ||
|
@@ -123,70 +124,115 @@ spec: | |
} | ||
} | ||
|
||
def buildNext(boolean runTests, int sleepBetweenRetries) { | ||
int MAX_RETRY = 3 | ||
|
||
checkout scm | ||
|
||
// merge next branch into master to get any known fixes for next version | ||
// TODO there might be a more elegant way to merge a branch into this one | ||
// using a jenkings plugin from here | ||
def buildNext() { | ||
sh "git config user.email \"[email protected]\"" | ||
sh "git config user.name \"Not a real user\"" | ||
sh "git fetch origin next" | ||
sh "git merge FETCH_HEAD" | ||
sh "node --version" | ||
|
||
sh "export NODE_OPTIONS=--max_old_space_size=4096" | ||
cleanWs() | ||
checkout scm | ||
sh "git clone https://github.com/eclipse-theia/theia.git" | ||
|
||
// regular build | ||
sh "printenv && yarn cache dir" | ||
sh ''' | ||
mkdir cache | ||
export LOCAL_CACHE_PATH=${PWD}/cache | ||
echo $LOCAL_CACHE_PATH | ||
sh "yarn cache clean" | ||
try { | ||
sh(script: 'yarn --frozen-lockfile --force') | ||
} catch(error) { | ||
retry(MAX_RETRY) { | ||
sleep(sleepBetweenRetries) | ||
echo "yarn failed - Retrying" | ||
sh(script: 'yarn --frozen-lockfile --force') | ||
} | ||
} | ||
mkdir verdaccio | ||
export VERDACCIO_STORAGE_PATH=${PWD}/verdaccio | ||
echo $VERDACCIO_STORAGE_PATH | ||
cd verdaccio | ||
export npm_config_cache=$VERDACCIO_STORAGE_PATH | ||
touch .npmrc | ||
mkdir node_modules | ||
pwd | ||
ls -al | ||
npm install verdaccio | ||
ls -al | ||
echo "Starting verdaccio" | ||
REGISTRY=http://localhost:4873/ | ||
npx verdaccio & | ||
VERDACCIO_PID=$! | ||
echo $VERDACCIO_PID | ||
echo "Updating theia versions to next" | ||
sh "yarn update:next" | ||
try { | ||
sh(script: 'yarn --force') | ||
} catch(error) { | ||
retry(MAX_RETRY) { | ||
sleep(sleepBetweenRetries) | ||
echo "yarn failed - Retrying" | ||
sh(script: 'yarn --force') | ||
} | ||
} | ||
echo "Build Theia..." | ||
cd ../theia | ||
npm config set registry $REGISTRY | ||
yarn config set registry $REGISTRY | ||
npm config set cache $LOCAL_CACHE_PATH | ||
yarn | ||
yarn build | ||
echo "Upgrading versions" | ||
sh "yarn upgrade" | ||
sh "git clean -xfd" | ||
try { | ||
sh(script: 'yarn --force') | ||
} catch(error) { | ||
retry(MAX_RETRY) { | ||
sleep(sleepBetweenRetries) | ||
echo "yarn failed - Retrying" | ||
sh(script: 'yarn --force') | ||
} | ||
} | ||
echo "Publish Theia..." | ||
yarn lerna publish preminor --exact --canary --preid next --dist-tag next --no-git-reset --no-git-tag-version --no-push --yes --registry $REGISTRY | ||
sh "rm -rf ./${distFolder}" | ||
sh "yarn build" | ||
sh "yarn download:plugins" | ||
sshagent(['projects-storage.eclipse.org-bot-ssh']) { | ||
sh "yarn electron package:preview" | ||
} | ||
if (runTests) { | ||
wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) { | ||
sh 'yarn electron test' | ||
} | ||
} | ||
echo "Stop Verdaccio" | ||
kill $VERDACCIO_PID | ||
''' | ||
|
||
// int MAX_RETRY = 3 | ||
|
||
// checkout scm | ||
|
||
// // merge next branch into master to get any known fixes for next version | ||
// // TODO there might be a more elegant way to merge a branch into this one | ||
// // using a jenkings plugin from here | ||
// sh "git config user.email \"[email protected]\"" | ||
// sh "git config user.name \"Not a real user\"" | ||
// sh "git fetch origin next" | ||
// sh "git merge FETCH_HEAD" | ||
// sh "node --version" | ||
|
||
// sh "export NODE_OPTIONS=--max_old_space_size=4096" | ||
|
||
// // regular build | ||
// sh "printenv && yarn cache dir" | ||
|
||
// sh "yarn cache clean" | ||
// try { | ||
// sh(script: 'yarn --frozen-lockfile --force') | ||
// } catch(error) { | ||
// retry(MAX_RETRY) { | ||
// sleep(sleepBetweenRetries) | ||
// echo "yarn failed - Retrying" | ||
// sh(script: 'yarn --frozen-lockfile --force') | ||
// } | ||
// } | ||
|
||
// echo "Updating theia versions to next" | ||
// sh "yarn update:next" | ||
// try { | ||
// sh(script: 'yarn --force') | ||
// } catch(error) { | ||
// retry(MAX_RETRY) { | ||
// sleep(sleepBetweenRetries) | ||
// echo "yarn failed - Retrying" | ||
// sh(script: 'yarn --force') | ||
// } | ||
// } | ||
|
||
// echo "Upgrading versions" | ||
// sh "yarn upgrade" | ||
// sh "git clean -xfd" | ||
// try { | ||
// sh(script: 'yarn --force') | ||
// } catch(error) { | ||
// retry(MAX_RETRY) { | ||
// sleep(sleepBetweenRetries) | ||
// echo "yarn failed - Retrying" | ||
// sh(script: 'yarn --force') | ||
// } | ||
// } | ||
|
||
// sh "rm -rf ./${distFolder}" | ||
// sh "yarn build" | ||
// sh "yarn download:plugins" | ||
// sshagent(['projects-storage.eclipse.org-bot-ssh']) { | ||
// sh "yarn electron package:preview" | ||
// } | ||
// if (runTests) { | ||
// wrap([$class: 'Xvnc', takeScreenshot: false, useXauthority: true]) { | ||
// sh 'yarn electron test' | ||
// } | ||
// } | ||
} |