diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb17a43575..0b5b3f9d8c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,6 +80,19 @@ jobs: docker-compose -f ./docker/cli.yml -f ./docker/cli.assetstore.yml run --rm dspace-cli docker container ls + # Wait until the REST API returns a 200 response (or for a max of 30 seconds) + # https://github.com/nev7n/wait_for_response + - name: Wait for DSpace REST Backend to be ready (for e2e tests) + uses: nev7n/wait_for_response@v1 + with: + # We use the 'sites' endpoint to also ensure the database is ready + url: 'http://localhost:8080/server/api/core/sites' + responseCode: 200 + timeout: 30000 + + - name: Get DSpace REST Backend info/properties + run: curl http://localhost:8080/server/api + - name: Run e2e tests (integration tests) run: yarn run e2e:ci diff --git a/scripts/set-env.ts b/scripts/set-env.ts index 5eee22a4be..b3516ae68f 100644 --- a/scripts/set-env.ts +++ b/scripts/set-env.ts @@ -10,7 +10,7 @@ const targetPath = './src/environments/environment.ts'; const colors = require('colors'); require('dotenv').config(); const merge = require('deepmerge'); - +const mergeOptions = { arrayMerge: (destinationArray, sourceArray, options) => sourceArray }; const environment = process.argv[2]; let environmentFilePath; let production = false; @@ -45,10 +45,10 @@ const processEnv = { } as GlobalConfig; import(environmentFilePath) - .then((file) => generateEnvironmentFile(merge.all([commonEnv, file.environment, processEnv]))) + .then((file) => generateEnvironmentFile(merge.all([commonEnv, file.environment, processEnv], mergeOptions))) .catch(() => { console.log(colors.yellow.bold(`No specific environment file found for ` + environment)); - generateEnvironmentFile(merge(commonEnv, processEnv)) + generateEnvironmentFile(merge(commonEnv, processEnv, mergeOptions)) }); function generateEnvironmentFile(file: GlobalConfig): void { @@ -65,7 +65,7 @@ function generateEnvironmentFile(file: GlobalConfig): void { } // allow to override a few important options by environment variables -function createServerConfig(host?: string, port?: string, nameSpace?: string, ssl?: string): ServerConfig { +function createServerConfig(host?: string, port?: string, nameSpace?: string, ssl?: string): ServerConfig { const result = {} as any; if (hasValue(host)) { result.host = host;