File tree Expand file tree Collapse file tree 12 files changed +56
-74
lines changed Expand file tree Collapse file tree 12 files changed +56
-74
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,14 @@ jobs:
35
35
STACK_EXCHANGE_ACCESS_TOKEN : ${{ secrets.stack_exchange_access_token }}
36
36
AZURE_APP_CONFIGURATION_CONNECTION_STRING : ${{ secrets.azure_app_configuration_connection_string }}
37
37
run : |
38
- chmod +x ./scripts/populate-var-file .sh
39
- sh ./scripts/populate-var-file .sh
38
+ chmod +x ./scripts/populate-keys .sh
39
+ sh ./scripts/populate-keys .sh
40
40
41
41
- name : ' run: npm install and build'
42
42
run : |
43
+ set -a
44
+ source .env
45
+ set +a
43
46
npm install
44
47
npm run build --prod --if-present
45
48
cp scripts/default-static-site.js ${BUILD_PATH}
Original file line number Diff line number Diff line change @@ -48,11 +48,16 @@ jobs:
48
48
STACK_EXCHANGE_ACCESS_TOKEN : ${{ secrets.STACK_EXCHANGE_ACCESS_TOKEN }}
49
49
AZURE_APP_CONFIGURATION_CONNECTION_STRING : ${{ secrets.AZURE_APP_CONFIGURATION_CONNECTION_STRING }}
50
50
run : |
51
- chmod +x ./scripts/populate-var-file .sh
52
- sh ./scripts/populate-var-file .sh
51
+ chmod +x ./scripts/populate-keys .sh
52
+ sh ./scripts/populate-keys .sh
53
53
54
54
- name : Running tests
55
- run : npm run ci-test --if-present
55
+ run : |
56
+ set -a
57
+ source .env
58
+ set +a
59
+ npm run ci-test --if-present
60
+ rm .env
56
61
57
62
- name : Generate coverage report
58
63
env :
Original file line number Diff line number Diff line change @@ -12,4 +12,4 @@ RUN chown ${USERNAME}:${USERNAME} -R ${HOME}/time-tracker-ui \
12
12
USER ${USERNAME}
13
13
RUN npm cache clean --force && npm install
14
14
EXPOSE 4200
15
- CMD npm run config && ${HOME}/time-tracker-ui/node_modules/.bin/ng serve --host 0.0.0.0 --disableHostCheck
15
+ CMD ${HOME}/time-tracker-ui/node_modules/.bin/ng serve --host 0.0.0.0 --disableHostCheck
Original file line number Diff line number Diff line change @@ -44,4 +44,4 @@ COPY .env .
44
44
EXPOSE 4200
45
45
EXPOSE 9876
46
46
RUN npm cache clean --force && npm install
47
- CMD npm run config && npm run ci-test
47
+ CMD npm run ci-test
Original file line number Diff line number Diff line change @@ -10,10 +10,15 @@ RUN chmod -R 777 ${HOME}/time-tracker-ui
10
10
11
11
USER ${USERNAME}
12
12
RUN npm cache clean --force && npm install
13
+ EXPOSE 4200
14
+ EXPOSE 9876
15
+ CMD ${HOME}/time-tracker-ui/node_modules/.bin/ng serve --host 0.0.0.0 --disableHostCheck
16
+
17
+
13
18
14
19
FROM development as build
15
20
COPY .env .
16
- RUN npm run config && npm run build
21
+ RUN npm run build
17
22
18
23
FROM nginx:1.21 AS production
19
24
Original file line number Diff line number Diff line change 2
2
"name" : " time-tracker" ,
3
3
"version" : " 1.72.9" ,
4
4
"scripts" : {
5
- "config" : " ts-node ./scripts/setenv.ts" ,
6
5
"preinstall" : " npx npm-force-resolutions" ,
7
6
"ng" : " ng" ,
8
7
"start" : " ng serve" ,
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
> .env
4
- echo ' AUTHORITY = ' $AUTHORITY ' ' >> .env
5
- echo ' CLIENT_ID = ' $CLIENT_ID ' ' >> .env
6
- echo ' SCOPES = ' $SCOPES ' ' >> .env
7
- echo ' STACK_EXCHANGE_ID = ' $STACK_EXCHANGE_ID ' ' >> .env
8
- echo ' STACK_EXCHANGE_ACCESS_TOKEN = ' $STACK_EXCHANGE_ACCESS_TOKEN ' ' >> .env
9
- echo ' AZURE_APP_CONFIGURATION_CONNECTION_STRING = ' $AZURE_APP_CONFIGURATION_CONNECTION_STRING ' ' >> .env
4
+ echo " AUTHORITY= '$AUTHORITY '" >> .env
5
+ echo " CLIENT_ID= '$CLIENT_ID '" >> .env
6
+ echo " SCOPES= '$SCOPES '" >> .env
7
+ echo " STACK_EXCHANGE_ID= '$STACK_EXCHANGE_ID '" >> .env
8
+ echo " STACK_EXCHANGE_ACCESS_TOKEN= '$STACK_EXCHANGE_ACCESS_TOKEN '" >> .env
9
+ echo " AZURE_APP_CONFIGURATION_CONNECTION_STRING= '$AZURE_APP_CONFIGURATION_CONNECTION_STRING '" >> .env
10
10
cat .env
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- import * as keys from './keys' ;
2
1
3
2
export const environment = {
4
3
production : true ,
5
4
timeTrackerApiUrl : 'https://timetracker-api.azurewebsites.net' ,
6
5
stackexchangeApiUrl : 'https://api.stackexchange.com' ,
7
6
} ;
8
7
9
- export const AUTHORITY = keys . AUTHORITY ;
10
- export const CLIENT_ID = keys . CLIENT_ID ;
11
- export const SCOPES = keys . SCOPES ;
8
+ export const AUTHORITY = process . env [ " AUTHORITY" ] ;
9
+ export const CLIENT_ID = process . env [ " CLIENT_ID" ] ;
10
+ export const SCOPES = process . env [ " SCOPES" ] . split ( "," ) ;
12
11
export const ITEMS_PER_PAGE = 5 ;
13
- export const STACK_EXCHANGE_ID = keys . STACK_EXCHANGE_ID ;
14
- export const STACK_EXCHANGE_ACCESS_TOKEN = keys . STACK_EXCHANGE_ACCESS_TOKEN ;
15
- export const AZURE_APP_CONFIGURATION_CONNECTION_STRING = keys . AZURE_APP_CONFIGURATION_CONNECTION_STRING ;
12
+ export const STACK_EXCHANGE_ID = process . env [ " STACK_EXCHANGE_ID" ] ;
13
+ export const STACK_EXCHANGE_ACCESS_TOKEN = process . env [ " STACK_EXCHANGE_ACCESS_TOKEN" ] ;
14
+ export const AZURE_APP_CONFIGURATION_CONNECTION_STRING = process . env [ " AZURE_APP_CONFIGURATION_CONNECTION_STRING" ] ;
16
15
export const DATE_FORMAT = 'yyyy-MM-dd' ;
17
16
export const DATE_FORMAT_YEAR = 'YYYY-MM-DD' ;
18
17
export const GROUPS = {
You can’t perform that action at this time.
0 commit comments