From b09c93b1030a1a01d62f54da0ab71aa44cb5b044 Mon Sep 17 00:00:00 2001 From: Martin Muller Date: Fri, 17 Jan 2020 17:51:40 +0100 Subject: [PATCH] Git Submodules improvements (#1300) * fix local adf script + attach _LOCAL to the local created libraries * fix redirect login for SSO * optimise package.json --- alfresco-ng2-components | 2 +- package.json | 17 +++++++++-------- scripts/install-local-adf.sh | 14 +++++++++++++- scripts/install-local-js-api.sh | 5 +++++ start.sh | 2 +- 5 files changed, 29 insertions(+), 11 deletions(-) diff --git a/alfresco-ng2-components b/alfresco-ng2-components index 20a444261..94e02c055 160000 --- a/alfresco-ng2-components +++ b/alfresco-ng2-components @@ -1 +1 @@ -Subproject commit 20a444261248efafb0e3df323c7e1753dce4dbb1 +Subproject commit 94e02c0552bf1cfd84af87a92fbf237ee75e5744 diff --git a/package.json b/package.json index 95bc3fcaf..7c41410a8 100644 --- a/package.json +++ b/package.json @@ -4,18 +4,19 @@ "license": "LGPL-3.0", "scripts": { "ng": "ng", - "start": "npm run validate-config && npm run build.shared && npm run build.extensions && ng serve --open", + "start": "npm run validate-config && npm run build.extensions && ng serve --open", "start:prod": "npm run validate-config && node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng serve --prod --open", "build:aos-extension": "npx rimraf dist/@alfresco/adf-office-services-ext && ng build adf-office-services-ext && cpr projects/adf-office-services-ext/ngi.json dist/@alfresco/adf-office-services-ext/ngi.json && cpr projects/adf-office-services-ext/assets dist/@alfresco/adf-office-services-ext/assets", "build.shared": "ng build aca-shared", - "build.extensions": "npm run build:aos-extension", + "build.aos": "npm run build:aos-extension", + "build.extensions": "npm run build.shared && npm run build:aos-extension", "build.app": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build app", - "build": "npm run validate-config && npm run build.shared && npm run build.extensions && npm run build.app -- --prod", - "build.js-api": "./init-submodules.sh && ./scripts/install-local-js-api.sh && npm run build", - "build.adf": "./init-submodules.sh && ./scripts/install-local-adf.sh && npm run build", - "build.e2e": "npm run build.shared && npm run build.extensions && npm run build.app -- --prod --configuration=e2e", + "build": "npm run validate-config && build.extensions && npm run build.app -- --prod", + "build.js-api": "./scripts/install-local-js-api.sh && npm run build", + "build.adf": "./scripts/install-local-adf.sh && build.extensions && npm run build.app", + "build.e2e": "npm run build.extensions && npm run build.app -- --prod --configuration=e2e", "test": "ng test app --code-coverage", - "test:ci": "npm run build.shared && npm run build.extensions && ng test adf-office-services-ext --watch=false && ng test app --code-coverage --watch=false", + "test:ci": "npm run build.extensions && ng test adf-office-services-ext --watch=false && ng test app --code-coverage --watch=false", "lint": "ng lint && npm run spellcheck && npm run format:check && npm run e2e.typecheck", "wd:update": "webdriver-manager update --gecko=false $VERSION_CHROME", "e2e.typecheck": "tsc -p ./e2e/tsconfig.e2e.typecheck.json", @@ -29,7 +30,7 @@ "inspect.bundle": "ng build app --prod --stats-json && npx webpack-bundle-analyzer dist/app/stats.json", "format:check": "prettier --check \"src/{app,environments}/**/*.{ts,js,css,scss,html}\"", "format:fix": "prettier --write \"src/{app,environments}/**/*.{ts,js,css,scss,html}\"", - "build.tomcat": "npm run validate-config && npm run build.shared && npm run build.extensions && npm run build.app -- --prod --base-href ./ && jar -cvf docker/tomcat/artifacts/content-app.war -C dist/app/ .", + "build.tomcat": "npm run validate-config && npm run build.extensions && npm run build.app -- --prod --base-href ./ && jar -cvf docker/tomcat/artifacts/content-app.war -C dist/app/ .", "build.tomcat.e2e": "./build-tomcat-e2e.sh", "e2e.tomcat": "npm run wd:update && protractor --baseUrl=http://localhost:8080/content-app/ $SUITE", "docker.tomcat.start": "cd docker/tomcat && docker-compose up -d --build && npm run wait:app", diff --git a/scripts/install-local-adf.sh b/scripts/install-local-adf.sh index 1af52ddcb..e1388b21e 100755 --- a/scripts/install-local-adf.sh +++ b/scripts/install-local-adf.sh @@ -2,10 +2,12 @@ cd alfresco-ng2-components npm install -./scripts/build/build-all-lib.sh +echo "== install ADF libs ==" +./scripts/build/build-core.sh ./scripts/build/build-content-services.sh ./scripts/build/build-extensions.sh cd .. +echo "== copy ADF libs ==" rm -rf node_modules/@alfresco/adf-content-services rm -rf node_modules/@alfresco/adf-core rm -rf node_modules/@alfresco/adf-extensions @@ -15,3 +17,13 @@ mkdir -p node_modules/@alfresco/adf-extensions cp -rf alfresco-ng2-components/lib/dist/content-services/* node_modules/@alfresco/adf-content-services cp -rf alfresco-ng2-components/lib/dist/core/* node_modules/@alfresco/adf-core cp -rf alfresco-ng2-components/lib/dist/extensions/* node_modules/@alfresco/adf-extensions + +LOCAL=LOCAL +echo "== Rename local ADF libs version with attaching _$LOCAL ===" +CORE_VERSION=$(node -p "require('./node_modules/@alfresco/adf-core/package.json').version") +echo "CORE_VERSION $CORE_VERSION" +sed -i'' -e "s#\"version\": \"$CORE_VERSION\"#\"version\": \"${CORE_VERSION}_$LOCAL\"#g" ./node_modules/@alfresco/adf-core/package.json +CONTENT_VERSION=$(node -p "require('./node_modules/@alfresco/adf-content-services/package.json').version") +sed -i'' -e "s#\"version\": \"$CONTENT_VERSION#\"version\": \"${CONTENT_VERSION}_$LOCAL#g" ./node_modules/@alfresco/adf-content-services/package.json +EXT_VERSION=$(node -p "require('./node_modules/@alfresco/adf-extensions/package.json').version") +sed -i'' -e "s#\"version\": \"$EXT_VERSION#\"version\": \"${EXT_VERSION}_$LOCAL#g" ./node_modules/@alfresco/adf-extensions/package.json diff --git a/scripts/install-local-js-api.sh b/scripts/install-local-js-api.sh index f1849891e..1a5885ea2 100755 --- a/scripts/install-local-js-api.sh +++ b/scripts/install-local-js-api.sh @@ -6,3 +6,8 @@ npm install rm -rf node_modules/@alfresco/js-api mkdir -p node_modules/@alfresco/js-api cp -rf alfresco-js-api/dist/package/* node_modules/@alfresco/js-api + +LOCAL=LOCAL +echo "== Rename local JS API version with attaching _$LOCAL ===" +VERSION=$(node -p "require('./node_modules/@alfresco/js-api/package.json').version") +sed -i'' -e "s#\"version\": \"$VERSION\"#\"version\": \"${VERSION}_$LOCAL\"#g" ./node_modules/@alfresco/js-api/package.json diff --git a/start.sh b/start.sh index 38ad7c1fe..de073be42 100755 --- a/start.sh +++ b/start.sh @@ -78,7 +78,7 @@ if [[ $KEYCLOAK == "true" ]]; then export APP_CONFIG_OAUTH2_IMPLICIT_FLOW=true export APP_CONFIG_OAUTH2_SILENT_LOGIN=true export APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI="${APP_URL}/assets/silent-refresh.html" - export APP_CONFIG_OAUTH2_REDIRECT_LOGIN="/$URL_FRAGMENT/" + export APP_CONFIG_OAUTH2_REDIRECT_LOGIN="${APP_URL}/" export APP_CONFIG_OAUTH2_REDIRECT_LOGOUT="/$URL_FRAGMENT/logout" # export APP_BASE_SHARE_URL="${APP_URL}#/preview/s"