Skip to content

Commit

Permalink
#261 Setup nightly deployment
Browse files Browse the repository at this point in the history
Setup nightly deployment for new mono repo.
- Add dedicated scripts for publishing  releases (publish:latest) and nightly snapshots (publish:nightly) using lerna.
- Update lerna config

Additional changes:
- Update eslint config. After the mono-repo switch the config was no longer working with the eslint vscode extension. Added a new root .eslint.rc + tsconfig.json to fix that.
- Ignore warnings related to source map parsing in the example webpack config
- Add schema property to `base.tsconfig.json`

Closes #261
  • Loading branch information
tortmayr committed Jan 17, 2022
1 parent 4ac97c1 commit 80e1c30
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 22 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,9 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: ['./configs/.eslintrc.js'],
ignorePatterns: ['**/{node_modules,lib}'],
parserOptions: {
tsconfigRootDir: __dirname,
project: 'tsconfig.json'
}
};
3 changes: 0 additions & 3 deletions .vscode/settings.json
@@ -1,7 +1,4 @@
{
"eslint.options": {
"configFile": "configs/.eslintrc.js"
},
"eslint.packageManager": "yarn",
"search.exclude": {
"**/node_modules": true,
Expand Down
17 changes: 13 additions & 4 deletions Jenkinsfile
Expand Up @@ -37,9 +37,9 @@ pipeline {
YARN_CACHE_FOLDER = "${env.WORKSPACE}/yarn-cache"
SPAWN_WRAP_SHIM_ROOT = "${env.WORKSPACE}"
}

stages {
stage('Build sprotty') {
stage('Build sprotty') {
steps {
container('node') {
sh "yarn install"
Expand All @@ -49,13 +49,22 @@ pipeline {
}

stage('Deploy (master only)') {
when { branch 'master'}
when {
allOf {
branch 'master'
expression {
/* Only trigger the deployment job if the changeset contains changes in
the `packages` directory */
sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^packages"') == 0
}
}
}
steps {
build job: 'deploy-sprotty', wait: false
}
}
}

post {
success {
junit 'packages/sprotty/artifacts/test/xunit.xml'
Expand Down
1 change: 1 addition & 0 deletions configs/base.tsconfig.json
@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
Expand Down
4 changes: 3 additions & 1 deletion examples/webpack.config.js
Expand Up @@ -55,7 +55,9 @@ const config = {

plugins: [
new webpack.ProgressPlugin()
]
],
ignoreWarnings: [/Failed to parse source map/],

};

module.exports = config;
7 changes: 6 additions & 1 deletion lerna.json
@@ -1,10 +1,15 @@
{
"version": "independent",
"version": "0.11.1",
"useWorkspaces": true,
"npmClient": "yarn",
"command": {
"run": {
"stream": true
},
"publish": {
"forcePublish": true,
"skipGit": true,
"registry": "https://registry.npmjs.org/"
}
}
}
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -4,7 +4,9 @@
"prepare": "lerna run prepare",
"clean": "lerna run clean",
"build": "lerna run build",
"test": "lerna run test"
"test": "lerna run test",
"publish:latest": "lerna publish --exact --ignore-scripts --no-verify-access --yes --no-push",
"publish:next": "SHA=$(git rev-parse --short HEAD) && lerna publish preminor --exact --canary --preid next.${SHA} --dist-tag next --no-git-reset --no-git-tag-version --no-push --ignore-scripts --yes --no-verify-access"
},
"devDependencies": {
"lerna": "^4.0.0"
Expand Down
5 changes: 1 addition & 4 deletions packages/sprotty-elk/package.json
Expand Up @@ -68,10 +68,7 @@
"build": "tsc -p ./tsconfig.json && yarn run lint",
"watch": "tsc -w -p ./tsconfig.json",
"lint": "eslint -c ../../configs/.eslintrc.js \"src/**/!(*.spec.ts*)\"",
"test": "jenkins-mocha --config ../../configs/.mocharc.json \"./src/**/*.spec.?(ts|tsx)\"",
"prepublishOnly": "yarn run test",
"publish:next": "yarn publish --new-version \"$(semver $npm_package_version -i minor)-next.$(git rev-parse --short HEAD)\" --tag next --no-git-tag-version",
"publish:latest": "yarn publish --tag latest --no-git-tag-version"
"test": "jenkins-mocha --config ../../configs/.mocharc.json \"./src/**/*.spec.?(ts|tsx)\""
},
"files": [
"lib",
Expand Down
5 changes: 1 addition & 4 deletions packages/sprotty-protocol/package.json
Expand Up @@ -49,10 +49,7 @@
"build": "tsc -p ./tsconfig.json && yarn run lint",
"watch": "tsc -w -p ./tsconfig.json",
"lint": "eslint -c ../../configs/.eslintrc.js \"src/**/!(*.spec.ts*)\"",
"test": "mocha --config ../../configs/.mocharc.json \"./src/**/*.spec.?(ts|tsx)\"",
"prepublishOnly": "yarn run test",
"publish:next": "yarn publish --new-version \"$(semver $npm_package_version -i minor)-next.$(git rev-parse --short HEAD)\" --tag next --no-git-tag-version",
"publish:latest": "yarn publish --tag latest --no-git-tag-version"
"test": "mocha --config ../../configs/.mocharc.json \"./src/**/*.spec.?(ts|tsx)\""
},
"files": [
"lib",
Expand Down
5 changes: 1 addition & 4 deletions packages/sprotty/package.json
Expand Up @@ -90,10 +90,7 @@
"watch": "tsc -w -p ./tsconfig.json",
"lint": "eslint -c ../../configs/.eslintrc.js \"src/**/!(*.spec.ts*|test-helper.ts)\"",
"test:cli": "ts-mocha \"./src/**/*.spec.?(ts|tsx)\"",
"test": "jenkins-mocha --config ../../configs/.mocharc.json \"./src/**/*.spec.?(ts|tsx)\"",
"prepublishOnly": "yarn run test",
"publish:next": "yarn publish --new-version \"$(semver $npm_package_version -i minor)-next.$(git rev-parse --short HEAD)\" --tag next --no-git-tag-version",
"publish:latest": "yarn publish --tag latest --no-git-tag-version"
"test": "jenkins-mocha --config ../../configs/.mocharc.json \"./src/**/*.spec.?(ts|tsx)\""
},
"files": [
"lib",
Expand Down
6 changes: 6 additions & 0 deletions tsconfig.json
@@ -0,0 +1,6 @@
{
"extends": "./configs/base.tsconfig.json",
"include": [
"packages/*/src/**/*.ts",
],
}

0 comments on commit 80e1c30

Please sign in to comment.