Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep releases do not work properly #3737

Open
antonmedv opened this issue Nov 28, 2023 · 5 comments
Open

Keep releases do not work properly #3737

antonmedv opened this issue Nov 28, 2023 · 5 comments
Labels

Comments

@antonmedv
Copy link
Member

This workaround solved the problem for us. Add to your deploy.php file:

desc('Fix release_log file');
task('fix:release_log', function() {
    cd('{{deploy_path}}');

    if(test('[ -f .dep/releases_log ]')) {
        $releasesLog = implode("\n", array_map(function($line) {
            if(json_decode($line) === null) {
                $line = str_replace('{ ', '{ "', str_replace(' }', '" }', $line));
                $line = str_replace(' : ', '": "', str_replace(' , ', '", "', $line));
            }

            return $line;
        }, explode("\n", run('cat .dep/releases_log'))));

        run("echo '" . str_replace("'", "'\\''", $releasesLog) . "' > .dep/releases_log");
    }
});

Then, add before('deploy:cleanup', 'fix:release_log'); to fix the log before the cleanup task.

Originally posted by @david-windsock in #3511 (comment)

@antonmedv antonmedv added the bug label Nov 28, 2023
@david-windsock
Copy link

david-windsock commented Nov 28, 2023

Thanks @antonmedv, I was going to a new issue but let's keep all here. The problem seems to occur only when a deploy is made from Windows to Linux, resulting in an invalid release_log file format. Each line are not properly escaped (resulting in JSON without double quotes) so releases_log skips all invalid releases.

I think the bug was introduced on 7.1.0 release, because prior to january 2023 the release_log seems to be OK.

Pull requests #3569 and #3603 must solve this problem...

@david-windsock
Copy link

david-windsock commented Feb 26, 2024

Just to keep this updated: #3569 was discarded in favor of #3603, which was merged two weeks ago. Now waiting for a new release...

@david-windsock
Copy link

There is an estimated date for the next release? Thanks!

@antonmedv
Copy link
Member Author

Will try to release today.

@david-windsock
Copy link

Thanks @antonmedv

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

No branches or pull requests

2 participants