mirror of
				https://github.com/KevinMidboe/k9e.no.git
				synced 2025-10-29 17:50:14 +00:00 
			
		
		
		
	Created pipeline for deploy, use .kube/config
This commit is contained in:
		
							
								
								
									
										35
									
								
								.drone.yml
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								.drone.yml
									
									
									
									
									
								
							| @@ -1,7 +1,7 @@ | |||||||
| --- | --- | ||||||
| kind: pipeline | kind: pipeline | ||||||
| type: docker | type: docker | ||||||
| name: Build and publish | name: Build | ||||||
|  |  | ||||||
| platform: | platform: | ||||||
|   os: linux |   os: linux | ||||||
| @@ -40,25 +40,25 @@ steps: | |||||||
|       branch: |       branch: | ||||||
|         - main |         - main | ||||||
|  |  | ||||||
|  | --- | ||||||
|  | kind: pipeline | ||||||
|  | type: docker | ||||||
|  | name: Deploy | ||||||
|  |  | ||||||
|  | platform: | ||||||
|  |   os: linux | ||||||
|  |   arch: amd64 | ||||||
|  |  | ||||||
|  | steps: | ||||||
|   - name: Deploy app to kubernetes |   - name: Deploy app to kubernetes | ||||||
|     image: alpine/k8s:1.25.15 |     image: alpine/k8s:1.25.15 | ||||||
|     commands: |     commands: | ||||||
|       - kubectl config set-cluster $KUBE_CLUSTER --server=$KUBE_SERVER |       - mkdir -p /root/.kube | ||||||
|       - kubectl config set-credentials $KUBE_USER --token=$KUBE_TOKEN |       - echo $KUBE_CONFIG | base64 -di > /root/.kube/config | ||||||
|       - kubectl config set-context $KUBE_CONTEXT --cluster=$KUBE_CLUSTER --user=$KUBE_USER |       - kubectl --kubeconfig=/root/.kube/config get pods | ||||||
|       - kubectl config use-context $KUBE_CONTEXT |  | ||||||
|       - kubectl get pods |  | ||||||
|     environment: |     environment: | ||||||
|       KUBE_CLUSTER: |       KUBE_CONFIG: | ||||||
|         from_secret: KUBE_CLUSTER |         from_secret: KUBE_CONFIG | ||||||
|       KUBE_USER: |  | ||||||
|         from_secret: KUBE_USER |  | ||||||
|       KUBE_SERVER: |  | ||||||
|         from_secret: KUBE_SERVER |  | ||||||
|       KUBE_TOKEN: |  | ||||||
|         from_secret: KUBE_TOKEN |  | ||||||
|       KUBE_CONTEXT: |  | ||||||
|         from_secret: KUBE_CONTEXT |  | ||||||
|     when: |     when: | ||||||
|       event: |       event: | ||||||
|         include: |         include: | ||||||
| @@ -68,3 +68,6 @@ steps: | |||||||
|       branch: |       branch: | ||||||
|         - main |         - main | ||||||
|         - kube |         - kube | ||||||
|  |  | ||||||
|  | depends_on: | ||||||
|  |   - Build | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user