deployer
deployer copied to clipboard
Reallow timestamp as release number
In older versions there was the possibility to have the timestamp (format YmdHis) as release number. I would love to have this back and it could be optionally enabled by adding
set('datetime_release_name', function () {
return date('YmdHis');
});
somewhere and then overriding the default e.g. in the deploy.yaml
release_name: '{{datetime_release_name}}'
I could make a PR, only where should I put the set function best? recipe/deploy/release.php I guess?
Best regards, Willi
Upvote & Fund
- We're using Polar.sh so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.
So you're saying adding this to your deploy.php doesn't work anymore? That strikes me as odd.
set('release_name', function () {
return date('YmdHis');
});
No, actually I'm not saying that. Only I use deploy.yaml not deploy.php and I have not figured out yet how to write your above code in YAML ;) So basically I could
- switch to
config.php - learn how to write the above code in YAML
- or include the above code..
I really like the yaml way of configuring your deployment though..
I think we need to find a way to allow such configuration in YAML.
What about ability to add PHP code to yaml config?
Something like this:
tasks:
predeploy:
- run: date -u
- php: set('release_name', $prev);
Hej @antonmedv,
this could be a more general solution, yes. But actually it would be sufficient to allow this on parameters like:
config:
release_name:
- php: date('YmdHis');
Which would parse to:
set('release_name', function () {
return date('YmdHis');
});