mirror of
				https://github.com/honestbee/drone-kubernetes.git
				synced 2025-11-04 00:48:03 +00:00 
			
		
		
		
	Handle arrays in deployment
This commit is contained in:
		
							parent
							
								
									f22ea1bb67
								
							
						
					
					
						commit
						4dd07c4a73
					
				
					 2 changed files with 16 additions and 1 deletions
				
			
		
							
								
								
									
										10
									
								
								README.md
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								README.md
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -14,6 +14,16 @@ This pipeline will update the `my-deployment` deployment with the image tagged `
 | 
			
		|||
            container: my-container
 | 
			
		||||
            tag: ${DRONE_COMMIT_SHA:8}
 | 
			
		||||
 | 
			
		||||
Deploying several new containers, eg in a scheduler-worker setup.
 | 
			
		||||
    
 | 
			
		||||
    pipeline:
 | 
			
		||||
        deploy:
 | 
			
		||||
            image: quay.io/honestbee/drone-kubernetes
 | 
			
		||||
            deployment: [server-deploy, worker-deploy]
 | 
			
		||||
            repo: myorg/myrepo
 | 
			
		||||
            container: my-container
 | 
			
		||||
            tag: ${DRONE_COMMIT_SHA:8}
 | 
			
		||||
 | 
			
		||||
This more complex example demonstrates how to deploy to several environments based on the branch, in a `app` namespace 
 | 
			
		||||
 | 
			
		||||
    pipeline:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,4 +16,9 @@ kubectl config set-credentials default --token=${KUBERNETES_TOKEN}
 | 
			
		|||
kubectl config set-cluster default --server=${KUBERNETES_SERVER} --insecure-skip-tls-verify=true
 | 
			
		||||
kubectl config set-context default --cluster=default --user=default
 | 
			
		||||
kubectl config use-context default
 | 
			
		||||
kubectl -n ${PLUGIN_NAMESPACE} set image deployment/${PLUGIN_DEPLOYMENT} ${PLUGIN_CONTAINER}=${PLUGIN_REPO}:${PLUGIN_TAG}
 | 
			
		||||
 | 
			
		||||
DEPLOYMENTS=$(echo $PLUGIN_DEPLOYMENT|tr -d '[],')
 | 
			
		||||
for DEPLOY in ${DEPLOYMENTS[@]}; do
 | 
			
		||||
  kubectl -n ${PLUGIN_NAMESPACE} set image deployment/${DEPLOY} \
 | 
			
		||||
    ${PLUGIN_CONTAINER}=${PLUGIN_REPO}:${PLUGIN_TAG}
 | 
			
		||||
done
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue