mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACA-4715] cleanup Docker and update documentation (#3328)
* move ADF linking to the dev docs * add basic Docker docs * reduce docker params * update docker docs
This commit is contained in:
parent
7ab4cc5e53
commit
b192c5f6bb
@ -16,13 +16,11 @@ USER root
|
||||
RUN apk update && apk upgrade
|
||||
USER 101
|
||||
|
||||
ARG PROJECT_NAME
|
||||
|
||||
COPY docker/default.conf.template /etc/nginx/templates/
|
||||
|
||||
COPY dist/$PROJECT_NAME /usr/share/nginx/html/
|
||||
COPY dist/$PROJECT_NAME/app.config.json /etc/nginx/templates/app.config.json.template
|
||||
COPY dist/$PROJECT_NAME/assets/app.extensions.json /etc/nginx/templates/app.extensions.json.template
|
||||
COPY dist/content-ce /usr/share/nginx/html/
|
||||
COPY dist/content-ce/app.config.json /etc/nginx/templates/app.config.json.template
|
||||
COPY dist/content-ce/assets/app.extensions.json /etc/nginx/templates/app.extensions.json.template
|
||||
COPY --from=builder /usr/src/alfresco/licenses /usr/share/nginx/html/
|
||||
|
||||
USER root
|
||||
|
38
README.md
38
README.md
@ -37,16 +37,6 @@ npm install
|
||||
npm start
|
||||
```
|
||||
|
||||
### Using Local ADF
|
||||
|
||||
Clone the `alfresco-ng2-components` and `alfresco-content-app` repositories in the same folder, and run the following command:
|
||||
|
||||
```sh
|
||||
npm start -- --configuration=adf
|
||||
```
|
||||
|
||||
Changing the ADF code results in the recompilation and hot-reloading of the ACA application.
|
||||
|
||||
## Unit Tests
|
||||
|
||||
Use following command to test the projects:
|
||||
@ -69,31 +59,3 @@ nx test <project> -- --watch
|
||||
|
||||
Upon changing unit tests code, you can track the coverage results either in the console output, or by reloading the HTML report in the browser.
|
||||
|
||||
## 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
|
||||
|
||||

|
||||
|
@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
echo building $1
|
||||
npm clean-install
|
||||
npm run build.release $*
|
@ -1,11 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
[[ "$BUILD_ENABLED" == "true" ]] && $(dirname $0)/build.sh
|
||||
|
||||
env \
|
||||
PROJECT_NAME=content-ce \
|
||||
BASE_PATH=${BASE_PATH:-/workspace} \
|
||||
DOCKER_IMAGE_REPO=alfresco/alfresco-content-app \
|
||||
$(dirname $0)/run.sh
|
@ -1,21 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
eval ALL_ARGUMENTS=("BASE_PATH"
|
||||
)
|
||||
ALL_ARGUMENTS_LENGTH=${#ALL_ARGUMENTS[@]}
|
||||
DOCKER_ARGS=""
|
||||
for (( j=0; j<${ALL_ARGUMENTS_LENGTH}; j++ )); do
|
||||
ARG="${ALL_ARGUMENTS[$j]}"
|
||||
if [ -v "${ARG}" ]; then
|
||||
DOCKER_ARGS="$DOCKER_ARGS --env $ARG=${!ARG}"
|
||||
fi
|
||||
done
|
||||
|
||||
DOCKER_IMAGE_REPO=alfresco/alfresco-content-app
|
||||
HOST_PORT=8081
|
||||
CONTAINER_PORT=8080
|
||||
|
||||
docker rmi -f $DOCKER_IMAGE_REPO
|
||||
docker build --build-arg PROJECT_NAME=$PROJECT_NAME -t $DOCKER_IMAGE_REPO .
|
||||
echo "http://localhost:${HOST_PORT}${BASE_PATH}"
|
||||
docker run --rm -it $DOCKER_ARGS --user 1000:1000 --publish $HOST_PORT:$CONTAINER_PORT $DOCKER_IMAGE_REPO
|
||||
docker build -t $DOCKER_IMAGE_REPO .
|
||||
|
||||
echo "http://localhost:${HOST_PORT}"
|
||||
docker run --rm -it --user 1000:1000 --publish $HOST_PORT:$CONTAINER_PORT $DOCKER_IMAGE_REPO
|
||||
|
@ -16,3 +16,5 @@ Learn how to start developing with the Alfresco Content Application.
|
||||
- [CORS](/getting-started/cors)
|
||||
- [Single Sign-On](/getting-started/sso)
|
||||
- [Navigation](/getting-started/navigation)
|
||||
- [Using local ADF](/getting-started/using-local-adf)
|
||||
- [Docker Support](/getting-started/docker)
|
||||
|
48
docs/getting-started/docker.md
Normal file
48
docs/getting-started/docker.md
Normal file
@ -0,0 +1,48 @@
|
||||
# Docker Support
|
||||
|
||||
Running local build with Docker
|
||||
|
||||
```shell
|
||||
npm run build
|
||||
```
|
||||
|
||||
The application is already preconfigured to run alongside backend containers within the Docker Compose.
|
||||
|
||||
If you need to provide custom settings, update `dist/content-ce/app.config.json` file.
|
||||
See [Configuration](/configuration/) section for more details
|
||||
|
||||
Build and run the container:
|
||||
|
||||
```shell
|
||||
./docker/run.sh
|
||||
```
|
||||
|
||||
The application is configured to run at `http://localhost:8081`.
|
||||
|
||||
## Containerized Deployment
|
||||
|
||||
Typically, you do not need changing application configuration when running ACA in the containerized deployment scenario.
|
||||
All defaults are already preconfigured and pointing to the locally running Nginx proxy.
|
||||
|
||||
Please refer to [ACS Deployment](https://github.com/Alfresco/acs-deployment)
|
||||
and [ACS Docker Compose](https://github.com/Alfresco/acs-deployment/tree/master/docs/docker-compose) for more details.
|
||||
|
||||
## Building manually
|
||||
|
||||
Update `dist/content-ce/app.config.json` if needed.
|
||||
|
||||
```shell
|
||||
# cleanup previous
|
||||
docker rmi -f alfresco/alfresco-content-app
|
||||
|
||||
# build
|
||||
docker build -t alfresco/alfresco-content-app .
|
||||
```
|
||||
|
||||
You can now run this locally:
|
||||
|
||||
```shell
|
||||
docker run --rm -it --user 1000:1000 --publish 8081:8080 alfresco/alfresco-content-app
|
||||
```
|
||||
|
||||
Navigate to `http://localhost:8081`.
|
40
docs/getting-started/using-local-adf.md
Normal file
40
docs/getting-started/using-local-adf.md
Normal file
@ -0,0 +1,40 @@
|
||||
# Using Local ADF
|
||||
|
||||
If you are working with ADF source code and want to use the modified version with the ACA.
|
||||
|
||||
Clone the `alfresco-ng2-components` and `alfresco-content-app` repositories in the same folder, and run the following command:
|
||||
|
||||
```sh
|
||||
npm start -- --configuration=adf
|
||||
```
|
||||
|
||||
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
|
||||
|
||||

|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
@ -17,6 +17,8 @@
|
||||
- [CORS](/getting-started/cors)
|
||||
- [Configuration](/configuration/)
|
||||
- [Navigation](/getting-started/navigation)
|
||||
- [Local ADF](/getting-started/using-local-adf)
|
||||
- [Docker Support](/getting-started/docker)
|
||||
- [Extending](/extending/)
|
||||
- [Extensibility features](/extending/extensibility-features)
|
||||
- [Extension format](/extending/extension-format)
|
||||
|
Loading…
x
Reference in New Issue
Block a user