Skip to content

Commit dd95c92

Browse files
committed
ci: Rename environment variables in CI/CD
- Rename environment variables to use the `CSHR_` prefix for better organization and clarity. This improves maintainability and avoids naming conflicts. - Update `.gitignore` to include the new environment file path. - Update client-side environment variables to use the `CSHR_` prefix, ensuring consistency across the application. - Update the client-side config file to match the new environment variable names.
1 parent dde67d3 commit dd95c92

38 files changed

+1139
-329
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ jobs:
2222
- name: Create env file
2323
run: |
2424
touch .env
25-
echo DJANGO_SECRET_KEY=${{ secrets.DJANGO_SECRET_KEY }} >> .env
26-
echo DJANGO_DEBUG=${{ secrets.DJANGO_DEBUG }} >> .env
27-
echo EMAIL=${{ secrets.EMAIL }} >> .env
28-
echo EMAIL_PASSWORD=${{ secrets.EMAIL_PASSWORD }} >> .env
29-
echo EMAIL_HOST=${{ secrets.EMAIL_HOST }} >> .env
30-
echo REDIS_HOST=${{ secrets.REDIS_HOST}} >> .env
31-
echo SERVER_DOMAIN_NAME=${{ secrets.SERVER_DOMAIN_NAME }} >> .env
32-
echo CLIENT_DOMAIN_NAME=${{ secrets.CLIENT_DOMAIN_NAME }} >> .env
25+
echo CSHR_DJANGO_SECRET_KEY=${{ secrets.CSHR_DJANGO_SECRET_KEY }} >> .env
26+
echo CSHR_DJANGO_DEBUG=${{ secrets.CSHR_DJANGO_DEBUG }} >> .env
27+
echo CSHR_EMAIL=${{ secrets.CSHR_EMAIL }} >> .env
28+
echo CSHR_EMAIL_PASSWORD=${{ secrets.CSHR_EMAIL_PASSWORD }} >> .env
29+
echo CSHR_EMAIL_HOST=${{ secrets.CSHR_EMAIL_HOST }} >> .env
30+
echo CSHR_REDIS_HOST=${{ secrets.CSHR_REDIS_HOST}} >> .env
31+
echo CSHR_SERVER_DOMAIN_NAME=${{ secrets.CSHR_SERVER_DOMAIN_NAME }} >> .env
32+
echo CSHR_CLIENT_DOMAIN_NAME=${{ secrets.CSHR_CLIENT_DOMAIN_NAME }} >> .env
3333
cat .env
3434
- name: Set up Python ${{ matrix.python-version }}
3535
uses: actions/setup-python@v3

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ celerybeat.pid
118118
.venv
119119
env/
120120
venv/
121-
ENV/
121+
CSHR_ENV/
122122
env.bak/
123123
venv.bak/
124124

client/env.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ interface ImportMetaEnv {
55
VITE_TITLE: string
66
VITE_FAVICON: string
77
VITE_LOGO: string
8-
SERVER_DOMAIN_NAME_API: string
9-
SERVER_DOMAIN_NAME_WS: string
8+
CSHR_SERVER_DOMAIN_NAME_API: string
9+
CSHR_SERVER_DOMAIN_NAME_WS: string
1010
}

client/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,6 @@
5757
"vite-plugin-vuetify": "^2.0.1",
5858
"vitest": "^1.0.4",
5959
"vue-tsc": "^1.8.25"
60-
}
60+
},
61+
"packageManager": "[email protected]+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977"
6162
}

client/public/config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
window.env = {
2-
// SERVER_DOMAIN_NAME_API: 'https://cshrserver.gent01.qa.grid.tf/api', // Added for testing, this is a staging API
3-
// SERVER_DOMAIN_NAME_WS: 'wss://cshrserver.gent01.qa.grid.tf/ws/notification', // Added for testing, this is a staging API
4-
SERVER_DOMAIN_NAME_API: 'http://127.0.0.1:8000/api', // Added for testing, this is the local server API
5-
SERVER_DOMAIN_NAME_WS: 'ws://127.0.0.1:8000/ws/notification', // Added for testing, this is the local server API
2+
// CSHR_SERVER_DOMAIN_NAME_API: 'https://cshrserver.gent01.qa.grid.tf/api', // Added for testing, this is a staging API
3+
// CSHR_SERVER_DOMAIN_NAME_WS: 'wss://cshrserver.gent01.qa.grid.tf/ws/notification', // Added for testing, this is a staging API
4+
CSHR_SERVER_DOMAIN_NAME_API: 'http://127.0.0.1:8000/api', // Added for testing, this is the local server API
5+
CSHR_SERVER_DOMAIN_NAME_WS: 'ws://127.0.0.1:8000/ws/notification', // Added for testing, this is the local server API
66
};

client/src/clients/api/vacations.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ export class VacationsApi extends ApiClientBase {
9595
})
9696
}
9797

98+
async delete(id: number) {
99+
ApiClientBase.assertUser()
100+
return this.unwrap(() => this.$http.delete<any>(this.getUrl(`/${id}`)), {
101+
transform: (d) => d.results
102+
})
103+
}
104+
98105
async requestToCancel(id: number) {
99106
return this.unwrap(() => this.$http.put<any>(this.getUrl(`/request-to-cancel/${id}`)), {
100107
transform: (d) => d.results

client/src/clients/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import axios from 'axios'
22

33
import { ApiClient } from './api'
44

5-
console.log(`API connected on: ${window.env.SERVER_DOMAIN_NAME_API}`);
6-
console.log(`WS connected on: ${window.env.SERVER_DOMAIN_NAME_WS}`);
5+
console.log(`API connected on: ${window.env.CSHR_SERVER_DOMAIN_NAME_API}`);
6+
console.log(`WS connected on: ${window.env.CSHR_SERVER_DOMAIN_NAME_WS}`);
77

88
const accessToken = localStorage.getItem("access_token")
99
export const $api = new ApiClient({
1010
$http: axios.create({
11-
baseURL: window.env.SERVER_DOMAIN_NAME_API,
11+
baseURL: window.env.CSHR_SERVER_DOMAIN_NAME_API,
1212
headers: {
1313
Authorization: `Bearer ${accessToken}`,
1414
},

0 commit comments

Comments
 (0)