mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACA-4625] ADF linking in ACA (#2841)
* [ACA-4625] ADF linking in ACA * [ACA-4625] ADF linking docs * [ACA-4625] Move adf linking to before install script * [ACA-4625] Move ADF linking to before_install script * [ACA-4625] Delete unused stage from Travis
This commit is contained in:
parent
b609a9cd33
commit
5ac0ff616d
11
.travis.yml
11
.travis.yml
@ -22,8 +22,7 @@ branches:
|
|||||||
- develop
|
- develop
|
||||||
- /.*beta.*/
|
- /.*beta.*/
|
||||||
|
|
||||||
before_install:
|
before_install: . ./scripts/ci/job_hooks/before_install.sh
|
||||||
- . ./scripts/ci/job_hooks/before_install.sh
|
|
||||||
|
|
||||||
install: echo "no install"
|
install: echo "no install"
|
||||||
|
|
||||||
@ -66,7 +65,7 @@ jobs:
|
|||||||
- stage: Quality and Unit tests
|
- stage: Quality and Unit tests
|
||||||
name: 'Build (without animation)'
|
name: 'Build (without animation)'
|
||||||
before_script: npx @alfresco/adf-cli update-commit-sha --pointer "HEAD" --pathPackage "$(pwd)"
|
before_script: npx @alfresco/adf-cli update-commit-sha --pointer "HEAD" --pathPackage "$(pwd)"
|
||||||
script: npm ci && npm run build -- --configuration=production,e2e
|
script: npm ci && npm run build -- $BUILD_OPTS
|
||||||
after_success: ./scripts/ci/utils/artifact-to-s3.sh -a $CONTENT_CE_DIST_PATH -o "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" || travis_terminate 1
|
after_success: ./scripts/ci/utils/artifact-to-s3.sh -a $CONTENT_CE_DIST_PATH -o "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" || travis_terminate 1
|
||||||
cache: false
|
cache: false
|
||||||
|
|
||||||
@ -209,6 +208,12 @@ jobs:
|
|||||||
after_script:
|
after_script:
|
||||||
- ./scripts/ci/job_hooks/after_e2e.sh
|
- ./scripts/ci/job_hooks/after_e2e.sh
|
||||||
|
|
||||||
|
- stage: Finalize
|
||||||
|
name: Check build with link-adf
|
||||||
|
if: type = pull_request AND commit_message =~ \[link-adf:*
|
||||||
|
script:
|
||||||
|
- ./scripts/ci/jobs/check-link-adf.sh
|
||||||
|
|
||||||
- stage: Publish Docker Registry
|
- stage: Publish Docker Registry
|
||||||
name: Publish Docker Registry
|
name: Publish Docker Registry
|
||||||
script: ./scripts/travis/deploy/publish.sh "content-ce" "$DOCKER_REPOSITORY_DOMAIN" "$QUAY_USERNAME" "$QUAY_PASSWORD"
|
script: ./scripts/travis/deploy/publish.sh "content-ce" "$DOCKER_REPOSITORY_DOMAIN" "$QUAY_USERNAME" "$QUAY_PASSWORD"
|
||||||
|
29
README.md
29
README.md
@ -39,6 +39,35 @@ npm start content-ce -- --configuration=adf
|
|||||||
|
|
||||||
Changing the ADF code results in the recompilation and hot-reloading of the ACA application.
|
Changing the ADF code results in the recompilation and hot-reloading of the ACA application.
|
||||||
|
|
||||||
|
## Triggering the build to use specific branch of ADF with CI flags
|
||||||
|
|
||||||
|
You can create commits with the intention of running the build pipeline using a specific branch of ADF. To achieve this, you need to add a specific CI flag in your commit message:
|
||||||
|
|
||||||
|
```text
|
||||||
|
[link-adf:my-custom-branch-in-adf-repo]
|
||||||
|
```
|
||||||
|
|
||||||
|
So for example a commit message can be like:
|
||||||
|
|
||||||
|
```text
|
||||||
|
[link-adf:my-custom-branch-in-adf-repo] Adding XYZ features for the navigation header
|
||||||
|
```
|
||||||
|
|
||||||
|
When having this CI flag present in the commit message, the CI attempts to check out the given branch of ADF and use it when building / testing the applications.
|
||||||
|
|
||||||
|
### Important things to consider
|
||||||
|
|
||||||
|
- **This flag can only be used for PRs, not for any other type of builds**
|
||||||
|
- At the end of a PR build, there is a check which will make the build fail if you used this CI flag. This is there to make sure, only those PRs can be merged, which are using already merged in ADF features, **since this flag's only purpose is to be able to test whether the applications could be built with an experimental ADF feature or not**.
|
||||||
|
|
||||||
|
This step is rendered in the `Finalize` stage
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
with an error message
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## See Also
|
## See Also
|
||||||
|
|
||||||
Please refer to the [Public documentation](https://alfresco-content-app.netlify.com/) for more details
|
Please refer to the [Public documentation](https://alfresco-content-app.netlify.com/) for more details
|
||||||
|
10
angular.json
10
angular.json
@ -198,6 +198,16 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"optimization": false,
|
"optimization": false,
|
||||||
"namedChunks": true
|
"namedChunks": true
|
||||||
|
},
|
||||||
|
"adfprod": {
|
||||||
|
"tsConfig": "app/tsconfig.app.adf.json",
|
||||||
|
"outputHashing": "all",
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "app/src/environments/environment.ts",
|
||||||
|
"with": "app/src/environments/environment.prod.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": ""
|
"defaultConfiguration": ""
|
||||||
|
@ -4,17 +4,5 @@
|
|||||||
"outDir": "../out-tsc/content-ce"
|
"outDir": "../out-tsc/content-ce"
|
||||||
},
|
},
|
||||||
"files": ["src/main.ts", "src/polyfills.ts"],
|
"files": ["src/main.ts", "src/polyfills.ts"],
|
||||||
"include": ["src/**/*.d.ts"],
|
"include": ["src/**/*.d.ts"]
|
||||||
"exclude": [
|
|
||||||
"**/*.spec.ts",
|
|
||||||
"**/*.spec.ts",
|
|
||||||
"**/*.mock.ts",
|
|
||||||
"src/test.ts",
|
|
||||||
"src/environments/environment.prod.ts",
|
|
||||||
"src/environments/environment.e2e.ts",
|
|
||||||
"src/app/testing/app-testing.module.ts",
|
|
||||||
"src/app/testing/translation.service.ts",
|
|
||||||
"src/app/testing/translate-pipe.directive.ts",
|
|
||||||
"src/environments/environment.release.ts"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
BIN
assets/link-adf-travis-console.png
Normal file
BIN
assets/link-adf-travis-console.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 92 KiB |
BIN
assets/link-adf-travis-stage.png
Normal file
BIN
assets/link-adf-travis-stage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
@ -1,4 +1,11 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
PARENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
||||||
|
# Build options -----------------------------------------------------------------------
|
||||||
|
export BUILD_OPTS="--configuration=production,e2e"
|
||||||
|
|
||||||
|
# Commit settings for ADF linking -----------------------------------------------------
|
||||||
|
export HEAD_COMMIT_HASH=${TRAVIS_PULL_REQUEST_SHA:-${TRAVIS_COMMIT}}
|
||||||
|
export COMMIT_MESSAGE=`git log --format=%B -n 1 $HEAD_COMMIT_HASH`
|
||||||
|
|
||||||
# Settings for Angular builder --------------------------------------------------------
|
# Settings for Angular builder --------------------------------------------------------
|
||||||
export NODE_OPTIONS="--max_old_space_size=30000"
|
export NODE_OPTIONS="--max_old_space_size=30000"
|
||||||
@ -19,6 +26,7 @@ if [ "${TRAVIS_EVENT_TYPE}" == "push" ]; then
|
|||||||
elif [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then
|
elif [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then
|
||||||
export S3_DBP_ROOT_FOLDER="$S3_DBP_PATH/$TRAVIS_PULL_REQUEST"
|
export S3_DBP_ROOT_FOLDER="$S3_DBP_PATH/$TRAVIS_PULL_REQUEST"
|
||||||
export BASE_HASH="origin/$TRAVIS_BRANCH"
|
export BASE_HASH="origin/$TRAVIS_BRANCH"
|
||||||
|
source $PARENT_DIR/partials/_adf-linking.sh
|
||||||
elif [ "${TRAVIS_EVENT_TYPE}" == "cron" ]; then
|
elif [ "${TRAVIS_EVENT_TYPE}" == "cron" ]; then
|
||||||
export S3_DBP_ROOT_FOLDER="$S3_DBP_PATH/cron"
|
export S3_DBP_ROOT_FOLDER="$S3_DBP_PATH/cron"
|
||||||
else
|
else
|
||||||
|
5
scripts/ci/jobs/check-link-adf.sh
Executable file
5
scripts/ci/jobs/check-link-adf.sh
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
BRANCH=`echo $COMMIT_MESSAGE | grep -o "\[link-adf\:[^]]*\]" | sed -e 's#\[link-adf:##g' | sed -e 's#\]##g'`
|
||||||
|
echo -e "\e[31mPRs are not mergeable with conditional build. This build was run with custom ADF branch: $BRANCH \e[0m"
|
||||||
|
exit 1
|
19
scripts/ci/partials/_adf-linking.sh
Executable file
19
scripts/ci/partials/_adf-linking.sh
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
# Note no #!/bin/sh as this should not spawn
|
||||||
|
# an extra shell, since this partial shell script
|
||||||
|
# is supposed to be invoked as part of another.
|
||||||
|
# ---------------------------------------------------------------
|
||||||
|
# ADF linking
|
||||||
|
# ---------------------------------------------------------------
|
||||||
|
if [[ $COMMIT_MESSAGE == *"[link-adf:"* ]]; then
|
||||||
|
export BUILD_OPTS="--configuration=adfprod,e2e"
|
||||||
|
BRANCH=`echo $COMMIT_MESSAGE | grep -o "\[link-adf\:[^]]*\]" | sed -e 's#\[link-adf:##g' | sed -e 's#\]##g'`
|
||||||
|
echo "Checking out ADF's branch: ${BRANCH}" && \
|
||||||
|
git clone https://github.com/Alfresco/alfresco-ng2-components.git --depth=1 --branch ${BRANCH} ../alfresco-ng2-components
|
||||||
|
# ADF theming needs it the styling
|
||||||
|
CWD=`pwd`
|
||||||
|
cd ../alfresco-ng2-components
|
||||||
|
npm install @angular/material
|
||||||
|
cd $CWD
|
||||||
|
else
|
||||||
|
echo -e "\e[32mUsing ADF from installed node_modules.\e[0m"
|
||||||
|
fi ;
|
Loading…
x
Reference in New Issue
Block a user