Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/CI-time-tracker-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ jobs:
STACK_EXCHANGE_ACCESS_TOKEN: ${{ secrets.STACK_EXCHANGE_ACCESS_TOKEN }}
AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${{ secrets.AZURE_APP_CONFIGURATION_CONNECTION_STRING }}
run: |
chmod +x ./scripts/populate-keys.sh
sh ./scripts/populate-keys.sh
chmod +x ./scripts/populate-var-file.sh
sh ./scripts/populate-var-file.sh

- name: Running tests
run: npm run ci-test --if-present
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cleanup: ## Delete image timetracker_ui

.PHONY: run
run: ## Execute timetracker_ui docker containe.
docker-compose --env-file ./.env up -d
docker-compose up -d

.PHONY: logs
logs: ## Show logs of timetracker_ui.
Expand All @@ -40,12 +40,12 @@ remove: ## Delete container timetracker_ui.

.PHONY: test
test: ## Run all tests on docker container timetracker_ui at the CLI.
docker-compose -f docker-compose.yml --env-file ./.env up -d
docker-compose -f docker-compose.yml up -d
docker exec timetracker_ui bash -c "npm run ci-test"

.PHONY: testdev
testdev: ## Run all tests on docker container timetracker_ui at the Dev
docker-compose -f docker-compose.yml -f docker-compose.dev.yml --env-file ./.env up -d
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
docker exec timetracker_ui bash -c "npm run ci-test"

.PHONY: publish
Expand Down
10 changes: 10 additions & 0 deletions scripts/populate-var-file.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

> src/environments/keys.ts
echo 'export const AUTHORITY = "'$AUTHORITY'";' >> src/environments/keys.ts
echo 'export const CLIENT_ID = "'$CLIENT_ID'";' >> src/environments/keys.ts
echo 'export const SCOPES = ["'$SCOPES'"];' >> src/environments/keys.ts
echo 'export const STACK_EXCHANGE_ID = "'$STACK_EXCHANGE_ID'";' >> src/environments/keys.ts
echo 'export const STACK_EXCHANGE_ACCESS_TOKEN = "'$STACK_EXCHANGE_ACCESS_TOKEN'";' >> src/environments/keys.ts
echo 'export const AZURE_APP_CONFIGURATION_CONNECTION_STRING = "'$AZURE_APP_CONFIGURATION_CONNECTION_STRING'";' >> src/environments/keys.ts
cat src/environments/keys.ts
17 changes: 8 additions & 9 deletions scripts/setenv.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const { writeFile } = require('fs');
require('dotenv').config();

const pathJs = `./src/environments/keys.ts`
const contentKeys =
`export const AUTHORITY = '${process.env.AUTHORITY}';
export const CLIENT_ID = '${process.env.CLIENT_ID}';
export const SCOPES = ['${process.env.SCOPES}'];
export const STACK_EXCHANGE_ID = '${process.env.STACK_EXCHANGE_ID}';
export const STACK_EXCHANGE_ACCESS_TOKEN = '${process.env.STACK_EXCHANGE_ACCESS_TOKEN}';
export const AZURE_APP_CONFIGURATION_CONNECTION_STRING = '${process.env.AZURE_APP_CONFIGURATION_CONNECTION_STRING}';
const contentKeys =
`export const AUTHORITY = '${process.env["AUTHORITY"]}';
export const CLIENT_ID = '${process.env["CLIENT_ID"]}';
export const SCOPES = ['${process.env["SCOPES"]}'];
export const STACK_EXCHANGE_ID = '${process.env["STACK_EXCHANGE_ID"]}';
export const STACK_EXCHANGE_ACCESS_TOKEN = '${process.env["STACK_EXCHANGE_ACCESS_TOKEN"]}';
export const AZURE_APP_CONFIGURATION_CONNECTION_STRING = '${process.env["AZURE_APP_CONFIGURATION_CONNECTION_STRING"]}';
`;

writeFile(pathJs, contentKeys, function (err) {
Expand All @@ -19,7 +18,7 @@ writeFile(pathJs, contentKeys, function (err) {
});

const pathJson = `./src/environments/.keys.json`
const contentKeysJson =
const contentKeysJson =
`{
"authority": "${process.env.AUTHORITY_JSON}",
"client_id": "${process.env.CLIENT_ID_JSON}",
Expand Down