mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 20:25:50 +00:00
Moving k8s deployments to different repo
This commit is contained in:
parent
57a22421e2
commit
a7164a5044
2 changed files with 21 additions and 30 deletions
25
.github/workflows/maven-build.yml
vendored
25
.github/workflows/maven-build.yml
vendored
|
@ -67,12 +67,29 @@ jobs:
|
||||||
az aks get-credentials --resource-group grid-capstone --name dev-grid-cluster --admin --overwrite-existing
|
az aks get-credentials --resource-group grid-capstone --name dev-grid-cluster --admin --overwrite-existing
|
||||||
kubectl get pods
|
kubectl get pods
|
||||||
kubectl get nodes
|
kubectl get nodes
|
||||||
|
|
||||||
- name: My GitOps solution
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Automatic deployment
|
||||||
run: |
|
run: |
|
||||||
|
git config --global user.name 'Kacper Piasecki'
|
||||||
|
git config --global user.email 'k.r.piasecki2@gmail.com'
|
||||||
|
git config --unset-all http.https://github.com/.extraheader
|
||||||
|
git clone "https://x-access-token:${{ secrets.K8S_GITHUB_TOKEN }}@github.com/Piasecki-grid/grid-capstone-k8s-manifests.git"
|
||||||
|
cd grid-capstone-k8s-manifests
|
||||||
sed -i 's|${{ vars.ACR_NAME }}.azurecr.io/grid-capstone:[0-9a-f]\{40\}|${{ vars.ACR_NAME }}.azurecr.io/grid-capstone:${{ github.sha }}|g' deployment.yml
|
sed -i 's|${{ vars.ACR_NAME }}.azurecr.io/grid-capstone:[0-9a-f]\{40\}|${{ vars.ACR_NAME }}.azurecr.io/grid-capstone:${{ github.sha }}|g' deployment.yml
|
||||||
kubectl apply -f deployment.yml
|
git add .
|
||||||
|
git commit -m "Kubernetes manifests file update: $(date)"
|
||||||
|
git push
|
||||||
|
- uses: azure/login@v2
|
||||||
|
name: Azure Login
|
||||||
|
with:
|
||||||
|
creds: '{"clientId":"${{ secrets.AZURE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}'
|
||||||
|
- name: Getting access to the cluster
|
||||||
|
run: |
|
||||||
|
az aks get-credentials --resource-group grid-capstone --name dev-grid-cluster --admin --overwrite-existing
|
||||||
|
kubectl apply -f .
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
creationTimestamp: null
|
|
||||||
labels:
|
|
||||||
app: test2
|
|
||||||
name: test2
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: test2
|
|
||||||
strategy: {}
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
creationTimestamp: null
|
|
||||||
labels:
|
|
||||||
app: test2
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- image: gridacr1246213.azurecr.io/grid-capstone:5f73f01916265eb683c41760566961d4b8602568
|
|
||||||
name: hello-world
|
|
||||||
resources: {}
|
|
||||||
imagePullSecrets:
|
|
||||||
- name: tokensecret
|
|
||||||
status: {}
|
|
Loading…
Reference in a new issue