-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MS6 DevOps: Cloud Deployment using K8s (#115)
* Push image up aws cloud * Attempt to bring up question service * Update Dockerfile for k8 * Setup local k8 deployment * Revert "Setup local k8 deployment" This reverts commit 95c6775. * Reapply "Setup local k8 deployment" This reverts commit a7fef30. * Update config * Remove non essential yml * Deployed to GKE * Initialise CI workflow (#117) * Initialise ci (#118) * Initialise CI workflow * Add CI for both repos * Fix ci (#119) * Initialise CI workflow * Fix CI pipeline * Add ci (#120) * Initialise CI workflow * Amend CI workflow * Fix linting and add backend CI workflow * Reconfigure for local dev * Update deployment options --------- Co-authored-by: Jajabonks <84561814+Jajared@users.noreply.github.com>
- Loading branch information
Showing
84 changed files
with
906 additions
and
577 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Backend CI Workflow | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install Dependencies for Each Service | ||
run: | | ||
cd backend | ||
for service in auth-service question-service user-service matching-service gateway-service collaboration-service; do | ||
echo "Installing dependencies for $service" | ||
cd $service | ||
npm install | ||
cd .. | ||
done | ||
# Build Check for Each Service | ||
- name: Build Each Service | ||
run: | | ||
cd backend | ||
for service in auth-service question-service user-service matching-service gateway-service collaboration-service; do | ||
echo "Building $service" | ||
cd $service | ||
npm run build | ||
cd .. | ||
done | ||
# Lint Check for Each Service | ||
- name: Lint Each Service | ||
run: | | ||
cd backend | ||
for service in auth-service question-service user-service matching-service gateway-service collaboration-service; do | ||
echo "Linting $service" | ||
cd $service | ||
npm run lint | ||
cd .. | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Frontend CI Workflow | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install Dependencies | ||
run: | | ||
cd frontend | ||
npm install | ||
# Build Check | ||
- name: Build Project | ||
run: | | ||
cd frontend | ||
npm run build | ||
# Lint Check | ||
- name: Lint Code | ||
run: | | ||
cd frontend | ||
npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,13 @@ | ||
################# | ||
## DEVELOPMENT ## | ||
################# | ||
FROM node:18-alpine AS development | ||
FROM node:18 | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy the package.json and package-lock.json files | ||
COPY package*.json ./ | ||
|
||
# Install dependencies | ||
RUN npm install | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Built the app to /dist folder | ||
RUN npm run build | ||
EXPOSE 3003 | ||
|
||
# Expose the port the app runs on | ||
EXPOSE 4000 | ||
|
||
################ | ||
## PRODUCTION ## | ||
################ | ||
FROM node:18-alpine AS production | ||
|
||
# Set node environment to production | ||
ARG NODE_ENV=production | ||
ENV NODE_ENV=${NODE_ENV} | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy only the necessary files from the previous build stage | ||
COPY --from=development /peerprep/app/dist ./dist | ||
COPY package*.json ./ | ||
|
||
# Install production dependencies only | ||
RUN npm ci --only=production | ||
|
||
# Expose the port the app runs on | ||
EXPOSE 4000 | ||
|
||
# Run the main file | ||
CMD ["node", "dist/main"] | ||
CMD ["node", "dist/main.js"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ export enum AccountProvider { | |
LOCAL = 'local', | ||
GOOGLE = 'google', | ||
GITHUB = 'github', | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.