Skip to content

Commit

Permalink
[ACA-4715] break dependency on envsubst (#3325)
Browse files Browse the repository at this point in the history
* remove BPM host

* break dependency on envsubst

* remove prebuild script

* cleanup package.json
  • Loading branch information
DenysVuika authored Jul 11, 2023
1 parent f54ba92 commit 7ab4cc5
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 231 deletions.
14 changes: 1 addition & 13 deletions .github/actions/before-e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ runs:
steps:
- name: Check content UP
shell: bash
run: ./node_modules/@alfresco/adf-cli/bin/adf-cli check-cs-env --host $APP_CONFIG_ECM_HOST -u $ADMIN_EMAIL -p $ADMIN_PASSWORD || exit 1
run: ./node_modules/@alfresco/adf-cli/bin/adf-cli check-cs-env --host $BASE_URL -u $ADMIN_EMAIL -p $ADMIN_PASSWORD || exit 1

- name: Download artifacts
uses: ./.github/actions/download-job-artifact
Expand All @@ -43,18 +43,6 @@ runs:
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
aws-region: ${{ inputs.aws-region }}

- name: Replace variables in app.config.json
shell: bash
run: |
APP_CONFIG_FILE_PATH="${{ inputs.to }}/app.config.json"
npx envsub --all $APP_CONFIG_FILE_PATH $APP_CONFIG_FILE_PATH || exit 1
echo -n " \_ Validating replaced config file ... ";
npx ajv validate -s ./node_modules/@alfresco/adf-core/app.config.schema.json -d $APP_CONFIG_FILE_PATH --errors=text --verbose || exit 4
if grep -E -q '\$\{[A-Z0-9_]*\}' $APP_CONFIG_FILE_PATH; then
echo -e "\e[31m \_ ERROR: Variables are still present in the app.config.json file. Some of them might not have default value set.\e[0m";
exit 5;
fi
- name: Update webdriver-manager
shell: bash
run: |
Expand Down
6 changes: 0 additions & 6 deletions .github/actions/run-e2e-playwright/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ runs:
- name: Setup and run with options
shell: bash
run: |
# npx http-server -c-1 $CONTENT_CE_DIST_PATH -p 4200 > /dev/null &\
{
echo "APP_CONFIG_ECM_HOST={protocol}//{hostname}{:port}"
} >> .env
npm start > /dev/null &\
echo "Running playwright tests with options ${{ inputs.options }}"
Expand Down
6 changes: 0 additions & 6 deletions .github/actions/run-e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ runs:
shell: bash
run: |
./node_modules/.bin/tsc -p "./e2e/protractor/$E2E_TSCONFIG" || exit 1;
# npx http-server -c-1 $CONTENT_CE_DIST_PATH -p 4200 > /dev/null &\
{
echo "APP_CONFIG_ECM_HOST={protocol}//{hostname}{:port}"
} >> .env
npm start > /dev/null &\
if [ ${{ inputs.test-runner }} == "playwright" ]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
cancel-in-progress: true

env:
APP_CONFIG_ECM_HOST: ${{ secrets.PIPELINE_ENV_URL }}
BASE_URL: ${{ secrets.PIPELINE_ENV_URL }}
ADMIN_EMAIL: ${{ secrets.PIPELINE_ADMIN_USERNAME }}
ADMIN_PASSWORD: ${{ secrets.PIPELINE_ADMIN_PASSWORD }}
HR_USER: ${{ secrets.HR_USER }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ on:
- develop

env:
APP_CONFIG_ECM_HOST: ${{ secrets.PIPELINE_ENV_URL }}
BASE_URL: ${{ secrets.PIPELINE_ENV_URL }}
ADMIN_EMAIL: ${{ secrets.PIPELINE_ADMIN_USERNAME }}
ADMIN_PASSWORD: ${{ secrets.PIPELINE_ADMIN_PASSWORD }}
AWS_REGION: "eu-west-2"
CONTENT_CE_DIST_PATH: "./dist/content-ce"
PLAYWRIGHT_E2E_HOST: ${{ secrets.PLAYWRIGHT_E2E_HOST }}
NPM_REGISTRY_ADDRESS: ${{ secrets.NPM_REGISTRY_ADDRESS }}


jobs:
publish-docker-registry:
name: "Publish to Quay"
Expand Down
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ USER 101

ARG PROJECT_NAME

ENV APP_CONFIG_BPM_HOST="{protocol}//{hostname}{:port}"
ENV APP_CONFIG_ECM_HOST="{protocol}//{hostname}{:port}"

COPY docker/default.conf.template /etc/nginx/templates/

COPY dist/$PROJECT_NAME /usr/share/nginx/html/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Please refer to the public [documentation](https://alfresco-content-app.netlify.
Create an `.env` file in the project root folder with the following content

```yml
APP_CONFIG_ECM_HOST="<URL>"
BASE_URL="<URL>"
```

Where `<URL>` is the address of the ACS.
Expand Down
6 changes: 3 additions & 3 deletions app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"app/src/assets",
"app/src/favicon-96x96.png",
{
"input": "app/.tmp",
"output": "/",
"glob": "app.config.json"
"glob": "app.config.json",
"input": "app/src",
"output": "/"
},
{
"glob": "**/*",
Expand Down
6 changes: 3 additions & 3 deletions app/proxy.conf.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require('@alfresco/adf-cli/tooling').dotenvConfig({ path: process.env.ENV_FILE });

const APP_CONFIG_ECM_HOST = process.env.APP_CONFIG_ECM_HOST;
const { BASE_URL } = process.env;

module.exports = {
"/alfresco": {
"target": APP_CONFIG_ECM_HOST,
"target": BASE_URL,
"secure": false,
"pathRewrite": {
"^/alfresco/alfresco": ""
Expand All @@ -13,7 +13,7 @@ module.exports = {
'logLevel': 'debug',
onProxyReq: function(request) {
if(request["method"] !== "GET")
request.setHeader("origin", APP_CONFIG_ECM_HOST);
request.setHeader("origin", BASE_URL);
},
// workaround for REPO-2260
onProxyRes: function (proxyRes) {
Expand Down
6 changes: 3 additions & 3 deletions app/src/app.config.json.tpl → app/src/app.config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "../node_modules/@alfresco/adf-core/app.config.schema.json",
"ecmHost": "${APP_CONFIG_ECM_HOST}",
"aosHost": "${APP_CONFIG_ECM_HOST}/alfresco/aos",
"baseShareUrl": "${APP_CONFIG_ECM_HOST}/#/preview/s",
"ecmHost": "{protocol}//{hostname}{:port}",
"aosHost": "{protocol}//{hostname}{:port}/alfresco/aos",
"baseShareUrl": "{protocol}//{hostname}{:port}/#/preview/s",
"providers": "ECM",
"authType": "BASIC",
"loginRoute": "login",
Expand Down
4 changes: 0 additions & 4 deletions docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
set -e

eval ALL_ARGUMENTS=("BASE_PATH"
"APP_BASE_SHARE_URL"
"APP_CONFIG_IDENTITY_HOST"
"APP_CONFIG_BPM_HOST"
"APP_CONFIG_ECM_HOST"
)
ALL_ARGUMENTS_LENGTH=${#ALL_ARGUMENTS[@]}
DOCKER_ARGS=""
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/building-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You need to set some environment variables to be able to run the local dev serve

```yml
# App config settings
APP_CONFIG_ECM_HOST="<URL>"
BASE_URL="<URL>"
```

## Proxy settings
Expand Down
174 changes: 0 additions & 174 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7ab4cc5

Please sign in to comment.