Skip to content

Commit 1f3e079

Browse files
authored
Merge pull request #2761 from ORCID/lmendoza/PD-0000
PD-5108
2 parents 626197b + bea63c3 commit 1f3e079

7 files changed

Lines changed: 42 additions & 65 deletions

File tree

.github/workflows/bld_mvn.yml

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ permissions:
99
on:
1010
workflow_call:
1111
inputs:
12-
artifact_name:
13-
description: 'Name of the artifact env'
14-
required: false
15-
default: 'prod'
16-
type: string
1712
version_tag:
1813
description: 'Name of the tag to build'
1914
required: false
@@ -32,11 +27,6 @@ on:
3227

3328
workflow_dispatch:
3429
inputs:
35-
artifact_name:
36-
description: 'Name of the artifact env'
37-
required: false
38-
default: 'prod'
39-
type: string
4030
version_tag:
4131
description: 'Version tag to use: (bump must also be set to none to keep a specific version'
4232
required: false
@@ -61,14 +51,6 @@ on:
6151

6252
jobs:
6353
bld_mvn:
64-
strategy:
65-
matrix:
66-
include:
67-
- artifact_name: prod
68-
- artifact_name: sandbox
69-
- artifact_name: qa
70-
- artifact_name: int
71-
7254
runs-on: ubuntu-latest
7355
steps:
7456
- name: git-checkout-ref-action
@@ -110,7 +92,7 @@ jobs:
11092
shell: bash
11193
env:
11294
version_tag_numeric: '${{ steps.version.outputs.version_tag_numeric }}'
113-
project: '${{ matrix.artifact_name }}'
95+
project: prod
11496

11597
- name: bump version using prod profile
11698
run: |
@@ -128,24 +110,38 @@ jobs:
128110
git diff
129111
git rev-parse --abbrev-ref HEAD
130112
131-
- name: build our project and deploy
113+
- name: build our project
132114
run: |
133115
mvn -T 1C --batch-mode \
134116
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
135-
--settings settings-deploy.xml \
136117
--file "pom.xml" \
137-
-DaltReleaseDeploymentRepository="github::${ARTIFACT_URL}${ARTIFACT_REPO_PATH}" \
138-
--activate-profiles "${build_env}" -Dnodejs.workingDirectory=. \
139-
deploy -Dmaven.test.skip
118+
--activate-profiles prod -Dnodejs.workingDirectory=. \
119+
package -Dmaven.test.skip
140120
141121
echo "------------------------------------------------------"
142-
143122
find . -name '*.war'
144123
find . -name '*.jar'
145124
env:
146125
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
147-
ARTIFACT_URL: '${{ secrets.ARTIFACT_URL }}'
148-
ARTIFACT_REPO_PATH: '${{ secrets.ARTIFACT_REPO_PATH }}'
149-
ARTIFACT_USER: '${{ secrets.ARTIFACT_USER }}'
150-
ARTIFACT_PASSWORD: '${{ secrets.ARTIFACT_PASSWORD }}'
151-
build_env: '${{ matrix.artifact_name }}'
126+
127+
- name: deploy same artifact for all environments
128+
run: |
129+
WAR_FILE="target/orcid-web-frontend-prod.war"
130+
REPO_URL="${ARTIFACT_URL}${ARTIFACT_REPO_PATH}"
131+
for artifact_id in orcid-web-frontend-prod orcid-web-frontend-sandbox orcid-web-frontend-qa orcid-web-frontend-int; do
132+
mvn -B deploy:deploy-file \
133+
--settings settings-deploy.xml \
134+
-Durl="${REPO_URL}" \
135+
-DrepositoryId=github \
136+
-DgroupId=org.orcid \
137+
-DartifactId="${artifact_id}" \
138+
-Dversion="${{ steps.version.outputs.version_tag_numeric }}" \
139+
-Dpackaging=war \
140+
-Dfile="${WAR_FILE}" \
141+
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
142+
done
143+
env:
144+
ARTIFACT_URL: ${{ secrets.ARTIFACT_URL }}
145+
ARTIFACT_REPO_PATH: ${{ secrets.ARTIFACT_REPO_PATH }}
146+
ARTIFACT_USER: ${{ secrets.ARTIFACT_USER }}
147+
ARTIFACT_PASSWORD: ${{ secrets.ARTIFACT_PASSWORD }}

.github/workflows/bld_test_rel_tag.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ on:
2323
type: boolean
2424
required: false
2525
default: true
26+
run_docker:
27+
description: 'Whether to run Docker builds'
28+
type: boolean
29+
required: false
30+
default: false
2631

2732
workflow_dispatch:
2833
inputs:
@@ -52,6 +57,11 @@ on:
5257
type: boolean
5358
required: false
5459
default: true
60+
run_docker:
61+
description: 'Whether to run Docker builds'
62+
type: boolean
63+
required: false
64+
default: false
5565

5666
# cancel running job if another commit comes in
5767
concurrency:
@@ -101,6 +111,7 @@ jobs:
101111
ref: ${{ inputs.ref }}
102112

103113
bld_docker:
114+
if: ${{ inputs.run_docker }}
104115
uses: ./.github/workflows/bld_docker.yml
105116
secrets: inherit # pass all secrets for uploading assets
106117
needs:

.github/workflows/bld_yarn.yml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,10 @@ permissions:
77

88
on:
99
workflow_call:
10-
inputs:
11-
artifact_name:
12-
description: 'Name of the artifact env'
13-
required: false
14-
default: 'prod'
15-
type: string
16-
1710
workflow_dispatch:
18-
inputs:
19-
artifact_name:
20-
description: 'Name of the artifact env'
21-
required: false
22-
default: 'prod'
23-
type: string
2411

2512
jobs:
2613
bld_yarn:
27-
strategy:
28-
matrix:
29-
include:
30-
- artifact_name: prod
31-
# yarn build is only used as a test
32-
# - artifact_name: sandbox
33-
# - artifact_name: qa
34-
# - artifact_name: int
3514
runs-on: ubuntu-latest
3615
timeout-minutes: 15
3716
steps:
@@ -41,4 +20,4 @@ jobs:
4120
node-version: 'v20.x'
4221
cache: 'yarn'
4322
- run: yarn
44-
- run: yarn build:${{ inputs.artifact_name }}
23+
- run: yarn build

Dockerfile.build.yarn

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
FROM node:22.12.0-bullseye AS build
22

3-
ARG build_env
4-
53
WORKDIR /app
64

75
COPY package.json .
@@ -16,7 +14,7 @@ COPY scripts/ scripts/
1614

1715
# RUN apk add gettext
1816

19-
RUN yarn build:${build_env}
17+
RUN yarn build
2018

2119
FROM nginx:1.26.2-alpine
2220
#FROM nginx:1.26.2-bookworm

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,9 @@ The following tools are not required to work on the project but they facilitate
8484

8585
## Build the application for other environments
8686

87-
The following commands are used to build the application for non-local environments
87+
Build the application for deployment (prod, sandbox, qa, int all use the same asset; environment is resolved at runtime):
8888

89-
- `yarn build:prod`
90-
- `yarn build:sandbox`
91-
- `yarn build:qa`
92-
- `yarn build:int`
89+
- `yarn build`
9390

9491
## Learn more
9592

package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
"build:i18n:generate": "echo '⚠️ DEPRECATED: Generating XLF from .properties files. Use Transifex for translations instead.' && ts-node -P scripts/tsconfig.json scripts/translate-file-generator.prebuild.ts",
2626
"build:i18n": "yarn build:i18n:extract",
2727
"build-with-properties": "echo '⚠️ DEPRECATED: This build regenerates XLF files from .properties (deprecated workflow). Prefer using tx pull to get translations from Transifex.' && rimraf dist && yarn build:i18n:extract && yarn build:i18n:generate && yarn build:browserslist && npm run build-runtime-env && ng build --configuration production --localize && npm run postbuild",
28-
"build:prod": "yarn build",
29-
"build:sandbox": "yarn build",
30-
"build:qa": "yarn build",
31-
"build:int": "yarn build",
3228
"build:local": "yarn run prebuild && ng build --localize",
3329
"format": "npm run lint && prettier --write .",
3430
"build:report": "webpack-bundle-analyzer dist/en/stats.json",

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
<phase>generate-resources</phase>
8888
<configuration>
8989
<yarnInheritsProxyConfigFromMaven>false</yarnInheritsProxyConfigFromMaven>
90-
<arguments>build:${buildEnv}</arguments>
90+
<arguments>build</arguments>
9191
</configuration>
9292
</execution>
9393
</executions>

0 commit comments

Comments
 (0)