-
Notifications
You must be signed in to change notification settings - Fork 1
Fix #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #14
Changes from all commits
0f3d3fa
21eb4c6
e2cf392
57f8f5e
f3c7a66
3e7a184
201ace5
3d13ccb
e177183
17a8938
cf233b0
b457afb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ name: Mentora CI/CD Pipeline | |||||||||||||||
|
|
||||||||||||||||
| on: | ||||||||||||||||
| push: | ||||||||||||||||
| branches: [ main, dev ] | ||||||||||||||||
| branches: [ main, dev, 'fix' ] | ||||||||||||||||
| pull_request: | ||||||||||||||||
| branches: [ main ] | ||||||||||||||||
|
|
||||||||||||||||
|
|
@@ -76,7 +76,7 @@ jobs: | |||||||||||||||
| dev-build-docker-image: | ||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||
| needs: [dev-frontend-build, dev-backend-build] | ||||||||||||||||
| if: github.ref == 'refs/heads/dev' | ||||||||||||||||
| if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/fix' | ||||||||||||||||
| permissions: | ||||||||||||||||
| contents: read | ||||||||||||||||
| packages: write | ||||||||||||||||
|
|
@@ -121,32 +121,64 @@ jobs: | |||||||||||||||
| dev-apply-deployment: | ||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||
| needs: dev-build-docker-image | ||||||||||||||||
| if: github.ref == 'refs/heads/dev' | ||||||||||||||||
| if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/fix' | ||||||||||||||||
| steps: | ||||||||||||||||
| - name: Checkout code | ||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||
|
|
||||||||||||||||
| - name: Setup kubectl | ||||||||||||||||
| uses: azure/setup-kubectl@v3 | ||||||||||||||||
| with: | ||||||||||||||||
| version: 'latest' | ||||||||||||||||
| - name: Install latest kind | ||||||||||||||||
| run: | | ||||||||||||||||
| curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-amd64 | ||||||||||||||||
| chmod +x ./kind | ||||||||||||||||
| sudo mv ./kind /usr/local/bin/kind | ||||||||||||||||
|
|
||||||||||||||||
| - name: Create KinD cluster | ||||||||||||||||
| run: | | ||||||||||||||||
| kind create cluster --name mentora-dev | ||||||||||||||||
|
|
||||||||||||||||
| - name: Set kubeconfig context to KinD | ||||||||||||||||
| run: | | ||||||||||||||||
| kubectl config use-context kind-mentora-dev | ||||||||||||||||
|
|
||||||||||||||||
| - name: Debug kubectl config | ||||||||||||||||
| run: | | ||||||||||||||||
| echo "--- Kubeconfig file content ---" | ||||||||||||||||
| cat $HOME/.kube/config || echo "Using KinD default kubeconfig" | ||||||||||||||||
| echo "--- kubectl config view ---" | ||||||||||||||||
| kubectl config view | ||||||||||||||||
|
|
||||||||||||||||
|
Comment on lines
+143
to
+149
|
||||||||||||||||
| - name: Debug kubectl config | |
| run: | | |
| echo "--- Kubeconfig file content ---" | |
| cat $HOME/.kube/config || echo "Using KinD default kubeconfig" | |
| echo "--- kubectl config view ---" | |
| kubectl config view | |
| # Debug step removed to avoid exposing sensitive information |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,35 @@ | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: #APP# | ||
| namespace: #NAMESPACE# | ||
| name: mentora-app | ||
| namespace: ${NAMESPACE} | ||
| spec: | ||
| ports: | ||
| - port: 8080 | ||
| targetPort: 8080 | ||
| selector: | ||
| app: #APP# | ||
| app: mentora-app | ||
|
|
||
| --- | ||
|
|
||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: #APP# | ||
| namespace: #NAMESPACE# | ||
| name: mentora-app | ||
| namespace: ${NAMESPACE} | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app: #APP# | ||
| app: mentora-app | ||
| replicas: 1 | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: #APP# | ||
| app: mentora-app | ||
| spec: | ||
| containers: | ||
| - image: #IMAGE# | ||
| name: #APP# | ||
| - image: ${IMAGE} | ||
| name: mentora-app | ||
|
Comment on lines
+4
to
+32
|
||
| imagePullPolicy: Always | ||
| ports: | ||
| - containerPort: 8080 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a literal branch name 'fix' in the trigger is not maintainable. Consider using a pattern like 'fix/*' to support multiple fix branches, or remove this if it's temporary debugging code.