mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Travis cache (#3972)
* Use name instead of env * Enable cache dist * enable only master and dev * rename e2e lib * add nx and smart build * disable packaging and create demo shell stages * use same name * Enable affected e2e for core and process * Enable affected libs check on all the e2e * fix e2e condition * Enable unit tests * Manage case deps not present * add name typo * add affected folder to check e2e * change an e2e test * remove branch typo * Update .travis.yml
This commit is contained in:
committed by
Eugenio Romano
parent
2fcec4f235
commit
f0dff4d011
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,6 +4,7 @@ bundles
|
||||
workspace.xml
|
||||
.idea/
|
||||
dist/
|
||||
tmp
|
||||
e2e-output/
|
||||
e2e/downloads/
|
||||
ng2-components/coverage/
|
||||
|
179
.travis.yml
179
.travis.yml
@@ -5,6 +5,21 @@ node_js:
|
||||
# Use the explicit NodeJS LTS version 8.9.4 to avoid any automatic upgrade of the version.
|
||||
- '8.9.4'
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- development
|
||||
|
||||
stages:
|
||||
- name: Warm Up Cache
|
||||
if: branch = master
|
||||
- name: Warm Up Cache & Lint & Build Dist
|
||||
if: branch != master
|
||||
- name: Unit test
|
||||
- name: e2e Test
|
||||
- name: Create Docker PR
|
||||
- name: Deploy Docker PR
|
||||
|
||||
addons:
|
||||
chrome: stable
|
||||
before_script:
|
||||
@@ -25,42 +40,71 @@ branches:
|
||||
jobs:
|
||||
include:
|
||||
- stage: Warm Up Cache
|
||||
script: if ([ "$TRAVIS_BRANCH" = "master" ]); then
|
||||
(./scripts/npm-build-all.sh || exit 1;);
|
||||
else
|
||||
(./scripts/update-version.sh -gnu -alpha && ././scripts/npm-build-all.sh -sb --skip-lint || exit 1;);
|
||||
fi
|
||||
- stage: Lint
|
||||
script:
|
||||
- ./scripts/lint.sh
|
||||
- npm run spellcheck
|
||||
- ./scripts/npm-build-all.sh || exit 1
|
||||
- stage: Warm Up Cache & Lint & Build Dist
|
||||
script:
|
||||
- ./scripts/update-version.sh -gnu -alpha || exit 1
|
||||
- npm install
|
||||
- ./scripts/lint.sh || exit 1
|
||||
- npm run spellcheck || exit 1
|
||||
- rm -rf tmp && (./scripts/smart-build.sh || exit 1;);
|
||||
- npm run build:dist || exit 1
|
||||
- stage: Unit test
|
||||
env: STAGE=core
|
||||
script: (./scripts/npm-build-all.sh -si -sb -t "core" --skip-lint || exit 1;);
|
||||
name: core
|
||||
script:
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "core$" ]];
|
||||
then
|
||||
ng test core --watch=false || exit 1;
|
||||
fi
|
||||
- stage: Unit test
|
||||
env: STAGE=extensions
|
||||
script: (./scripts/npm-build-all.sh -si -sb -t "extensions" --skip-lint || exit 1;);
|
||||
name: extensions
|
||||
script:
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "extensions$" ]];
|
||||
then
|
||||
ng test extensions --watch=false || exit 1;
|
||||
fi
|
||||
- stage: Unit test
|
||||
env: STAGE=process-services
|
||||
script: (./scripts/npm-build-all.sh -si -sb -t "process-services" --skip-lint|| exit 1;);
|
||||
name: process-services
|
||||
script:
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "process-services$" ]];
|
||||
then
|
||||
ng test process-services --watch=false || exit 1;
|
||||
fi
|
||||
- stage: Unit test
|
||||
env: STAGE=insights
|
||||
script: (./scripts/npm-build-all.sh -si -sb -t "insights" --skip-lint || exit 1;);
|
||||
name: insights
|
||||
script:
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "insights$" ]];
|
||||
then
|
||||
ng test insights --watch=false || exit 1;
|
||||
fi
|
||||
- stage: Unit test
|
||||
env: STAGE=content-services
|
||||
script: (./scripts/npm-build-all.sh -si -sb -t "content-services" --skip-lint|| exit 1;);
|
||||
name: content-services
|
||||
script:
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "content-services$" ]];
|
||||
then
|
||||
ng test content-services --watch=false || exit 1;
|
||||
fi
|
||||
- stage: Unit test
|
||||
env: STAGE=process-services-cloud
|
||||
script: (./scripts/npm-build-all.sh -si -sb -t "process-services-cloud" --skip-lint|| exit 1;);
|
||||
name: process-services-cloud
|
||||
script:
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "process-services-cloud$" ]];
|
||||
then
|
||||
ng test process-services-cloud --watch=false || exit 1;
|
||||
fi
|
||||
- stage: Unit test
|
||||
env: STAGE=demo-shell
|
||||
name: demo-shell
|
||||
script: if ([ "$TRAVIS_BRANCH" = "master" ]); then
|
||||
(./scripts/start.sh -t -ss || exit 1;);
|
||||
else
|
||||
(./scripts/start.sh -dev -t -ss -vjsapi alpha || exit 1;);
|
||||
fi
|
||||
- stage: Packaging test
|
||||
script: (npm run build-lib || exit 1;) && node ./scripts/upload-build-lib-in-cs.js -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --host "$E2E_HOST" -f $TRAVIS_BUILD_NUMBER
|
||||
- stage: Update children projects dependency #Update generator-ng2-alfresco-app
|
||||
if: tag =~ .*beta.*
|
||||
script: ./scripts/update-project.sh -gnu -t $GITHUB_TOKEN -n generator-ng2-alfresco-app
|
||||
@@ -76,59 +120,56 @@ jobs:
|
||||
- stage: Update children projects dependency # Test Update alfresco-modeler-app
|
||||
if: tag =~ .*beta.*
|
||||
script: ./scripts/update-project.sh -gnu -t $GITHUB_TOKEN -n alfresco-modeler-app
|
||||
- stage: Create Shell dist
|
||||
script: rm -rf ./node_modules/@alfresco; node ./scripts/download-build-lib-in-cs.js -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --host "$E2E_HOST" -f $TRAVIS_BUILD_NUMBER || exit 1; npm run build:dist || exit 1; node ./scripts/upload-build-in-cs.js -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --host "$E2E_HOST" -f $TRAVIS_BUILD_NUMBER || exit 1
|
||||
- stage: e2e Test # Test core
|
||||
env: STAGE=core
|
||||
script: node ./scripts/download-build-in-cs.js --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --host "$E2E_HOST" --folder $TRAVIS_BUILD_NUMBER; ./scripts/test-e2e-lib.sh -host localhost:4200 --host_sso "$E2E_HOST_SSO" -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder core --skip-lint --use-dist --timeout 7000
|
||||
name: core
|
||||
script:
|
||||
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "core$" || $AFFECTED_E2E = "e2e" ]];
|
||||
then
|
||||
(./scripts/test-e2e-lib.sh -host localhost:4200 --host_sso "$E2E_HOST_SSO" -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder core --skip-lint --use-dist --timeout 7000 || exit 1;);
|
||||
fi
|
||||
- stage: e2e Test # Test process-services
|
||||
env: STAGE=process-services
|
||||
script: node ./scripts/download-build-in-cs.js --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --host "$E2E_HOST" --folder $TRAVIS_BUILD_NUMBER; ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder process-services --skip-lint --use-dist --timeout 7000
|
||||
name: process-services
|
||||
script:
|
||||
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "process-services$" || $AFFECTED_E2E = "e2e" ]];
|
||||
then
|
||||
(./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder process-services --skip-lint --use-dist --timeout 7000 || exit 1;);
|
||||
fi
|
||||
- stage: e2e Test # Test content-services
|
||||
env: STAGE=content-services
|
||||
script: node ./scripts/download-build-in-cs.js --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --host "$E2E_HOST" --folder $TRAVIS_BUILD_NUMBER; ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder content-services --skip-lint --use-dist --timeout 7000
|
||||
- stage: e2e Test # Test process-services
|
||||
env: STAGE=process-services-cloud
|
||||
script: node ./scripts/download-build-in-cs.js --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --host "$E2E_HOST" --folder $TRAVIS_BUILD_NUMBER; ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder process-services-cloud --skip-lint --use-dist --timeout 7000
|
||||
name: content-services
|
||||
script:
|
||||
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "content-services$" || $AFFECTED_E2E = "e2e" ]];
|
||||
then
|
||||
(./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder content-services --skip-lint --use-dist --timeout 7000 || exit 1;);
|
||||
fi
|
||||
- stage: e2e Test # Test process-services-cloud
|
||||
name: process-services-cloud
|
||||
script:
|
||||
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "process-services-cloud$" || $AFFECTED_E2E = "e2e" ]];
|
||||
then
|
||||
(./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder process-services-cloud --skip-lint --use-dist --timeout 7000 || exit 1;);
|
||||
fi
|
||||
- stage: e2e Test # Test insights
|
||||
env: STAGE=insights
|
||||
script: node ./scripts/download-build-in-cs.js --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --host "$E2E_HOST" --folder $TRAVIS_BUILD_NUMBER; ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder insights --skip-lint --use-dist --timeout 7000
|
||||
# - stage: Test Update version 2.0.0
|
||||
# if: branch = development
|
||||
# env: STAGE=test-BC
|
||||
# script: ./scripts/test-e2e-bc.sh -b $TRAVIS_BUILD_NUMBER
|
||||
# - stage: Test Update version 2.0.0
|
||||
# env: STAGE=test-export
|
||||
# script: npm run test-export
|
||||
name: insights
|
||||
script:
|
||||
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "process-services-cloud$" || $AFFECTED_E2E = "e2e" ]];
|
||||
then
|
||||
(./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b -save --folder insights --skip-lint --use-dist --timeout 7000 || exit 1;);
|
||||
fi
|
||||
- stage: Create Docker PR
|
||||
script: node ./scripts/download-build-in-cs.js --username "$E2E_USERNAME" --password "$E2E_PASSWORD" --host "$E2E_HOST" --folder $TRAVIS_BUILD_NUMBER --base-href $TRAVIS_BUILD_NUMBER && (./scripts/pr-publish.sh -n $TRAVIS_BUILD_NUMBER -r $REPO_DOCKER -u $USERNAME_DOCKER -p $PASSWORD_DOCKER || exit 1)
|
||||
script: (./scripts/pr-publish.sh -n $TRAVIS_BUILD_NUMBER -r $REPO_DOCKER -u $USERNAME_DOCKER -p $PASSWORD_DOCKER || exit 1)
|
||||
- stage: Deploy Docker PR
|
||||
script: node --no-deprecation ./scripts/pr-deploy.js -n $TRAVIS_BUILD_NUMBER -u $RANCHER_TOKEN -p $RANCHER_SECRET -s $REPO_RANCHER --image "docker:$REPO_DOCKER/adf/demo-shell:$TRAVIS_BUILD_NUMBER" --env $ENVIRONMENT_NAME -r $ENVIRONMENT_URL || exit 1
|
||||
|
||||
# jobs:
|
||||
# include:
|
||||
# - stage: Publish alpha to NPM
|
||||
# before_install: skip
|
||||
# install: skip
|
||||
# script: skip
|
||||
# deploy:
|
||||
# provider: script
|
||||
# script: (./scripts/update-version.sh -v $(./scripts/next_version.sh)-$(git rev-parse HEAD) -vj $(npm view alfresco-js-api@alpha version) -gnu) && (./scripts/npm-publish.sh -r $NPM_REGISTRY_ADDRESS -token $NPM_REGISTRY_TOKEN -t alpha --sleep 20 || exit 1;);
|
||||
# on:
|
||||
# branch: development
|
||||
# skip_cleanup: true
|
||||
# - stage: Publish beta to NPM
|
||||
# before_install: skip
|
||||
# install: skip
|
||||
# script: skip
|
||||
# deploy:
|
||||
# provider: script
|
||||
# script: (./scripts/update-version.sh -v $TRAVIS_TAG -gnu) && (./scripts/npm-publish.sh -r $NPM_REGISTRY_ADDRESS -token $NPM_REGISTRY_TOKEN -t beta --sleep 20 || exit 1;);
|
||||
# on:
|
||||
# tags: true
|
||||
# skip_cleanup: true
|
||||
|
||||
|
||||
# Send coverage data to codecov
|
||||
after_success:
|
||||
bash <(curl -s https://codecov.io/bash) -X gcov
|
||||
@@ -137,3 +178,5 @@ after_success:
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
- demo-shell/dist
|
||||
- tmp
|
||||
|
@@ -495,7 +495,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"lib-e2e": {
|
||||
"lib-e2e-test": {
|
||||
"root": "demo-shell",
|
||||
"sourceRoot": "./demo-shell",
|
||||
"projectType": "application",
|
||||
@@ -517,7 +517,7 @@
|
||||
"builder": "@angular-devkit/build-angular:protractor",
|
||||
"options": {
|
||||
"protractorConfig": "./protractor.conf.js",
|
||||
"devServerTarget": "lib-e2e:serve"
|
||||
"devServerTarget": "lib-e2e-test:serve"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
|
@@ -44,7 +44,7 @@ describe('Error Component', () => {
|
||||
|
||||
});
|
||||
|
||||
it('[C277302] Should display the error 403 when access to unauthorized page', () => {
|
||||
it('[C277302] Should display the error 403 when access to unauthorized page - My Change', () => {
|
||||
browser.get(TestConfig.adf.url + '/error/403');
|
||||
expect(errorPage.getErrorCode()).toBe('403');
|
||||
expect(errorPage.getErrorTitle()).toBe('You don\'t have permission to access this server.');
|
||||
|
6
lib/config/bundle-content-services-scss.js
Normal file
6
lib/config/bundle-content-services-scss.js
Normal file
@@ -0,0 +1,6 @@
|
||||
var Bundler = require('scss-bundle').Bundler;
|
||||
var writeFileSync = require('fs-extra').writeFileSync;
|
||||
|
||||
new Bundler().Bundle('./lib/content-services/styles/_index.scss', '**/*.scss').then(result => {
|
||||
writeFileSync('./lib/dist/content-services/_theming.scss', result.bundledContent);
|
||||
});
|
6
lib/config/bundle-core-scss.js
Normal file
6
lib/config/bundle-core-scss.js
Normal file
@@ -0,0 +1,6 @@
|
||||
var Bundler = require('scss-bundle').Bundler;
|
||||
var writeFileSync = require('fs-extra').writeFileSync;
|
||||
|
||||
new Bundler().Bundle('./lib/core/styles/_index.scss', '**/*.scss').then(result => {
|
||||
writeFileSync('./lib/dist/core/_theming.scss', result.bundledContent);
|
||||
});
|
6
lib/config/bundle-insights-scss.js
Normal file
6
lib/config/bundle-insights-scss.js
Normal file
@@ -0,0 +1,6 @@
|
||||
var Bundler = require('scss-bundle').Bundler;
|
||||
var writeFileSync = require('fs-extra').writeFileSync;
|
||||
|
||||
new Bundler().Bundle('./lib/insights/styles/_index.scss', '**/*.scss').then(result => {
|
||||
writeFileSync('./lib/dist/insights/_theming.scss', result.bundledContent);
|
||||
});
|
7
lib/config/bundle-process-services-cloud-scss.js
Normal file
7
lib/config/bundle-process-services-cloud-scss.js
Normal file
@@ -0,0 +1,7 @@
|
||||
var Bundler = require('scss-bundle').Bundler;
|
||||
var writeFileSync = require('fs-extra').writeFileSync;
|
||||
var mkdirpSync = require('fs-extra').mkdirpSync;
|
||||
|
||||
new Bundler().Bundle('./lib/process-services-cloud/src/lib/styles/_index.scss', '**/*.scss').then(result => {
|
||||
writeFileSync('./lib/dist/process-services-cloud/_theming.scss', result.bundledContent);
|
||||
});
|
6
lib/config/bundle-process-services-scss.js
Normal file
6
lib/config/bundle-process-services-scss.js
Normal file
@@ -0,0 +1,6 @@
|
||||
var Bundler = require('scss-bundle').Bundler;
|
||||
var writeFileSync = require('fs-extra').writeFileSync;
|
||||
|
||||
new Bundler().Bundle('./lib/process-services/styles/_index.scss', '**/*.scss').then(result => {
|
||||
writeFileSync('./lib/dist/process-services/_theming.scss', result.bundledContent);
|
||||
});
|
39
nx.json
Normal file
39
nx.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"npmScope": "my-company",
|
||||
"implicitDependencies": {
|
||||
"angular.json": "*",
|
||||
"package.json": "*",
|
||||
"tsconfig.json": "*",
|
||||
"tslint.json": "*",
|
||||
"nx.json": "*"
|
||||
},
|
||||
"projects": {
|
||||
"dev": {
|
||||
"tags": []
|
||||
},
|
||||
"dist": {
|
||||
"tags": []
|
||||
},
|
||||
"core": {
|
||||
"tags": []
|
||||
},
|
||||
"content-services": {
|
||||
"tags": []
|
||||
},
|
||||
"process-services": {
|
||||
"tags": []
|
||||
},
|
||||
"process-services-cloud": {
|
||||
"tags": []
|
||||
},
|
||||
"insights": {
|
||||
"tags": []
|
||||
},
|
||||
"lib-e2e-test": {
|
||||
"tags": []
|
||||
},
|
||||
"extensions": {
|
||||
"tags": []
|
||||
}
|
||||
}
|
||||
}
|
459
package-lock.json
generated
459
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -14,6 +14,7 @@
|
||||
"lint-e2e": "./node_modules/.bin/tslint -p ./e2e/tsconfig.e2e.json -c ./tslint.json",
|
||||
"test-export": "ts-node ./tools/export-check/exportCheck.ts ./lib/core/public-api.ts ./lib/process-services/public-api.ts ./lib/content-services/public-api.ts ./lib/insights/public-api.ts ./lib/process-services-cloud/public-api.ts",
|
||||
"ng": "ng",
|
||||
"affected:libs": "./node_modules/.bin/nx affected:libs",
|
||||
"validate-config": "ajv validate -s ./lib/core/app-config/schema.json -d ./demo-shell/src/app.config.json --errors=text --verbose",
|
||||
"start": "ng lint dist && npm run validate-config && npm run server-versions && ng serve dist --host 0.0.0.0 --proxy-config ./demo-shell/proxy.conf.js --open",
|
||||
"start:dev": "ng lint dev && npm run validate-config && npm run server-versions && concurrently \"ng serve dev --host 0.0.0.0 --disable-host-check --proxy-config ./demo-shell/proxy.conf.js --open\" \"npm run style:dev --watch\" ",
|
||||
@@ -25,7 +26,7 @@
|
||||
"webpack-bundle-analyzer": "webpack-bundle-analyzer demo-shell/dist/stats.json",
|
||||
"test": "npm run validate-config && ng test dev --watch=false",
|
||||
"e2e": "./scripts/test-e2e-lib.sh -host 'localhost:4200' -dev --folder demo-shell",
|
||||
"e2e-lib": "ng e2e lib-e2e --port=4200",
|
||||
"e2e-lib": "ng e2e lib-e2e-test --port=4200",
|
||||
"server-versions": "rimraf ./demo-shell/src/versions.json && npm list --depth=0 --json=true --prod=true > ./demo-shell/src/versions.json || exit 0",
|
||||
"clean": "rimraf dist ./node_modules typings",
|
||||
"clean-lock": "rimraf package-lock.json",
|
||||
@@ -81,6 +82,8 @@
|
||||
"adf-tslint-rules": "0.0.4",
|
||||
"alfresco-js-api": "2.7.0-beta5",
|
||||
"alfresco-js-api-node": "2.7.0-beta5",
|
||||
"@nrwl/schematics": "6.3.1",
|
||||
"@nrwl/nx": "6.3.1",
|
||||
"chart.js": "2.5.0",
|
||||
"classlist.js": "1.1.20150312",
|
||||
"core-js": "^2.5.4",
|
||||
|
49
scripts/affected-folder.sh
Executable file
49
scripts/affected-folder.sh
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
eval BRANCH_NAME=""
|
||||
eval HEAD_SHA_BRANCH=""
|
||||
eval SHA_2="HEAD"
|
||||
|
||||
show_help() {
|
||||
echo "Usage: affected-folder.sh"
|
||||
echo ""
|
||||
echo "-b branch name"
|
||||
echo "-folder"
|
||||
}
|
||||
|
||||
branch_name(){
|
||||
BRANCH_NAME=$1
|
||||
}
|
||||
|
||||
folder_name(){
|
||||
FOLDER_NAME=$1
|
||||
}
|
||||
|
||||
while [[ $1 == -* ]]; do
|
||||
case "$1" in
|
||||
-b) branch_name $2; shift 2;;
|
||||
-f) folder_name $2; shift 2;;
|
||||
-*) echo "invalid option: $1" 1>&2; show_help; exit 0;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "$BRANCH_NAME" == "" ]]
|
||||
then
|
||||
echo "The branch name is mandatory"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "$FOLDER_NAME" == "" ]]
|
||||
then
|
||||
echo "The folder name is mandatory"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
HEAD_SHA_BRANCH="$(git merge-base origin/$BRANCH_NAME HEAD)"
|
||||
#echo "Branch name $BRANCH_NAME HEAD sha " $HEAD_SHA_BRANCH
|
||||
|
||||
if git diff --name-only $HEAD_SHA_BRANCH HEAD | grep "^${FOLDER_NAME}" &> /dev/null
|
||||
then
|
||||
echo ${FOLDER_NAME}
|
||||
fi
|
||||
|
113
scripts/affected-libs.sh
Executable file
113
scripts/affected-libs.sh
Executable file
@@ -0,0 +1,113 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
eval BRANCH_NAME=""
|
||||
eval HEAD_SHA_BRANCH=""
|
||||
eval SHA_2="HEAD"
|
||||
eval DIRECTORY="tmp"
|
||||
|
||||
show_help() {
|
||||
echo "Usage: smart-build.sh"
|
||||
echo ""
|
||||
echo "-b branch name"
|
||||
}
|
||||
|
||||
branch_name(){
|
||||
BRANCH_NAME=$1
|
||||
}
|
||||
|
||||
while [[ $1 == -* ]]; do
|
||||
case "$1" in
|
||||
-b) branch_name $2; shift 2;;
|
||||
-*) echo "invalid option: $1" 1>&2; show_help; exit 0;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "$BRANCH_NAME" == "" ]]
|
||||
then
|
||||
echo "The branch name is mandatory"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#HEAD_SHA_BRANCH=(`git merge-base origin/$BRANCH_NAME HEAD`)
|
||||
HEAD_SHA_BRANCH="$(git merge-base origin/$BRANCH_NAME HEAD)"
|
||||
echo "Branch name $BRANCH_NAME HEAD sha " $HEAD_SHA_BRANCH
|
||||
|
||||
# tmp folder doesn't exist.
|
||||
if [ ! -d "$DIRECTORY" ]; then
|
||||
#find affected libs
|
||||
echo "Directory tmp created";
|
||||
mkdir $DIRECTORY;
|
||||
fi
|
||||
|
||||
if [ ! -f $DIRECTORY/deps.txt ]; then
|
||||
npm run affected:libs -- $HEAD_SHA_BRANCH "HEAD" > $DIRECTORY/deps.txt
|
||||
fi
|
||||
|
||||
#echo "extensions" > deps.txt
|
||||
|
||||
#clean file
|
||||
sed -i '/^$/d' ./$DIRECTORY/deps.txt
|
||||
sed -i '/alfresco-components/d' ./$DIRECTORY/deps.txt
|
||||
sed -i '/nx affected:libs/d' ./$DIRECTORY/deps.txt
|
||||
sed -i '/^$/d' ./$DIRECTORY/deps.txt
|
||||
|
||||
#read result from file
|
||||
while IFS= read -r var
|
||||
do
|
||||
fileLine=$var
|
||||
done < "./$DIRECTORY/deps.txt"
|
||||
|
||||
#transform string to array
|
||||
libs=(`echo $fileLine | sed 's/^$/\n/g'`)
|
||||
|
||||
#core
|
||||
for i in "${libs[@]}"
|
||||
do
|
||||
if [ "$i" == "core" ] ; then
|
||||
AFFECTED_LIBS="core$ content-services$ process-services$ process-services-cloud$ insights$ extensions$ "
|
||||
echo "${AFFECTED_LIBS}"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
#process-services
|
||||
for i in "${libs[@]}"
|
||||
do
|
||||
if [ "$i" == "process-services" ] ; then
|
||||
AFFECTED_LIBS=$AFFECTED_LIBS" process-services$"
|
||||
fi
|
||||
done
|
||||
|
||||
#content-services
|
||||
for i in "${libs[@]}"
|
||||
do
|
||||
if [ "$i" == "content-services" ] ; then
|
||||
AFFECTED_LIBS=$AFFECTED_LIBS" content-services$"
|
||||
fi
|
||||
done
|
||||
|
||||
#insights
|
||||
for i in "${libs[@]}"
|
||||
do
|
||||
if [ "$i" == "insights" ] ; then
|
||||
AFFECTED_LIBS=$AFFECTED_LIBS" insights$"
|
||||
fi
|
||||
done
|
||||
|
||||
#extensions
|
||||
for i in "${libs[@]}"
|
||||
do
|
||||
if [ "$i" == "extensions" ] ; then
|
||||
AFFECTED_LIBS=$AFFECTED_LIBS" extensions$"
|
||||
fi
|
||||
done
|
||||
|
||||
#process-services-cloud
|
||||
for i in "${libs[@]}"
|
||||
do
|
||||
if [ "$i" == "process-services-cloud" ] ; then
|
||||
AFFECTED_LIBS=$AFFECTED_LIBS" process-services-cloud$"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "${AFFECTED_LIBS}"
|
24
scripts/build-content-services.sh
Executable file
24
scripts/build-content-services.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
cd $DIR/..
|
||||
|
||||
echo "====== Content Services ======"
|
||||
echo "====== Build ======"
|
||||
npm run ng-packagr -- -p ./lib/content-services/ || exit 1
|
||||
|
||||
echo "====== Build style ======"
|
||||
node ./lib/config/bundle-content-services-scss.js || exit 1
|
||||
|
||||
echo "====== Copy i18n ======"
|
||||
mkdir -p ./lib/dist/content-services/bundles/assets/adf-content-services/i18n
|
||||
cp -R ./lib/content-services/i18n/* ./lib/dist/content-services/bundles/assets/adf-content-services/i18n
|
||||
|
||||
echo "====== Copy assets ======"
|
||||
cp -R ./lib/content-services/assets/* ./lib/dist/content-services/bundles/assets
|
||||
|
||||
echo "====== Move to node_modules ======"
|
||||
rm -rf ./node_modules/@alfresco/adf-content-services/ && \
|
||||
mkdir -p ./node_modules/@alfresco/adf-content-services/ && \
|
||||
cp -R ./lib/dist/content-services/* ./node_modules/@alfresco/adf-content-services/
|
24
scripts/build-core.sh
Executable file
24
scripts/build-core.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
cd $DIR/..
|
||||
|
||||
echo "====== Core ======"
|
||||
echo "====== Build ======"
|
||||
npm run ng-packagr -- -p ./lib/core/ || exit 1
|
||||
|
||||
echo "====== Build style ======"
|
||||
node ./lib/config/bundle-core-scss.js || exit 1
|
||||
|
||||
echo "====== Copy i18n ======"
|
||||
mkdir -p ./lib/dist/core/bundles/assets/adf-core/i18n
|
||||
cp -R ./lib/core/i18n/* ./lib/dist/core/bundles/assets/adf-core/i18n
|
||||
|
||||
echo "====== Copy assets ======"
|
||||
cp -R ./lib/core/assets/* ./lib/dist/core/bundles/assets
|
||||
|
||||
echo "====== Move to node_modules ======"
|
||||
rm -rf ./node_modules/@alfresco/adf-core/ && \
|
||||
mkdir -p ./node_modules/@alfresco/adf-core/ && \
|
||||
cp -R ./lib/dist/core/* ./node_modules/@alfresco/adf-core/
|
14
scripts/build-extensions.sh
Executable file
14
scripts/build-extensions.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
cd $DIR/..
|
||||
|
||||
echo "====== Extensions ======"
|
||||
echo "====== Build ======"
|
||||
ng build extensions || exit 1
|
||||
|
||||
echo "====== Move to node_modules ======"
|
||||
rm -rf ./node_modules/@alfresco/adf-extensions/ && \
|
||||
mkdir -p ./node_modules/@alfresco/adf-extensions/ && \
|
||||
cp -R ./lib/dist/extensions/* ./node_modules/@alfresco/adf-extensions/
|
24
scripts/build-insights.sh
Executable file
24
scripts/build-insights.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
cd $DIR/..
|
||||
|
||||
echo "====== Insights ======"
|
||||
echo "====== Build ======"
|
||||
npm run ng-packagr -- -p ./lib/insights/ || exit 1
|
||||
|
||||
echo "====== Build style ======"
|
||||
node ./lib/config/bundle-insights-scss.js || exit 1
|
||||
|
||||
echo "====== Copy i18n ======"
|
||||
mkdir -p ./lib/dist/insights/bundles/assets/adf-insights/i18n
|
||||
cp -R ./lib/insights/i18n/* ./lib/dist/insights/bundles/assets/adf-insights/i18n
|
||||
|
||||
echo "====== Copy assets ======"
|
||||
cp -R ./lib/insights/assets/* ./lib/dist/insights/bundles/assets
|
||||
|
||||
echo "====== Move to node_modules ======"
|
||||
rm -rf ./node_modules/@alfresco/adf-insights/ && \
|
||||
mkdir -p ./node_modules/@alfresco/adf-insights/ && \
|
||||
cp -R ./lib/dist/insights/* ./node_modules/@alfresco/adf-insights/
|
24
scripts/build-process-services-cloud.sh
Executable file
24
scripts/build-process-services-cloud.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
cd $DIR/..
|
||||
|
||||
echo "====== Process Services Cloud ======"
|
||||
echo "====== Build ======"
|
||||
ng build process-services-cloud || exit 1
|
||||
|
||||
echo "====== Build style ======"
|
||||
node ./lib/config/bundle-process-services-cloud-scss.js || exit 1
|
||||
|
||||
echo "====== Copy i18n ======"
|
||||
mkdir -p ./lib/dist/process-services-cloud/bundles/assets/adf-process-services-cloud/i18n
|
||||
cp -R ./lib/process-services-cloud/src/lib/i18n/* ./lib/dist/process-services-cloud/bundles/assets/adf-process-services-cloud/i18n
|
||||
|
||||
echo "====== Copy assets ======"
|
||||
cp -R ./lib/process-services-cloud/src/lib/assets/* ./lib/dist/process-services-cloud/bundles/assets
|
||||
|
||||
echo "====== Move to node_modules ======"
|
||||
rm -rf ./node_modules/@alfresco/adf-process-services-cloud/ && \
|
||||
mkdir -p ./node_modules/@alfresco/adf-process-services-cloud/ && \
|
||||
cp -R ./lib/dist/process-services-cloud/* ./node_modules/@alfresco/adf-process-services-cloud/
|
24
scripts/build-process-services.sh
Executable file
24
scripts/build-process-services.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
cd $DIR/..
|
||||
|
||||
echo "====== Process Services ======"
|
||||
echo "====== Build ======"
|
||||
npm run ng-packagr -- -p ./lib/process-services/ || exit 1
|
||||
|
||||
echo "====== Build style ======"
|
||||
node ./lib/config/bundle-process-services-scss.js || exit 1
|
||||
|
||||
echo "====== Copy i18n ======"
|
||||
mkdir -p ./lib/dist/process-services/bundles/assets/adf-process-services/i18n
|
||||
cp -R ./lib/process-services/i18n/* ./lib/dist/process-services/bundles/assets/adf-process-services/i18n
|
||||
|
||||
echo "====== Copy assets ======"
|
||||
cp -R ./lib/process-services/assets/* ./lib/dist/process-services/bundles/assets
|
||||
|
||||
echo "====== Move to node_modules ======"
|
||||
rm -rf ./node_modules/@alfresco/adf-process-services/ && \
|
||||
mkdir -p ./node_modules/@alfresco/adf-process-services/ && \
|
||||
cp -R ./lib/dist/process-services/* ./node_modules/@alfresco/adf-process-services/
|
52
scripts/smart-build.sh
Executable file
52
scripts/smart-build.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
affected="$(./scripts/affected-libs.sh -b "$TRAVIS_BRANCH")"
|
||||
libs=(`echo $affected | sed 's/^$/\n/g'`)
|
||||
|
||||
#core
|
||||
for i in "${libs[@]}"
|
||||
do
|
||||
if [ "$i" == "core$" ] ; then
|
||||
./scripts/build-core.sh
|
||||
fi
|
||||
done
|
||||
|
||||
#content-services
|
||||
for i in "${libs[@]}"
|
||||
do
|
||||
if [ "$i" == "content-services$" ] ; then
|
||||
./scripts/build-content-services.sh
|
||||
fi
|
||||
done
|
||||
|
||||
#process-services
|
||||
for i in "${libs[@]}"
|
||||
do
|
||||
if [ "$i" == "process-services$" ] ; then
|
||||
./scripts/build-process-services.sh
|
||||
fi
|
||||
done
|
||||
|
||||
#process-services-cloud
|
||||
for i in "${libs[@]}"
|
||||
do
|
||||
if [ "$i" == "process-services-cloud$" ] ; then
|
||||
./scripts/build-process-services-cloud.sh
|
||||
fi
|
||||
done
|
||||
|
||||
#insights
|
||||
for i in "${libs[@]}"
|
||||
do
|
||||
if [ "$i" == "insights$" ] ; then
|
||||
./scripts/build-insights.sh
|
||||
fi
|
||||
done
|
||||
|
||||
#extensions
|
||||
for i in "${libs[@]}"
|
||||
do
|
||||
if [ "$i" == "extensions$" ] ; then
|
||||
./scripts/build-extensions.sh
|
||||
fi
|
||||
done
|
Reference in New Issue
Block a user