Comments (8)
In the short term you can add multiple rancher blocks to the yaml like this:
deploy:
rancher:
url: https://example.rancher.com
service: drone/drone
docker_image: drone/drone:latest
rancher:
url: https://example.rancher.com
service: drone/drone
docker_image: drone/drone:latest
If you are interested in the ability to update multiple services in a single block feel free to send a pull request with the functionality. I'm the core drone maintainer and I've never used Rancher -- so we rely on pull requests from the community for these sort of improvements. Cheers!
from drone-rancher.
@zacksiri I'm looking over the open issues with the plugin and wondered if with the option @bradrydzewski mentioned, does it still makes sense to add multiple service upgrades due to the complexity it adds. ie. batch size, auto-upgrades, etc are often times different per services even if based on the same image. I can add the above to the docs and that should hit all use cases unless I'm missing something :)
from drone-rancher.
@josmo This would be helpful in terms of keep everything DRY.
Take for instance the following config:
pipeline:
# ...
deploy_api:
group: deploy
image: peloton/drone-rancher
url: https://rancher.…
service: stack/service
docker_image: "image:${DRONE_BRANCH}.${DRONE_COMMIT_SHA:0:8}"
start_first: true
confirm: true
timeout: 300
batch_size: 1
secrets: [ rancher_access_key, rancher_secret_key ]
when:
branch: [ production ]
event:
exclude: [ pull_request ]
deploy_scheduler:
group: deploy
image: peloton/drone-rancher
url: https://rancher.…
service: stack/service-scheduler
docker_image: "image:${DRONE_BRANCH}.${DRONE_COMMIT_SHA:0:8}"
start_first: false
confirm: true
secrets: [ rancher_access_key, rancher_secret_key ]
when:
branch: [ production ]
event:
exclude: [ pull_request ]
deploy_queue:
group: deploy
image: peloton/drone-rancher
url: https://rancher.…
service: stack/service-queue
docker_image: "image:${DRONE_BRANCH}.${DRONE_COMMIT_SHA:0:8}"
start_first: false
confirm: true
batch_size: 5
secrets: [ rancher_access_key, rancher_secret_key ]
when:
branch: [ production ]
event:
exclude: [ pull_request ]
deploy_queue_high:
group: deploy
image: peloton/drone-rancher
url: https://rancher.…
service: stack/service-queue-high
docker_image: "image:${DRONE_BRANCH}.${DRONE_COMMIT_SHA:0:8}"
start_first: false
confirm: true
batch_size: 5
secrets: [ rancher_access_key, rancher_secret_key ]
when:
branch: [ production ]
event:
exclude: [ pull_request ]
deploy_queue_low:
group: deploy
image: peloton/drone-rancher
url: https://rancher.…
service: stack/service-queue-low
docker_image: "image:${DRONE_BRANCH}.${DRONE_COMMIT_SHA:0:8}"
start_first: false
confirm: true
batch_size: 5
secrets: [ rancher_access_key, rancher_secret_key ]
when:
branch: [ production ]
event:
exclude: [ pull_request ]
It's super repetitive and if you want to change one of the more 'global' values, you need to change it in multiple spots, which can of course be fairly error prone. Refactoring the above to a single step with multiple services would be great:
pipeline:
# ...
deploy:
url: https://rancher.…
docker_image: "image:${DRONE_BRANCH}.${DRONE_COMMIT_SHA:0:8}"
secrets: [ rancher_access_key, rancher_secret_key ]
services:
- service: stack/service
start_first: true
confirm: true
timeout: 300
batch_size: 1
- service: stack/service-scheduler
start_first: false
confirm: true
- service: stack/stack/service-queue
start_first: false
confirm: true
batch_size: 5
- service: stack/stack/service-queue-high
start_first: false
confirm: true
batch_size: 5
- service: stack/stack/service-queue-low
start_first: false
confirm: true
batch_size: 5
when:
branch: [ production ]
event:
exclude: [ pull_request ]
from drone-rancher.
@shnhrrsn have you considered using YAML anchors to reduce boilerplate? I believe this can be handled at the YAML level without having to change the plugin itself.
deploy: &deploy
group: deploy
image: peloton/drone-rancher
url: https://rancher.…
docker_image: "image:${DRONE_BRANCH}.${DRONE_COMMIT_SHA:0:8}"
start_first: true
confirm: true
timeout: 300
batch_size: 1
secrets: [ rancher_access_key, rancher_secret_key ]
when:
branch: [ production ]
event:
exclude: [ pull_request ]
pipeline:
deploy_api:
<<: *deploy
service: stack/service
deploy_scheduler:
<<: *deploy
service: stack/service-scheduler
from drone-rancher.
I'll give that a try, thanks for the quick reply!
walks away in shame
from drone-rancher.
@shnhrrsn I just wanted to check if what Brad mentioned would work :) If it does I'm going to close this out.
from drone-rancher.
Yep, worked perfect!
from drone-rancher.
Glad to hear!
from drone-rancher.
Related Issues (18)
- Option: confirm upgrade HOT 3
- Batch size and batch interval HOT 3
- Failed to list rancher services? HOT 10
- Rancher Load Balancer Support HOT 2
- Unable to find service HOT 5
- Ability to change sidekicks images when upgrading a service HOT 4
- custom env variable names HOT 2
- Ability to confirm before update HOT 2
- Research: Rancher 2.0 move away from cattle and using K8s HOT 31
- Error using Rancher v1 HOT 2
- How to clear a specific rancher environment? HOT 3
- Problem with secrets HOT 2
- The plugin isn't able to find my stacks anymore HOT 7
- Ability to create a service if does not exist HOT 1
- Support Rancher environments HOT 1
- Confirm fails HOT 11
- Force pull HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drone-rancher.