-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #843 from datacite/add-env-var
Add HANDLE_SERVER env variable.
- Loading branch information
Showing
8 changed files
with
49 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,9 +21,10 @@ jobs: | |
uses: ./.github/workflows/cypress_test.yml | ||
secrets: inherit | ||
|
||
deploy: | ||
deploy-to-production: | ||
needs: [call_build, ember_test, cypress_test] | ||
runs-on: ubuntu-latest | ||
environment: vercel-bracco-production | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
steps: | ||
|
@@ -44,16 +45,34 @@ jobs: | |
vercel-token: ${{ secrets.VERCEL_TOKEN }} | ||
vercel-org-id: ${{ secrets.ORG_ID}} | ||
vercel-project-id: ${{ secrets.PROJECT_ID}} | ||
vercel-args: ${{ vars.VERCEL_NOCACHE == 'true' && '--prod --force' || '--prod' }} | ||
vercel-args: ${{ vars.VERCEL_NOCACHE == 'true' && '--prod --force' || '--prod' }} --build-env HANDLE_SERVER=${{vars.HANDLE_SERVER}} | ||
scope: ${{ secrets.TEAM_ID}} | ||
vercel-project-name: 'bracco' | ||
|
||
deploy-to-test: | ||
needs: [call_build, ember_test, cypress_test] | ||
runs-on: ubuntu-latest | ||
environment: vercel-bracco-test | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Extract variables | ||
shell: bash | ||
run: | | ||
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" >> $GITHUB_OUTPUT | ||
echo "GIT_SHA=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | ||
echo "GIT_SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
id: extract_variables | ||
|
||
- name: Vercel deploy test | ||
uses: amondnet/[email protected] | ||
with: | ||
vercel-token: ${{ secrets.VERCEL_TOKEN }} | ||
vercel-org-id: ${{ secrets.ORG_ID}} | ||
vercel-project-id: ${{ secrets.TEST_PROJECT_ID}} | ||
vercel-args: ${{ vars.VERCEL_NOCACHE == 'true' && '--prod --force' || '--prod' }} | ||
vercel-args: ${{ vars.VERCEL_NOCACHE == 'true' && '--prod --force' || '--prod' }} --build-env HANDLE_SERVER=${{vars.HANDLE_SERVER}} | ||
scope: ${{ secrets.TEAM_ID}} | ||
vercel-project-name: 'bracco-test' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
/* eslint-env node */ | ||
'use strict'; | ||
|
||
function normalizeURL(val) { | ||
return val.trim().replace(/\/$/, ''); | ||
} | ||
|
||
module.exports = function (environment) { | ||
const pkg = require('../package.json'); | ||
|
||
|
@@ -74,7 +78,7 @@ module.exports = function (environment) { | |
'https://[email protected]/1420435', | ||
|
||
disablePerformance: true, | ||
environment: fabricaDeployTarget || "stage" | ||
environment: fabricaDeployTarget || 'stage' | ||
} | ||
}, | ||
'ember-cli-string-helpers': { | ||
|
@@ -148,14 +152,21 @@ module.exports = function (environment) { | |
// when it is created | ||
}, | ||
|
||
MIN_PREFIXES_AVAILABLE: minPrefixesAvailable, | ||
MIN_PREFIXES_AVAILABLE: minPrefixesAvailable, | ||
SHOW_N_PREFIXES: showNPrefixes, | ||
MAX_MINT_FUTURE_OFFSET: maxMintFutureOffset | ||
MAX_MINT_FUTURE_OFFSET: maxMintFutureOffset, | ||
HANDLE_SERVER: ((typeof process.env.HANDLE_SERVER === 'undefined') || (process.env.HANDLE_SERVER == "")) ? 'https://handle.stage.datacite.org' : normalizeURL(process.env.HANDLE_SERVER) | ||
}; | ||
|
||
if (fabricaDeployTarget === 'stage') { | ||
// add staging-specific settings here | ||
ENV.COOKIE_DOMAIN = '.stage.datacite.org'; | ||
ENV.HANDLE_SERVER = ((typeof process.env.HANDLE_SERVER === 'undefined') || (process.env.HANDLE_SERVER == "")) ? 'https://handle.stage.datacite.org' : normalizeURL(process.env.HANDLE_SERVER); | ||
} | ||
|
||
if (fabricaDeployTarget === 'test') { | ||
// add test-env-specific settings here | ||
ENV.HANDLE_SERVER = ((typeof process.env.HANDLE_SERVER === 'undefined') || (process.env.HANDLE_SERVER == "")) ? 'https://handle.test.datacite.org' : normalizeURL(process.env.HANDLE_SERVER); | ||
} | ||
|
||
if (fabricaDeployTarget === 'production') { | ||
|
@@ -169,6 +180,7 @@ module.exports = function (environment) { | |
ENV.CDN_URL = 'https://assets.datacite.org'; | ||
ENV.HOME_URL = 'https://datacite.org'; | ||
ENV.COOKIE_DOMAIN = '.datacite.org'; | ||
ENV.HANDLE_SERVER = ((typeof process.env.HANDLE_SERVER === 'undefined') || (process.env.HANDLE_SERVER == "")) ? 'https://doi.org' : normalizeURL(process.env.HANDLE_SERVER); | ||
} | ||
|
||
// Environment named 'test' here is the ember environment, not related to fabrica environments. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters