File tree Expand file tree Collapse file tree 10 files changed +54
-72
lines changed Expand file tree Collapse file tree 10 files changed +54
-72
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,14 @@ jobs:
3535 STACK_EXCHANGE_ACCESS_TOKEN : ${{ secrets.stack_exchange_access_token }}
3636 AZURE_APP_CONFIGURATION_CONNECTION_STRING : ${{ secrets.azure_app_configuration_connection_string }}
3737 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
4040
4141 - name : ' run: npm install and build'
4242 run : |
43+ set -a
44+ source .env
45+ set +a
4346 npm install
4447 npm run build --prod --if-present
4548 cp scripts/default-static-site.js ${BUILD_PATH}
Original file line number Diff line number Diff line change @@ -48,11 +48,16 @@ jobs:
4848 STACK_EXCHANGE_ACCESS_TOKEN : ${{ secrets.STACK_EXCHANGE_ACCESS_TOKEN }}
4949 AZURE_APP_CONFIGURATION_CONNECTION_STRING : ${{ secrets.AZURE_APP_CONFIGURATION_CONNECTION_STRING }}
5050 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
5353
5454 - 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
5661
5762 - name : Generate coverage report
5863 env :
Original file line number Diff line number Diff line change @@ -10,10 +10,15 @@ RUN chmod -R 777 ${HOME}/time-tracker-ui
1010
1111USER ${USERNAME}
1212RUN 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+
1318
1419FROM development as build
1520COPY .env .
16- RUN npm run config && npm run build
21+ RUN npm run build
1722
1823FROM nginx:1.21 AS production
1924
Original file line number Diff line number Diff line change 22 "name" : " time-tracker" ,
33 "version" : " 1.72.9" ,
44 "scripts" : {
5- "config" : " ts-node ./scripts/setenv.ts" ,
65 "preinstall" : " npx npm-force-resolutions" ,
76 "ng" : " ng" ,
87 "start" : " ng serve" ,
Original file line number Diff line number Diff line change 11#! /bin/bash
22
33> .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
1010cat .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' ;
21
32export const environment = {
43 production : true ,
54 timeTrackerApiUrl : 'https://timetracker-api.azurewebsites.net' ,
65 stackexchangeApiUrl : 'https://api.stackexchange.com' ,
76} ;
87
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 ( "," ) ;
1211export 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" ] ;
1615export const DATE_FORMAT = 'yyyy-MM-dd' ;
1716export const DATE_FORMAT_YEAR = 'YYYY-MM-DD' ;
1817export const GROUPS = {
Original file line number Diff line number Diff line change 11// This file can be replaced during build by using the `fileReplacements` array.
22// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
33// The list of file replacements can be found in `angular.json`.
4- import * as keys from './keys' ;
54
65export const environment = {
76 production : false ,
87 timeTrackerApiUrl : 'http://localhost:7071/api' ,
98 stackexchangeApiUrl : 'https://api.stackexchange.com' ,
109} ;
1110
12- export const AUTHORITY = keys . AUTHORITY ;
13- export const CLIENT_ID = keys . CLIENT_ID ;
14- export const SCOPES = keys . SCOPES ;
11+ export const AUTHORITY = process . env [ " AUTHORITY" ] ;
12+ export const CLIENT_ID = process . env [ " CLIENT_ID" ] ;
13+ export const SCOPES = process . env [ " SCOPES" ] . split ( "," ) ;
1514export const ITEMS_PER_PAGE = 5 ;
16- export const STACK_EXCHANGE_ID = keys . STACK_EXCHANGE_ID ;
17- export const STACK_EXCHANGE_ACCESS_TOKEN = keys . STACK_EXCHANGE_ACCESS_TOKEN ;
18- export const AZURE_APP_CONFIGURATION_CONNECTION_STRING = keys . AZURE_APP_CONFIGURATION_CONNECTION_STRING ;
15+ export const STACK_EXCHANGE_ID = process . env [ " STACK_EXCHANGE_ID" ] ;
16+ export const STACK_EXCHANGE_ACCESS_TOKEN = process . env [ " STACK_EXCHANGE_ACCESS_TOKEN" ] ;
17+ export const AZURE_APP_CONFIGURATION_CONNECTION_STRING = process . env [ " AZURE_APP_CONFIGURATION_CONNECTION_STRING" ] ;
1918export const DATE_FORMAT = 'yyyy-MM-dd' ;
2019export const DATE_FORMAT_YEAR = 'YYYY-MM-DD' ;
2120export const GROUPS = {
Original file line number Diff line number Diff line change 1+ const webpack = require ( 'webpack' )
12const { addTailwindPlugin } = require ( "@ngneat/tailwind" ) ;
23const tailwindConfig = require ( "./tailwind.config.js" ) ;
34
45module . exports = ( config ) => {
6+ const config_ = {
7+ ...config ,
8+ plugins : [
9+ ...config . plugins ,
10+ new webpack . DefinePlugin ( {
11+ 'process.env.AUTHORITY' : JSON . stringify ( process . env [ "AUTHORITY" ] ) ,
12+ 'process.env.CLIENT_ID' :JSON . stringify ( process . env [ "CLIENT_ID" ] ) ,
13+ 'process.env.SCOPES' :JSON . stringify ( process . env [ "SCOPES" ] ) ,
14+ 'process.env.STACK_EXCHANGE_ID' :JSON . stringify ( process . env [ "STACK_EXCHANGE_ID" ] ) ,
15+ 'process.env.STACK_EXCHANGE_ACCESS_TOKEN' :JSON . stringify ( process . env [ "STACK_EXCHANGE_ACCESS_TOKEN" ] ) ,
16+ 'process.env.AZURE_APP_CONFIGURATION_CONNECTION_STRING' :JSON . stringify ( process . env [ "AZURE_APP_CONFIGURATION_CONNECTION_STRING" ] )
17+ } )
18+ ]
19+ }
520 addTailwindPlugin ( {
6- webpackConfig : config ,
21+ webpackConfig : config_ ,
722 tailwindConfig,
823 patchComponentsStyles : true
924 } ) ;
10- return config ;
25+ return config_ ;
1126} ;
You can’t perform that action at this time.
0 commit comments