Giter Club home page Giter Club logo

Comments (2)

johnny-bit avatar johnny-bit commented on June 19, 2024

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 [email protected]:

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
https://github.com/deployphp/recipes/issues/50

Pozdrawiam,
Hubert Kowalski

from recipes.

ju1ius avatar ju1ius commented on June 19, 2024

@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)

from recipes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.