| Q | A
| ----------------- | ---
| Issue Type | Question
| Deployer Version | 4.2.1
| Local Machine OS | Ubuntu 14.04.5 LTS
| Remote Machine OS | Ubuntu 16.04.2 LTS
➜ fam git:(simplify-deployment) ✗ dep current production
➤ Executing task current
Current release: 16
Current release: 15
Current release: 4
✔ Ok
is there a option to make them timestamp at least or something that I could identify that they are she same releases and also would like to know what release server has. Because now I can just gues what is 16? 4? or on with server it is.
maybe this cmd could return metadata something like commit sha id or tag name, release date and maybe something more or even make it configurable when uploading with ftp..
I think this is good idea. No it's just folder number.
Maybe output something like config:dump?
maybe.. From current command I would want info that could help me identify what version and with server has. Maybe that's just me who has different versions in different servers :) but well still would be nice
I'll try to make it more useful. Now you can try this: dep current -vvv
@elfet for now I overrided current task
task('current', function () {
$server = Context::get()->getServer();
cd('{{current_path}}');
$commit = run('git rev-parse --verify --short=10 HEAD');
$tag = run('git name-rev --tags --name-only $(git rev-parse HEAD) | sed \'s|\([^\^]*\)\(\^0\)$|\1|g\'');
writeln(sprintf(
"Server '%s' current release: %s version: %s commit: %s",
$server->getConfiguration()->getName(),
basename(get('current_path')),
$tag,
$commit
));
});
maybe not best workaround but at least I have more info
Setting the release directory to the timestamp would make sense to me :)
not sure we already imply that the projects are based on git but if so, we could also use the short git commit hash as foldername
You can override it really simple:
set('release_name', function () {
return date('YmdHis');
});
@antonmedv is this available now or will be when #1092 merged?
@antonmedv also I dont understand why you closed as this issue was not about how to change release name but make dep current command more useful than displaying random numbers and not even showing with version these belongs
@svycka this is available now. I closed it because i added in to plan in #1092, this way i can see what to do next and don't lose it. I already know for to do it awesome and useful. Stay tuned))
You can override it really simple:
@antonmedv is it safe to change {{release_name}} at any time?
Before release itself - yes.
Before release itself - yes.
Not sure I 100% understand. This is what my releases/ directory looks like right now:
[releases]# ls -1
./
../
1/
2/
2018.11.18-075735/
20181118.090400-convers/
20181118.090623-leho/
20181118.092924-leho/
I started to understand how to change {{release_name}} in the middle of the learning process (not deploy process), updated release_name and ran dep deploy again.
It seems to understand this change fine, because it keeps separate .dep/ metadata records.
Or should I delete everything and start fresh?
No, keep everything is ok
Hey, I am not sure if related in here (will open a ticket if not):
After deploying to N hosts - how should I expect the versioning to work once I add a new host to the pull? Currently, AFAI, the version is listed in .dep/releases but the new host won't have this file available.
Yes, each host keeps versions independently
I dont know why @antonmedv closed this. He said it has been fixed I am not sure what he meant but now instead of:
Current release: 16
Current release: 15
Current release: 4
it shows:
+----------------+---------+
| Host | Current |
+----------------+---------+
| app1.lt | 3 |
| app2.lt | 2 |
| dev.app.lt | 120 |
+----------------+---------+
I still dont know what is installed on each server just deploy number... I don't even know why I need that.
What I actualy wanted was something like my workaround:
Server 'dev.app.lt' current release: 120 version: v1.5.0 commit: 8cb3a9e9bc
this way I can know what is inside 120 release that's a v1.5.0 git tag or 8cb3a9e9bc commit when does not have tag. While this is pretty easy to add custom task I am ok but just strage that default command does not display this info.
I added a PR for this a while back: https://github.com/deployphp/deployer/pull/1543
Yes, each host keeps versions independently
Any chance/idea how to align it somehow?
Use date or some other global couter.
Most helpful comment
You can override it really simple: