This commit is contained in:
		
							parent
							
								
									f8e3f2b9ad
								
							
						
					
					
						commit
						389aeb261f
					
				
					 2 changed files with 49 additions and 1 deletions
				
			
		
							
								
								
									
										30
									
								
								.drone.yml
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								.drone.yml
									
									
									
									
									
								
							| 
						 | 
					@ -31,7 +31,7 @@ steps:
 | 
				
			||||||
- name: build image
 | 
					- name: build image
 | 
				
			||||||
  image: docker:stable
 | 
					  image: docker:stable
 | 
				
			||||||
  environment:
 | 
					  environment:
 | 
				
			||||||
    DOCKER_HOST: tcp://docker:2375
 | 
					    DOCKER_HOST: tcp://docker
 | 
				
			||||||
    USERNAME:
 | 
					    USERNAME:
 | 
				
			||||||
      from_secret: dockerhub_username
 | 
					      from_secret: dockerhub_username
 | 
				
			||||||
    PASSWORD:
 | 
					    PASSWORD:
 | 
				
			||||||
| 
						 | 
					@ -51,3 +51,31 @@ services:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
depends_on:
 | 
					depends_on:
 | 
				
			||||||
  - lint
 | 
					  - lint
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					---
 | 
				
			||||||
 | 
					kind: pipeline
 | 
				
			||||||
 | 
					name: deploy
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					steps:
 | 
				
			||||||
 | 
					- name: build image
 | 
				
			||||||
 | 
					  image: docker:stable
 | 
				
			||||||
 | 
					  environment:
 | 
				
			||||||
 | 
					    DOCKER_HOST: tcp://docker:2375
 | 
				
			||||||
 | 
					    KUBE_USERNAME:
 | 
				
			||||||
 | 
					      from_secret: kubectl_username
 | 
				
			||||||
 | 
					    KUBE_PASSWORD:
 | 
				
			||||||
 | 
					      from_secret: kubectl_password
 | 
				
			||||||
 | 
					    KUBE_URI:
 | 
				
			||||||
 | 
					      from_secret: kubectl_uri
 | 
				
			||||||
 | 
					    KUBE_CA:
 | 
				
			||||||
 | 
					      form_secret: kubectl_ca
 | 
				
			||||||
 | 
					  commands:
 | 
				
			||||||
 | 
					    - kubectl
 | 
				
			||||||
 | 
					    - cat kube/kubeconfig_template.yaml | envsubst > /.kube/config
 | 
				
			||||||
 | 
					    - kubectl get pods
 | 
				
			||||||
 | 
					    - kubectl get deployments
 | 
				
			||||||
 | 
					    - kubectl get svc
 | 
				
			||||||
 | 
					    - kubectl apply -f kube/beer-deployment.yaml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					depends_on:
 | 
				
			||||||
 | 
					  - build
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										20
									
								
								kube/kubeconfig_template.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								kube/kubeconfig_template.yaml
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,20 @@
 | 
				
			||||||
 | 
					apiVersion: v1
 | 
				
			||||||
 | 
					clusters:
 | 
				
			||||||
 | 
					- cluster:
 | 
				
			||||||
 | 
					    certificate-authority-data: ${KUBE_CA}
 | 
				
			||||||
 | 
					    server: ${KUBE_URI}
 | 
				
			||||||
 | 
					  name: default
 | 
				
			||||||
 | 
					contexts:
 | 
				
			||||||
 | 
					- context:
 | 
				
			||||||
 | 
					    cluster: default
 | 
				
			||||||
 | 
					    user: default
 | 
				
			||||||
 | 
					  name: default
 | 
				
			||||||
 | 
					current-context: default
 | 
				
			||||||
 | 
					kind: Config
 | 
				
			||||||
 | 
					preferences: {}
 | 
				
			||||||
 | 
					users:
 | 
				
			||||||
 | 
					- name: default
 | 
				
			||||||
 | 
					  user:
 | 
				
			||||||
 | 
					    password: ${KUBE_PASSWORD}
 | 
				
			||||||
 | 
					    username: ${KUBE_USERNAME}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue