Skip to content

Commit 413d5a9

Browse files
committed
feat: fixing prod/stage env
1 parent 03213d1 commit 413d5a9

9 files changed

+29
-29
lines changed

.github/workflows/build-prod.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
name: Build Prod
2-
on: [push]
1+
name: Build prod
2+
on:
3+
push:
4+
branches:
5+
- prod-beta
6+
- prod-stable
37
jobs:
48
build:
59
runs-on: ubuntu-latest
@@ -22,4 +26,4 @@ jobs:
2226
id: restore-build-prod
2327
with:
2428
path: ${{ github.workspace }}/dist/*
25-
key: ${{ github.sha }}
29+
key: ${{ github.sha }}/prod

.github/workflows/build-staging.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
name: Build Staging
2-
on: [push]
1+
name: Build staging
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- stable
37
jobs:
48
build:
59
runs-on: ubuntu-latest
@@ -22,4 +26,4 @@ jobs:
2226
id: restore-build-staging
2327
with:
2428
path: ${{ github.workspace }}/dist/*
25-
key: ${{ github.sha }}
29+
key: ${{ github.sha }}/staging

.github/workflows/deploy-main.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Main
1+
name: Deploy ci-beta stage-beta qa-beta
22
on:
33
workflow_run:
44
workflows: ['Build Staging']
@@ -27,7 +27,7 @@ jobs:
2727
id: restore-build-staging
2828
with:
2929
path: ${{ github.workspace }}/dist/*
30-
key: ${{ github.sha }}
30+
key: ${{ github.sha }}/staging
3131
- name: Checkout RedHatInsights/acs-ui-build repo and push build files from acs-ui
3232
run: |
3333
bash ${{ github.workspace }}/.github/scripts/deploy.sh
@@ -45,7 +45,7 @@ jobs:
4545
id: restore-build-staging
4646
with:
4747
path: ${{ github.workspace }}/dist/*
48-
key: ${{ github.sha }}
48+
key: ${{ github.sha }}/staging
4949
- name: Checkout RedHatInsights/acs-ui-build repo and push build files from acs-ui
5050
run: |
5151
bash ${{ github.workspace }}/.github/scripts/deploy.sh
@@ -63,7 +63,7 @@ jobs:
6363
id: restore-build-staging
6464
with:
6565
path: ${{ github.workspace }}/dist/*
66-
key: ${{ github.sha }}
66+
key: ${{ github.sha }}/staging
6767
- name: Checkout RedHatInsights/acs-ui-build repo and push build files from acs-ui
6868
run: |
6969
bash ${{ github.workspace }}/.github/scripts/deploy.sh

.github/workflows/deploy-prod-beta.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Prod Beta
1+
name: Deploy prod-beta
22
on:
33
workflow_run:
44
workflows: ['Build Prod']
@@ -27,7 +27,7 @@ jobs:
2727
id: restore-build-prod
2828
with:
2929
path: ${{ github.workspace }}/dist/*
30-
key: ${{ github.sha }}
30+
key: ${{ github.sha }}/prod
3131
- name: Checkout RedHatInsights/acs-ui-build repo and push build files from acs-ui
3232
run: |
3333
bash ${{ github.workspace }}/.github/scripts/deploy.sh

.github/workflows/deploy-prod-stable.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Prod Stable
1+
name: Deploy prod-stable
22
on:
33
workflow_run:
44
workflows: ['Build Prod']
@@ -27,7 +27,7 @@ jobs:
2727
id: restore-build-prod
2828
with:
2929
path: ${{ github.workspace }}/dist/*
30-
key: ${{ github.sha }}
30+
key: ${{ github.sha }}/prod
3131
- name: Checkout RedHatInsights/acs-ui-build repo and push build files from acs-ui
3232
run: |
3333
bash ${{ github.workspace }}/.github/scripts/deploy.sh

.github/workflows/deploy-stable.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Stable
1+
name: Deploy ci-stable stage-stable qa-stable
22
on:
33
workflow_run:
44
workflows: ['Build Staging']
@@ -27,7 +27,7 @@ jobs:
2727
id: restore-build-staging
2828
with:
2929
path: ${{ github.workspace }}/dist/*
30-
key: ${{ github.sha }}
30+
key: ${{ github.sha }}/staging
3131
- name: Checkout RedHatInsights/acs-ui-build repo and push build files from acs-ui
3232
run: |
3333
bash ${{ github.workspace }}/.github/scripts/deploy.sh
@@ -45,7 +45,7 @@ jobs:
4545
id: restore-build-staging
4646
with:
4747
path: ${{ github.workspace }}/dist/*
48-
key: ${{ github.sha }}
48+
key: ${{ github.sha }}/staging
4949
- name: Checkout RedHatInsights/acs-ui-build repo and push build files from acs-ui
5050
run: |
5151
bash ${{ github.workspace }}/.github/scripts/deploy.sh
@@ -63,7 +63,7 @@ jobs:
6363
id: restore-build-staging
6464
with:
6565
path: ${{ github.workspace }}/dist/*
66-
key: ${{ github.sha }}
66+
key: ${{ github.sha }}/staging
6767
- name: Checkout RedHatInsights/acs-ui-build repo and push build files from acs-ui
6868
run: |
6969
bash ${{ github.workspace }}/.github/scripts/deploy.sh

config/dev.webpack.config.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@ const { resolve } = require('path');
22
const config = require('@redhat-cloud-services/frontend-components-config');
33
const commonPlugins = require('./plugins');
44

5-
function getEnv() {
6-
if (process.env.PROD) {
7-
return process.env.BETA ? 'prod-beta' : 'prod-stable';
8-
} else {
9-
return process.env.BETA ? 'stage-beta' : 'stage-stable';
10-
}
11-
}
12-
135
const { config: webpackConfig, plugins } = config({
146
rootFolder: resolve(__dirname, '../'),
157
debug: true,
@@ -18,7 +10,7 @@ const { config: webpackConfig, plugins } = config({
1810
appUrl: process.env.BETA
1911
? '/beta/application-services/acs'
2012
: '/application-services/acs',
21-
env: getEnv(),
13+
env: process.env.BETA ? 'stage-beta' : 'stage-stable',
2214
});
2315
plugins.push(...commonPlugins);
2416

config/plugins.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if (process.env.NODE_ENV === 'production') {
1717
// We want to access a PROD env variable within the UI code
1818
plugins.push(
1919
new webpack.DefinePlugin({
20-
'process.env.PROD': process.env.NODE_ENV === 'production',
20+
'process.env.PROD': process?.env?.NODE_ENV === 'production',
2121
})
2222
);
2323

src/services/apiRequest.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import axios from 'axios';
22

3-
const API_URL = process.env.PROD
3+
const API_URL = process?.env?.PROD
44
? 'https://api.openshift.com'
55
: 'https://api.stage.openshift.com';
66

0 commit comments

Comments
 (0)