ci: build examples and deply in a subfolder (#432)

This commit is contained in:
Jakub 2022-02-02 01:35:28 +01:00 committed by GitHub
parent b257885204
commit e4888f779c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 43 additions and 19 deletions

View File

@ -13,28 +13,51 @@ pipeline {
environment {
GIT_AUTHOR_NAME = 'status-im-auto'
GIT_AUTHOR_EMAIL = 'auto@status.im'
PUPPETEER_SKIP_DOWNLOAD = 'true'
}
stages {
stage('Install Deps') {
stage('Deps') {
steps {
sh 'yarn install'
sh 'npm install'
}
}
stage('Build') {
steps {
sh 'yarn run doc'
sh 'npm run build'
sh 'npm run doc'
}
}
stage('Publish Prod') {
when { expression { GIT_BRANCH.endsWith('docs-build') } }
stage('Examples') {
parallel {
stage('web-chat') { steps { script { buildExample() } } }
stage('eth-pm') { steps { script { buildExample() } } }
stage('eth-pm-wallet-encryption') { steps { script { buildExample() } } }
}
}
stage('Publish') {
when { expression { GIT_BRANCH.endsWith('build-examples') } }
steps { script {
sshagent(credentials: ['status-im-auto-ssh']) {
sh 'yarn run deploy'
sh 'npm run deploy'
}
} }
}
}
post {
always { cleanWs() }
}
}
def buildExample(example=STAGE_NAME) {
def dest = "${WORKSPACE}/build/docs/examples/${example}"
dir("examples/${example}") {
sh 'npm install'
sh 'npm run build'
sh "mkdir -p ${dest}"
sh "cp -r build/. ${dest}"
}
}

View File

@ -19,7 +19,7 @@
"eth-sig-util": "^3.0.1",
"ethers": "^5.5.3",
"fontsource-roboto": "^4.0.0",
"js-waku": "../../build/main",
"js-waku": "file:../../build/main",
"protobufjs": "^6.11.2",
"react": "^17.0.2",
"react-dom": "^17.0.2"

View File

@ -2,7 +2,7 @@
"name": "eth-pm-wallet-encryption",
"version": "0.1.0",
"private": true,
"homepage": "/js-waku/eth-pm-wallet",
"homepage": "/examples/eth-pm-wallet-encryption",
"dependencies": {
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
@ -15,7 +15,7 @@
"eth-sig-util": "^3.0.1",
"ethers": "^5.5.3",
"fontsource-roboto": "^4.0.0",
"js-waku": "../../build/main",
"js-waku": "file:../../build/main",
"protobufjs": "^6.11.2",
"react": "^17.0.2",
"react-dom": "^17.0.2"

View File

@ -19,7 +19,7 @@
"eth-sig-util": "^3.0.1",
"ethers": "^5.5.3",
"fontsource-roboto": "^4.0.0",
"js-waku": "../../build/main",
"js-waku": "file:../../build/main",
"protobufjs": "^6.11.2",
"react": "^17.0.2",
"react-dom": "^17.0.2"

View File

@ -2,7 +2,7 @@
"name": "eth-pm",
"version": "0.1.0",
"private": true,
"homepage": "/js-waku/eth-pm",
"homepage": "/examples/eth-pm",
"dependencies": {
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
@ -15,7 +15,7 @@
"eth-sig-util": "^3.0.1",
"ethers": "^5.5.3",
"fontsource-roboto": "^4.0.0",
"js-waku": "../../build/main",
"js-waku": "file:../../build/main",
"protobufjs": "^6.11.2",
"react": "^17.0.2",
"react-dom": "^17.0.2"

View File

@ -11,7 +11,7 @@
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"js-waku": "../../build/esm",
"js-waku": "file:../../build/esm",
"protons": "^2.0.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",

View File

@ -6,7 +6,7 @@
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"js-waku": "../../build/esm",
"js-waku": "file:../../build/esm",
"protons": "^2.0.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",

View File

@ -14,7 +14,7 @@
"assert": "^2.0.0",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"js-waku": "../../build/esm",
"js-waku": "file:../../build/esm",
"protons": "^2.0.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",

View File

@ -9,7 +9,7 @@
"assert": "^2.0.0",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"js-waku": "../../build/esm",
"js-waku": "file:../../build/esm",
"protons": "^2.0.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",

View File

@ -11,7 +11,7 @@
"@livechat/ui-kit": "^0.5.0-20",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"js-waku": "../../build/main",
"js-waku": "file:../../build/main",
"process": "^0.11.10",
"react": "^17.0.2",
"react-dom": "^17.0.2",

View File

@ -2,12 +2,12 @@
"name": "web-chat",
"version": "0.1.0",
"private": true,
"homepage": "/js-waku",
"homepage": "/examples/web-chat",
"dependencies": {
"@livechat/ui-kit": "^0.5.0-20",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"js-waku": "../../build/main",
"js-waku": "file:../../build/main",
"process": "^0.11.10",
"react": "^17.0.2",
"react-dom": "^17.0.2",

View File

@ -48,6 +48,7 @@
"doc": "run-s doc:*",
"doc:html": "typedoc --excludeInternal --listInvalidSymbolLinks --exclude **/*.spec.ts --out build/docs src/",
"doc:cname": "echo 'js-waku.wakuconnect.dev' > build/docs/CNAME",
"doc:examples": "mkdir -p build/docs/examples",
"deploy": "node ci/deploy.js",
"reset-hard": "git clean -dfx && git reset --hard && npm i && npm run build && for d in examples/*; do (cd $d; npm i); done"
},