Improve build stages (#3744)

* travis precache

* rb change

* remove ut

* add cache warm up

* Prepare cache fix

* add test

* use env variabble to tag

* use env to label stages

* move lint step at start

* use dist for e2e

* upload dist in alfresco

* modify permissions

* travis script node

* remove polyfills

* revert some changes

* fix demo shell run test

* solve download

* revert debatable gallery change
This commit is contained in:
Eugenio Romano
2018-09-05 12:40:03 +01:00
committed by GitHub
parent c0acc53eb9
commit c6f56a2c2a
37 changed files with 10383 additions and 1450 deletions

View File

@@ -17,84 +17,74 @@ before_install:
- sh -e /etc/init.d/xvfb start
- sleep 3 # give xvfb some time to start
env:
matrix:
- MODULE=core
- MODULE=insights
- MODULE=process-services
- MODULE=content-services
- MODULE=demo-shell
- MODULE=packaging
install:
- if ([ "$MODULE" != "demo-shell" ]); then
if ([ "$TRAVIS_BRANCH" = "master" ]); then
jobs:
include:
- stage: Warm Up Cache
script: if ([ "$TRAVIS_BRANCH" = "master" ]); then
(./scripts/npm-build-all.sh || exit 1;);
else
(./scripts/npm-build-all.sh -vjsapi alpha -sb || exit 1;);
(./scripts/npm-build-all.sh -vjsapi alpha -sb --skip-lint || exit 1;);
fi
fi
script:
- if ([ "$MODULE" == "core" ]); then
(./scripts/npm-build-all.sh -si -sb -t "core" || exit 1;);
fi
- if ([ "$MODULE" == "process-services" ]); then
(./scripts/npm-build-all.sh -si -sb -t "process-services" || exit 1;);
fi
- if ([ "$MODULE" == "insights" ]); then
(./scripts/npm-build-all.sh -si -sb -t "insights" || exit 1;);
fi
- if ([ "$MODULE" == "content-services" ]); then
(./scripts/npm-build-all.sh -si -sb -t "content-services" || exit 1;);
fi
- if ([ "$MODULE" == "packaging" ]); then
(npm run build-lib || exit 1;);
fi
- if ([ "$MODULE" == "demo-shell" ]); then
if ([ "$TRAVIS_BRANCH" = "master" ]); then
- stage: Lint
script: (./scripts/lint.sh)
- stage: Unit test
env: STAGE=core
script: (./scripts/npm-build-all.sh -si -sb -t "core" --skip-lint || exit 1;);
- stage: Unit test
env: STAGE=process-services
script: (./scripts/npm-build-all.sh -si -sb -t "process-services" --skip-lint|| exit 1;);
- stage: Unit test
env: STAGE=insights
script: (./scripts/npm-build-all.sh -si -sb -t "insights" --skip-lint || exit 1;);
- stage: Unit test
env: STAGE=content-services
script: (./scripts/npm-build-all.sh -si -sb -t "content-services" --skip-lint|| exit 1;);
- stage: Unit test
env: STAGE=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
fi
jobs:
include:
- stage: Packaging test
script: (npm run build-lib || exit 1;);
- stage: Test Update version 2.0.0
env: STAGE=test-BC
script: ./scripts/test-e2e-bc.sh
- # Test expors
- stage: Test Update version 2.0.0
env: STAGE=test-export
script: npm run test-export
- # Test Update generator-ng2-alfresco-app
- 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
- # Test Update alfresco-content-app
- stage: Update children projects dependency # Test Update alfresco-content-app
if: tag =~ .*beta.*
script: ./scripts/update-project.sh -gnu -t $GITHUB_TOKEN -n alfresco-content-app
- # Test Update adf-app-manager-ui
- stage: Update children projects dependency # Test Update adf-app-manager-ui
if: tag =~ .*beta.*
script: ./scripts/update-project.sh -gnu -t $GITHUB_TOKEN -n adf-app-manager-ui
- # Test Update aalfresco-ng2-components
- stage: Update children projects dependency # Test Update aalfresco-ng2-components
if: tag =~ .*beta.*
script: ./scripts/update-project.sh -gnu -t $GITHUB_TOKEN -n alfresco-ng2-components
- # Test Update alfresco-modeler-app
- 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: e2e Test
script: ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy $E2E_HOST -u $E2E_USERNAME -p $E2E_PASSWORD -e $E2E_EMAIL -b -save -dev -timeout 40000 --folder core
- # Test process-services
script: ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy $E2E_HOST -u $E2E_USERNAME -p $E2E_PASSWORD -e $E2E_EMAIL -b -save -dev -timeout 40000 --folder process-services
- # Test content-services
script: ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy $E2E_HOST -u $E2E_USERNAME -p $E2E_PASSWORD -e $E2E_EMAIL -b -save -dev -timeout 40000 --folder content-services
- # Test insights
script: ./scripts/test-e2e-lib.sh -host localhost:4200 -proxy $E2E_HOST -u $E2E_USERNAME -p $E2E_PASSWORD -e $E2E_EMAIL -b -save -dev -timeout 40000 --folder insights
- stage: Create Shell dist
script: ./copy-dist-node.sh; npm run build:dist; node ./scripts/upload-build-in-cs.js -u $E2E_USERNAME -p $E2E_PASSWORD --host $E2E_HOST -f $TRAVIS_BUILD_NUMBER
- stage: e2e Test # Test core
env: STAGE=core
script: node ./scripts/download-build-in-cs.js --username $E2E_USERNAME --password $E2E_USERNAME --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 core --skip-lint --use-dist
- stage: e2e Test # Test process-services
env: STAGE=process-services
script: node ./scripts/download-build-in-cs.js --username $E2E_USERNAME --password $E2E_USERNAME --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
- stage: e2e Test # Test content-services
env: STAGE=content-services
script: node ./scripts/download-build-in-cs.js --username $E2E_USERNAME --password $E2E_USERNAME --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
- stage: e2e Test # Test insights
env: STAGE=insights
script: node ./scripts/download-build-in-cs.js --username $E2E_USERNAME --password $E2E_USERNAME --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
- stage: Create Docker PR
script: ./scripts/test-dist.sh -n $TRAVIS_BUILD_NUMBER && (./scripts/pr-publish.sh -n $TRAVIS_BUILD_NUMBER -r $REPO_DOCKER -u $USERNAME_DOCKER -p $PASSWORD_DOCKER || exit 1)
script: node ./scripts/download-build-in-cs.js --username $E2E_USERNAME --password $E2E_USERNAME --host $E2E_HOST --folder $TRAVIS_BUILD_NUMBER --base-href $TRAVIS_BUILD_NUMBER; -n $TRAVIS_BUILD_NUMBER && (./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 ./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
@@ -129,3 +119,5 @@ after_success:
cache:
directories:
- node_modules
- lib/dist
- demo-shell/dist

View File

@@ -94,7 +94,7 @@
"extractLicenses": true,
"vendorChunk": true,
"buildOptimizer": true,
"verbose": true,
"verbose": false,
"fileReplacements": [
{
"replace": "demo-shell/src/environments/environment.ts",
@@ -325,7 +325,7 @@
"extractLicenses": true,
"vendorChunk": true,
"buildOptimizer": true,
"verbose": true,
"verbose": false,
"fileReplacements": [
{
"replace": "demo-shell/src/environments/environment.ts",
@@ -465,29 +465,6 @@
}
}
},
"demo-shell-e2e": {
"root": "demo-shell",
"sourceRoot": "demo-shell/e2e",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "dist:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [],
"exclude": [
"**/node_modules/**/*"
]
}
}
}
},
"lib-e2e": {
"root": "demo-shell",
"sourceRoot": "./demo-shell",

View File

@@ -96,7 +96,7 @@ import { ProcessModule } from '@alfresco/adf-process-services';
ProcessModule.forRoot(),
ThemePickerModule,
ChartsModule,
MonacoEditorModule.forRoot(),
MonacoEditorModule.forRoot()
],
declarations: [
AppComponent,

View File

@@ -19,7 +19,6 @@ import { Component, ViewEncapsulation, OnInit } from '@angular/core';
import { UserPreferencesService, AppConfigService, AlfrescoApiService } from '@alfresco/adf-core';
import { HeaderDataService } from '../header-data/header-data.service';
@Component({
templateUrl: 'app-layout.component.html',
styleUrls: ['app-layout.component.scss'],

View File

@@ -227,7 +227,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
ngOnInit() {
if (!this.pagination) {
this.pagination = <Pagination>{
this.pagination = <Pagination> {
maxItems: this.preference.paginationSize,
skipCount: 0
};
@@ -265,7 +265,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
ngOnChanges(changes: SimpleChanges) {
if (changes.nodeResult && changes.nodeResult.currentValue) {
this.nodeResult = <NodePaging>changes.nodeResult.currentValue;
this.nodeResult = <NodePaging> changes.nodeResult.currentValue;
this.pagination = this.nodeResult.list.pagination;
}
if (!this.pagination) {
@@ -558,7 +558,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
}
runCustomAction(event) {
console.log(event);
this.logService.log(event);
}
getFileFiltering() {

View File

@@ -26,7 +26,7 @@ import { FakeFormService } from './fake-form.service';
templateUrl: 'form-loading.component.html',
styleUrls: ['form-loading.component.scss'],
providers: [
{ provide: FormService, useClass: FakeFormService },
{ provide: FormService, useClass: FakeFormService }
]
})
export class FormLoadingComponent implements OnInit {

View File

@@ -17,7 +17,6 @@
import { Injectable, Output, EventEmitter } from '@angular/core';
@Injectable()
export class HeaderDataService {

View File

@@ -16,7 +16,7 @@
*/
import { Component, Optional, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Params} from '@angular/router';
import { ActivatedRoute, Params } from '@angular/router';
import { PermissionListComponent, NodePermissionDialogService } from '@alfresco/adf-content-services';
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
import { NodesApiService, NotificationService } from '@alfresco/adf-core';

View File

@@ -22,7 +22,7 @@ import { debounceTime } from 'rxjs/operators';
@Component({
templateUrl: './process-list-demo.component.html',
styleUrls: [`./process-list-demo.component.scss`],
styleUrls: [`./process-list-demo.component.scss`]
})
export class ProcessListDemoComponent implements OnInit {

View File

@@ -19,7 +19,7 @@ import { Component } from '@angular/core';
@Component({
templateUrl: './report-issue.component.html',
styleUrls: [`./report-issue.component.scss`],
styleUrls: [`./report-issue.component.scss`]
})
export class ReportIssueComponent {

View File

@@ -16,7 +16,7 @@
*/
import { Component } from '@angular/core';
import { LogService, } from '@alfresco/adf-core';
import { LogService } from '@alfresco/adf-core';
import { Router } from '@angular/router';
@Component({

View File

@@ -22,7 +22,7 @@ import { debounceTime } from 'rxjs/operators';
@Component({
templateUrl: './task-list-demo.component.html',
styleUrls: [`./task-list-demo.component.scss`],
styleUrls: [`./task-list-demo.component.scss`]
})
export class TaskListDemoComponent implements OnInit {

View File

@@ -67,23 +67,9 @@ import 'core-js/es7/array';
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/
/**
* Date, currency, decimal and percent pipes.
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
*/
import 'intl'; // Run `npm install --save intl`.
/**
* Need to import at least one locale-data with intl.
*/
import 'intl/locale-data/jsonp/en';
/**
* Support custom event in IE11
*
* */
*/
import 'custom-event-polyfill/custom-event-polyfill'; // Run `npm install --save custom-event-polyfill`.

View File

@@ -36,6 +36,8 @@
"**/*.spec.ts"
],
"angularCompilerOptions": {
"skipTemplateCodegen": false
"skipTemplateCodegen": false,
"entryModule": "./app/app.module#AppModule",
"genDir": "../ngfactory"
}
}

View File

@@ -6,10 +6,18 @@
"rules": {
"adf-license-banner": [
true,
"**/*.ts"
"e2e/**/*.ts"
],
"align": [
true,
"parameters",
"statements"
],
"ban": [
true,
"eval",
"fdescribe"
],
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
true,
@@ -18,18 +26,17 @@
"curly": true,
"eofline": true,
"forin": true,
"import-spacing": true,
"indent": [
true,
"spaces"
],
"interface-over-type-literal": true,
"interface-name": false,
"jsdoc-format": true,
"label-position": true,
"max-line-length": [
true,
180
],
"member-access": false,
"member-ordering": [
true,
{
@@ -41,10 +48,14 @@
]
}
],
"no-any": false,
"no-arg": true,
"no-bitwise": true,
"no-bitwise": false,
"no-conditional-assignment": true,
"no-consecutive-blank-lines": true,
"no-console": [
true,
"log",
"debug",
"info",
"time",
@@ -52,20 +63,21 @@
"trace"
],
"no-construct": true,
"no-constructor-vars": false,
"no-debugger": true,
"no-duplicate-super": true,
"no-duplicate-variable": true,
"no-empty": false,
"no-empty-interface": true,
"no-eval": true,
"no-inferrable-types": [true, "ignore-params"],
"no-inferrable-types": false,
"no-internal-module": true,
"no-require-imports": false,
"no-shadowed-variable": true,
"no-string-literal": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"no-var-requires": true,
"object-literal-sort-keys": false,
"one-line": [
true,
@@ -74,20 +86,29 @@
"check-else",
"check-whitespace"
],
"prefer-const": true,
"quotemark": [
true,
"single"
"single",
"avoid-escape"
],
"radix": true,
"semicolon": [
true,
"always"
],
"switch-default": true,
"trailing-comma": [
true,
{
"multiline": "never",
"singleline": "never"
}
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef": false,
"typedef-whitespace": [
true,
{
@@ -98,26 +119,53 @@
"variable-declaration": "nospace"
}
],
"use-strict": false,
"variable-name": [
true,
"check-format",
"allow-leading-underscore",
"ban-keywords"
],
"callable-types": true,
"import-spacing": true,
"interface-over-type-literal": true,
"member-access": false,
"no-empty-interface": true,
"no-string-literal": false,
"no-string-throw": true,
"prefer-const": false,
"unified-signatures": true,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
"check-typecast",
"check-type",
"check-typecast",
"check-module"
],
"directive-selector": [true, "attribute", "app", "camelCase"],
"component-selector": [true, "element", "app", "kebab-case"],
"naming-convention": [
{
"type": "enumMember",
"format": "PascalCase"
}
],
"ordered-imports": false,
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"no-input-rename": true,
"no-output-rename": true,
"use-host-property-decorator": false,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true
"directive-class-suffix": true,
"adf-file-name": true,
"adf-class-name": true,
"adf-prefix-name": true,
"no-input-rename": true,
"no-output-rename": true
}
}

BIN
demo-shell/zip/demo.zip Normal file

Binary file not shown.

View File

@@ -366,6 +366,13 @@ export class FilesComponent implements OnInit {
}
```
```html
<adf-document-list
[currentFolderId]="currentFolderId">
</adf-document-list>
```
The `console.log(node)` for the `getNodeInfo` callback is just for study and debug purposes.
It is useful for examining other information that you can access if necessary:

33
e2e/lite-server-proxy.js Normal file
View File

@@ -0,0 +1,33 @@
var PROXY_HOST_ADF = process.env.PROXY_HOST_ADF;
var HOST = process.env.URL_HOST_ADF;
let proxy = require('http-proxy-middleware');
let targetProxy = 'http://' + (PROXY_HOST_ADF || HOST);
let fallback = require('connect-history-api-fallback');
console.log('targetProxy');
module.exports = {
'port': 4200,
open: false,
server: {
middleware: {
1: proxy('/alfresco', {
target: targetProxy,
changeOrigin: true,
pathRewrite: {
"^/alfresco/alfresco": ""
}
}),
2: proxy('/activiti-app', {
target: targetProxy,
changeOrigin: true,
"pathRewrite": {
"^/activiti-app/activiti-app": ""
}
}),
3: fallback({index: '/index.html', verbose: true})
}
}
};

View File

@@ -44,10 +44,6 @@ describe('Comment component for Processes', () => {
hostBpm: TestConfig.adf.url
});
done();
});
beforeEach(async(done) => {
let apps = new AppsActions();
let users = new UsersActions();
@@ -70,9 +66,7 @@ describe('Comment component for Processes', () => {
done();
});
afterEach(async(done) => {
await loginPage.loginToProcessServicesUsingUserModel(user);
afterAll(async(done) => {
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId);
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);

View File

@@ -53,10 +53,6 @@ describe('Comment component for Processes', () => {
hostBpm: TestConfig.adf.url
});
done();
});
beforeEach(async(done) => {
let apps = new AppsActions();
let users = new UsersActions();
@@ -78,9 +74,7 @@ describe('Comment component for Processes', () => {
done();
});
afterEach(async(done) => {
await loginPage.loginToProcessServicesUsingUserModel(user);
afterAll(async(done) => {
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId);
await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);

View File

@@ -49,7 +49,6 @@
<ng-container *ngIf="!loading && !noPermission">
<div *ngFor="let row of data.getRows(); let idx = index"
class="adf-datatable-row"
[class.adf-datatable-row-thumbnail]="data.thumbnails"
role="button"
[class.is-selected]="row.isSelected"
[adf-upload]="allowDropFiles && rowAllowsDrop(row)" [adf-upload-data]="row"
@@ -81,9 +80,8 @@
(change)="onCheckboxChange(row, $event)">
</mat-checkbox>
</div>
<div *ngFor="let col of data.getColumns(), let first = first;"
<div *ngFor="let col of data.getColumns()"
class="adf-data-table-cell adf-datatable-table-cell adf-data-table-cell--{{col.type || 'text'}} {{col.cssClass}}"
[class.cell-thumbnail]="data.thumbnails && first"
[attr.title]="col.title | translate"
[attr.filename]="getFilename(row)"
tabindex="0"
@@ -93,9 +91,7 @@
[context-menu-enabled]="contextMenu">
<div *ngIf="!col.template" class="cell-container">
<ng-container [ngSwitch]="col.type">
<div *ngSwitchCase="'image'"
class="cell-value"
[class.adf-image-gallery-cell]="data.thumbnails">
<div *ngSwitchCase="'image'" class="cell-value">
<mat-icon *ngIf="isIconValue(row, col); else no_iconvalue">{{ asIconValue(row, col) }}
</mat-icon>
<ng-template #no_iconvalue>
@@ -104,7 +100,6 @@
</mat-icon>
<ng-template #no_selected_row>
<img
[class.adf-image-gallery]="data.thumbnails"
alt="{{ iconAltTextKey(data.getValue(row, col)) | translate }}"
src="{{ data.getValue(row, col) }}"
(error)="onImageLoadingError($event, row)">
@@ -183,6 +178,7 @@
</button>
</mat-menu>
</div>
</div>
<div *ngIf="isEmpty()"
[class.adf-datatable-row]="display === 'list'"

View File

@@ -55,10 +55,6 @@
@include mat-overridable-elevation(2);
}
.adf-datatable-row-thumbnail {
height: 300px !important;
}
.adf-datatable-row-empty-card {
height: 0 !important;
padding-top: 0;
@@ -121,7 +117,6 @@
}
}
.alfresco-datatable__actions-cell {
position: absolute;
height: 42px !important;
@@ -130,17 +125,6 @@
text-align: right;
}
.adf-image-gallery {
height: 100px;
}
.adf-image-gallery-cell {
display: flex;
width: 265px;
flex: 0 0 auto;
justify-content: center;
}
.image-table-cell {
margin: 8px;
padding: 4px;
@@ -165,13 +149,6 @@
}
}
.cell-thumbnail {
flex: 0 0 auto;
display: flex;
flex-direction: column-reverse;
justify-content: space-between;
}
.adf-datatable-table-checkbox {
margin: 8px;
}

1130
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -18,19 +18,20 @@
"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\" ",
"start:dist": "ng lint dist && npm run validate-config && npm run server-versions && ng serve dist --prod --host 0.0.0.0 --disable-host-check --proxy-config ./demo-shell/proxy.conf.js --open",
"build": "ng lint dev && npm run validate-config && npm run server-versions && ng build dist",
"build": "npm run validate-config && npm run server-versions && ng build dist",
"build:dev": "npm run validate-config && npm run style:dev && npm run server-versions && ng build dev",
"build:dist": "npm run validate-config && npm run server-versions && ng build dist --prod --stats-json ",
"build:dist": "npm run validate-config && npm run server-versions && node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build dist --prod --stats-json ",
"style:dev": "npm run webpack -- --config ./lib/config/webpack.style.js --progress --profile --bail",
"webpack-bundle-analyzer": "webpack-bundle-analyzer demo-shell/dist/stats.json",
"test": "npm run validate-config && ng test dev --watch=false",
"e2e": "ng e2e demo-shell-e2e",
"e2e-lib": "ng e2e lib-e2e --port=4200 ",
"e2e": "./scripts/test-e2e-lib.sh -host 'localhost:4200' -dev --folder demo-shell",
"e2e-lib": "ng e2e lib-e2e --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",
"webpack": "node ./node_modules/webpack/bin/webpack.js",
"ng-packagr": "node ./node_modules/ng-packagr/cli/main.js"
"ng-packagr": "node ./node_modules/ng-packagr/cli/main.js",
"lite-server-e2e": "lite-server --baseDir='demo-shell/dist/' -c ./e2e/lite-server-proxy.js"
},
"config": {
"ghooks": {
@@ -78,14 +79,13 @@
"@nrwl/schematics": "^1.0.3",
"@schematics/angular": "^0.6.8",
"adf-tslint-rules": "0.0.4",
"alfresco-js-api": "2.5.0",
"alfresco-js-api": "^2.6.0-c87428564306f710159976b0d740a07a94326cf1",
"alfresco-js-api-node": "2.5.0",
"chart.js": "2.5.0",
"classlist.js": "1.1.20150312",
"core-js": "^2.5.4",
"custom-event-polyfill": "0.3.0",
"hammerjs": "2.0.8",
"intl": "1.2.5",
"minimatch-browser": "1.0.0",
"moment": "2.22.2",
"moment-es6": "^1.0.0",
@@ -111,6 +111,7 @@
"@types/node": "6.0.90",
"ajv-cli": "^3.0.0",
"angular2-template-loader": "0.6.2",
"archiver": "^3.0.0",
"astrolabe": "^0.3.6",
"autoprefixer": "6.5.4",
"bundlesize": "^0.15.3",
@@ -118,9 +119,11 @@
"codelyzer": "4.3.0",
"commander": "^2.15.1",
"concurrently": "^3.5.1",
"connect-history-api-fallback": "^1.5.0",
"ejs": "^2.6.1",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"fs-extra": "^4.0.2",
"http-proxy-middleware": "^0.19.0",
"jasmine-ajax": "3.2.0",
"jasmine-core": "~2.8.0",
"jasmine-reporters": "^2.3.1",
@@ -138,6 +141,7 @@
"karma-mocha-reporter": "2.2.5",
"karma-remap-istanbul": "0.6.0",
"karma-systemjs": "0.16.0",
"lite-server": "^2.4.0",
"markdown-toc": "1.1.0",
"markdownlint-cli": "^0.12.0",
"mdast-util-compact": "^1.0.1",
@@ -164,6 +168,7 @@
"tslint": "5.9.1",
"typedoc": "^0.11.1",
"typescript": "2.9.2",
"unzipper": "^0.9.3",
"url-join": "^4.0.0",
"webpack-bundle-analyzer": "^2.13.1",
"webpack-cli": "^3.1.0",

View File

@@ -18,7 +18,7 @@ var SELENIUM_SERVER = process.env.SELENIUM_SERVER || '';
var DIRECT_CONNECCT = SELENIUM_SERVER ? false : true;
var NAME_TEST = process.env.NAME_TEST ? true : false
var specsToRun = './e2e/' + FOLDER + '**/*.e2e.ts';
var specsToRun = './**/' + FOLDER + '**/*.e2e.ts';
if (process.env.NAME_TEST) {
specsToRun = './e2e/**/' + process.env.NAME_TEST;

19
scripts/copy-dist-node.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/../
echo "====== COPY new build in node_modules ===== "
rm -rf ../node_modules/@alfresco
mkdir -p $DIR/../node_modules/@alfresco/adf-core
mkdir -p $DIR/../node_modules/@alfresco/adf-content-services
mkdir -p $DIR/../node_modules/@alfresco/adf-process-services
mkdir -p $DIR/../node_modules/@alfresco/adf-insights
cp -R $DIR/../lib/dist/core/* $DIR/../node_modules/@alfresco/adf-core
cp -R $DIR/../lib/dist/content-services/* $DIR/../node_modules/@alfresco/adf-content-services
cp -R $DIR/../lib/dist/process-services/* $DIR/../node_modules/@alfresco/adf-process-services
cp -R $DIR/../lib/dist/insights/* $DIR/../node_modules/@alfresco/adf-insights

84
scripts/download-build-in-cs.js Executable file
View File

@@ -0,0 +1,84 @@
var program = require('commander');
var AlfrescoApi = require('alfresco-js-api-node');
var http = require('http');
var fs = require('fs');
var path = require('path');
var archiver = require('archiver');
var unzipper = require('unzipper');
var exec = require('child_process').exec;
replaceHrefInIndex = (folder) => {
fs.readFile(`demo-shell/${folder}/index.html`, 'utf8', function (err, data) {
if (err) {
return console.log(err);
}
var result = data.replace(`base href="/"`, `base href=\"/${folder}/\"`);
fs.writeFile(`demo-shell/${folder}/index.html`, result, 'utf8', function (err) {
if (err) return console.log(err);
});
});
}
async function main() {
program
.version('0.1.0')
.option('-p, --password [type]', 'password')
.option('-u, --username [type]', 'username')
.option('--base-href [type]', '')
.option('-f, --folder [type]', 'Name of the folder')
.option('-host, --host [type]', 'URL of the CS')
.parse(process.argv);
let alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: program.host
});
alfrescoJsApi.login(program.username, program.password);
let zipDemoNode;
try {
zipDemoNode = await alfrescoJsApi.nodes.getNode('-my-', {
'relativePath': `Builds/${program.folder}/demo.zip`
});
} catch (error) {
console.log('error: ' + error);
}
const url = await alfrescoJsApi.content.getContentUrl(zipDemoNode.entry.id, true);
console.log('Download zip');
let outputFolder = program.baseHref ? program.baseHref : 'dist';
var file = fs.createWriteStream('demo.zip');
http.get(`http://${url}`, (response) => {
response.pipe(file);
file.on('finish', async () => {
console.log('Unzip Demo ' + path.join(__dirname, '../demo.zip'));
fs.createReadStream(path.join(__dirname, '../demo.zip'))
.pipe(unzipper.Extract({path: path.join(__dirname, '../demo-shell')}))
.on('finish', () => {
exec(`mv demo-shell/demo.zip demo-shell/${outputFolder}`, (err, stdout, stderr) => {
if (err) {
console.log(`err: ${err}`);
return;
}
if(program.baseHref) {
replaceHrefInIndex(outputFolder);
}
});
})
});
});
}
main();

16
scripts/lint.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR/../"
echo "====== lint Lib ====="
npm run lint-lib || exit 1
echo "====== lint E2E ====="
npm run lint-e2e
echo "====== lint Demo shell ====="
ng lint dev --fix

View File

@@ -3,10 +3,6 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/..
echo "====== lint ====="
npm run lint-lib || exit 1
echo "====== clean ====="
rm -rf node_modules/@alfresco

View File

@@ -13,6 +13,7 @@ eval GIT_ISH=""
eval SINGLE_TEST=""
eval EXEC_VERSION_JSAPI=false
eval JSAPI_VERSION=""
eval EXECLINT=true
eval projects=( "core"
"content-services"
@@ -53,13 +54,11 @@ enable_testbrowser(){
test_project() {
echo "====== test project: $1 ====="
ng lint $1 || exit 1
ng test $1 --watch=false || exit 1
}
debug_project() {
echo "====== debug project: $1 ====="
ng lint $1 || exit 1
ng test $1 || exit 1
}
@@ -92,6 +91,10 @@ exec_install(){
EXEC_INSTALL=false
}
skip_lint(){
EXECLINT=false
}
while [[ $1 == -* ]]; do
case "$1" in
-h|--help|-\?) show_help; exit 0;;
@@ -107,12 +110,17 @@ while [[ $1 == -* ]]; do
-c|--clean) clean; shift;;
-si|--skipinstall) exec_install; shift;;
-sb|--skipbuild) exclude_build; shift;;
-sl|--skip-lint) skip_lint; shift;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
esac
done
cd "$DIR/../"
if [[ EXECLINT == "true" ]]; then
npm run lint-lib || exit 1
fi
if $EXEC_CLEAN == true; then
echo "====== Clean components ====="
npm install rimraf -g

View File

@@ -4,6 +4,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR/../"
BROWSER_RUN=false
DEVELOPMENT=false
EXECLINT=true
LITESERVER=false
show_help() {
echo "Usage: ./scripts/test-e2e-lib.sh -host adf.domain.com -u admin -p admin -e admin"
@@ -20,6 +22,7 @@ show_help() {
echo "-host or --host URL of the Front end to test"
echo "-save save the error screenshot in the remote env"
echo "-timeout or --timeout override the timeout foe the wait utils"
echo "-sl --skip-lint skip lint"
echo "-h or --help"
}
@@ -70,6 +73,14 @@ set_selenium(){
SELENIUM_SERVER=$1
}
skip_lint(){
EXECLINT=false
}
lite_server(){
LITESERVER=true
}
while [[ $1 == -* ]]; do
case "$1" in
-h|--help|-\?) show_help; exit 0;;
@@ -81,10 +92,12 @@ while [[ $1 == -* ]]; do
-b|--browser) set_browser; shift;;
-dev|--dev) set_development; shift;;
-s|--spec) set_test $2; shift 2;;
-ud|--use-dist) lite_server; shift;;
-save) set_save_screenshot; shift;;
-proxy|--proxy) set_proxy $2; shift 2;;
-s|--seleniumServer) set_selenium $2; shift 2;;
-host|--host) set_host $2; shift 2;;
-sl|--skip-lint) skip_lint; shift;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
esac
done
@@ -104,14 +117,22 @@ export FOLDER=$FOLDER'/'
export SELENIUM_SERVER=$SELENIUM_SERVER
export NAME_TEST=$NAME_TEST
npm run lint-e2e || exit 1
if [[ EXECLINT == "true" ]]; then
npm run lint-e2e || exit 1
fi
if [[ $DEVELOPMENT == "true" ]]; then
echo "====== Run against local development ====="
npm run e2e-lib || exit 1
else
webdriver-manager update --gecko=false --versions.chrome=2.38
if [[ $LITESERVER == "true" ]]; then
echo "====== Run dist in lite-server ====="
ls demo-shell/dist
npm run lite-server-e2e>/dev/null & ./node_modules/protractor/bin/protractor protractor.conf.js || exit 1
else
./node_modules/protractor/bin/protractor protractor.conf.js || exit 1
fi
fi

93
scripts/upload-build-in-cs.js Executable file
View File

@@ -0,0 +1,93 @@
var program = require('commander');
var AlfrescoApi = require('alfresco-js-api-node');
var fs = require('fs');
var path = require('path');
var archiver = require('archiver');
writeZipLib = async function (zipFolder) {
if (!fs.existsSync(zipFolder)) {
fs.mkdirSync(zipFolder);
}
// create a file to stream archive data to.
let output = fs.createWriteStream(path.join(zipFolder, `demo.zip`));
let archive = archiver('zip', {
zlib: {level: 9} // Sets the compression level.
});
archive.pipe(output);
archive.directory(path.join(__dirname, `../demo-shell/dist/`), `demo.zip`);
return archive.finalize();
};
async function main() {
program
.version('0.1.0')
.option('-p, --password [type]', 'password')
.option('-u, --username [type]', 'username')
.option('-f, --folder [type]', 'Name of the folder')
.option('-host, --host [type]', 'URL of the CS')
.parse(process.argv);
let alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: program.host
});
let zipFolder = path.join(__dirname, '../demo-shell/zip/');
await this.writeZipLib(zipFolder);
let files = fs.readdirSync(path.join(__dirname, '../demo-shell/zip'));
if (files && files.length > 0) {
alfrescoJsApi.login(program.username, program.password);
let folder;
if (!program.folder) {
program.folder = Date.now();
}
try {
folder = await alfrescoJsApi.nodes.addNode('-my-', {
'name': program.folder,
'relativePath': `Builds`,
'nodeType': 'cm:folder'
}, {}, {
'overwrite': true
});
} catch (error) {
console.log('error' + error);
}
for (const fileName of files) {
let pathFile = path.join(__dirname, '../demo-shell/zip/demo.zip');
console.log('Upload ' + pathFile);
let file = fs.createReadStream(pathFile);
try {
await alfrescoJsApi.upload.uploadFile(
file,
'',
folder.entry.id,
null,
{
'name': file.name,
'nodeType': 'cm:content'
});
} catch (error) {
console.log('error' + error);
}
}
}
}
main();

File diff suppressed because it is too large Load Diff

View File

@@ -4,6 +4,7 @@
"export-2.0.0.json",
"export-2.1.0.json",
"export-2.2.0.json",
"export-2.3.0.json"
"export-2.3.0.json",
"export-2.5.0.json"
]
}

File diff suppressed because it is too large Load Diff