Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Release names are hard to read. #50

Closed
ju1ius opened this issue Apr 29, 2016 · 2 comments
Closed

Release names are hard to read. #50

ju1ius opened this issue Apr 29, 2016 · 2 comments

Comments

@ju1ius
Copy link

ju1ius commented Apr 29, 2016

[EDIT] submitted to the wrong repo, sorry
see deployphp/deployer#641

@ju1ius ju1ius closed this as completed Apr 29, 2016
@johnny-bit
Copy link
Contributor

I see no difference between 20160425120500 than 2016-04-25_12:05:00. plus
characters like ":" and "." may be problematic ;)

2016-04-29 9:56 GMT+02:00 ju1ius notifications@github.com:

Hi,
I find the current way of naming release hard to read, especially if you
have several of them during the same day/hour.

Couldn't it be a bit more human friendly in future versions ?
For example:

// recipe/common.php/** * Release */task('deploy:release', function () { $releaseDir = env()->parse("{{deploy_path}}/releases"); $guard = 42; do { $time = microtime(); list($usec, $sec) = explode(' ', $time); $date = \DateTime::createFromFormat('U.u', $sec . '.' . ($usec * 1e6)); $releaseName = $date->format('Y-m-d_H:i:s.u'); $releasePath = $releaseDir . '/' . $releaseName; } while (is_dir($releasePath) && --$guard); env('release_name', $releaseName); run("mkdir $releasePath"); run("cd {{deploy_path}} && if [ -h release ]; then rm release; fi"); run("ln -s $releasePath {{deploy_path}}/release");})->desc('Prepare release');

This way you have releases that look like:

  • releases
    |-- 2016-04-25_12:05:00.011813
    |-- 2016-04-25_18:01:02.614783
    |-- 2016-04-26_12:00:03.314854
    |-- 2016-04-26_18:03:00.214896
    |-- 2016-04-27_12:00:12.114936
    |-- 2016-04-27_18:02:33.014975
    |-- 2016-04-28_12:04:45.015015
    |-- 2016-04-28_18:00:07.215054
    |-- 2016-04-29_12:01:18.115094
    -- 2016-04-29_18:00:00.415149

Which is quite more readable than

  • releases
    |-- 20160425120500
    |-- 20160425180102
    |-- 20160426120003
    |-- 20160426180300
    |-- 20160427120012
    |-- 20160427180233
    |-- 20160428120445
    |-- 20160428180007
    |-- 20160429120118
    -- 20160429180000

Don't you think ? [image: 😉]


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#50

Pozdrawiam,
Hubert Kowalski

@ju1ius
Copy link
Author

ju1ius commented Apr 29, 2016

@johnny-bit Well then you have nice superpowers! 😉
Not having an exceptionaly accute sight, I find that this:

+ releases
|-- 20160425120500
|-- 20160425180102
|-- 20160426120003
|-- 20160426180300
|-- 20160427120012
|-- 20160427180233
|-- 20160428120445
|-- 20160428180007
|-- 20160429120118
\-- 20160429180000

Is a lot harder to scan than this:

+ releases
|-- 2016-04-25_12:05:00.011813
|-- 2016-04-25_18:01:02.614783
|-- 2016-04-26_12:00:03.314854
|-- 2016-04-26_18:03:00.214896
|-- 2016-04-27_12:00:12.114936
|-- 2016-04-27_18:02:33.014975
|-- 2016-04-28_12:04:45.015015
|-- 2016-04-28_18:00:07.215054
|-- 2016-04-29_12:01:18.115094
\-- 2016-04-29_18:00:00.415149

I can tell much quicker what's the month, day, hour of a release, without having to think about it.

characters like ":" and "." may be problematic

: might be on windows maybe, but then everything is going to be problematic, since recipes expect a POSIX shell... but anyway, it could easily be replaced by a -.
. is never going to be problematic, and is very common for directories (e.g. /etc/php5/conf.d, /etc/apache2/conf.d, /etc/apt/sources.list.d, just to name a few)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants