Hello, I’m using v0.5 currently and plan to upgrade to v0.8 soon. I know there are data upgrades done in v0.6 and I have to go through v0.6 and v0.7 before upgrading to v0.8. Our builds heavily depends on drone build numbers, so I was wondering whats the best way to maintain existing build numbers after upgrade?
Pls note we use default sqlite db.
@bradrydzewski appreciate for your suggestions here.
Hi,
I suggest you move away from using the inner DB, especially if you rely so bad on build numbers.
You can migrate you DB to an external relations DB and then upgrade freely while using the same dataset.
One question though - Why are you relying so badly on build numbers?
Thanks for the response,
could you pls elaborate how its going to be different if I go with some other DB? If there are data changes, then its going to break existing DB no matter which one you use.
We use build numbers to version our dev build artifacts.
Hi, Maybe I wasn’t clear - I did not suggest using a different DB type, but using the external option instead of the internal one so that your DB and data are not impacted by any application / resources failure.
If the numbers of builds are that important you can hack it on your side by incrementing starting from the last build created with the old DB.
Let’s say your last build was 86, and you start the use of a new DB, name your future build using the deployment plugin as such:
BUILD_NUMBER=$((${DRONE_BUILD_NUMBER}+86))
version: <service-name>-$BUILD_NUMBER
Ah, ok. Got it!
Thanks for the solution, we plan to do the same thing as our default option but was wondering if there is anything provided by Drone on this.
We provide the ability to set the drone counter manually from the command line and api:
drone repo update --build-counter=<number> <repo>
The below example would set the counter to 1234, which means the next build number for this repository would be 1235.
drone repo update --build-counter=1234 octocat/hello-world
This command can only be executed by a drone system administrator.
Awesome! This is what I was looking for.
Thanks @bradrydzewski!
Thanks, @bradrydzewski
I am looking for this feature as well.