Skip to content

Commit 3bcad1e

Browse files
committed
Wrapped up all the services - now to test.
1 parent 76dfc3a commit 3bcad1e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1445
-2218
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"workspaceFolder": "/workspace/${localWorkspaceFolderBasename}",
88
"features": {
9-
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
9+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
1010
},
1111
"runArgs": [
1212
"--privileged"
@@ -40,7 +40,9 @@
4040
8080,
4141
5432,
4242
5672,
43-
15672
43+
15672,
44+
80,
45+
9090
4446
],
4547
"remoteUser": "vscode",
4648
"containerUser": "vscode",

.github/github-actions.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Create k8s Kind Cluster
15+
uses: helm/[email protected]
16+
17+
- name: Test with Kind
18+
run: |
19+
chmod +x ./scripts/test-local.sh
20+
./scripts/test-local.sh
21+
build-and-scan:
22+
needs: test
23+
runs-on: ubuntu-latest
24+
steps:
25+
# Step 1: Checkout the code
26+
- name: Checkout Code
27+
uses: actions/checkout@v3
28+
29+
# Step 2: Log in to Docker Hub
30+
- name: Log in to Docker Hub
31+
uses: docker/login-action@v2
32+
with:
33+
username: ${{ secrets.DOCKER_USERNAME }}
34+
password: ${{ secrets.DOCKER_PASSWORD }}
35+
36+
# Step 3: Build Docker images
37+
- name: Build Docker Images
38+
run: |
39+
for service in order catalog search frontend; do
40+
docker build -t egitangu/$service-service:latest -f app/$service/Dockerfile app/$service
41+
done
42+
43+
# Step 4: Push Docker images
44+
- name: Push Docker Images
45+
run: |
46+
for service in order catalog search frontend; do
47+
docker push egitangu/$service-service:latest
48+
done
49+
50+
# Step 5: Scan images with Trivy
51+
- name: Vulnerability Scan
52+
uses: aquasecurity/trivy-action@master
53+
with:
54+
image-ref: egitangu/order-service:latest
55+
56+
deploy:
57+
needs: build-and-scan
58+
runs-on: ubuntu-latest
59+
steps:
60+
# Step 1: Checkout Code
61+
- name: Checkout Code
62+
uses: actions/checkout@v3
63+
64+
# Step 2: Install Helm
65+
- name: Install Helm
66+
run: curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
67+
68+
# Step 3: Deploy Third Party Services with Helm
69+
- name: Deploy Third Party Services with Helm
70+
run: chmod +x ./scripts/deploy-helm.sh && ./scripts/deploy-helm.sh
71+
72+
# Step 4: Deploy Services with kubectl
73+
- name: Deploy Services with kubectl
74+
run: chmod +x ./scripts/deploy-kubectl.sh && ./scripts/deploy-kubectl.sh

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Logs
22
logs
3+
logs_and_metrics/*
4+
!logs_and_metrics/.gitkeep
35
*.log
46
npm-debug.log*
57
yarn-debug.log*
@@ -129,3 +131,12 @@ dist
129131
.yarn/build-state.yml
130132
.yarn/install-state.gz
131133
.pnp.*
134+
135+
#python
136+
__pycache__/
137+
venv/
138+
.pytest_cache/
139+
140+
141+
#flask
142+
.flaskenv

0 commit comments

Comments
 (0)