$currentRelease."); if (!test("[ -d releases/$candidate ]")) { throw new \RuntimeException(parse("Release \"$candidate\" not found in \"{{deploy_path}}/releases\".")); } if (test("[ -f releases/$candidate/BAD_RELEASE ]")) { writeln("Candidate $candidate marked as bad release."); if (!askConfirmation("Continue rollback to $candidate?")) { writeln('Rollback aborted.'); return; } } writeln("Rolling back to $candidate release."); // Symlink to old release. run("{{bin/symlink}} releases/$candidate {{current_path}}"); // Mark release as bad. $timestamp = timestamp(); run("echo '$timestamp,{{user}}' > releases/$currentRelease/BAD_RELEASE"); writeln("rollback to release $candidate was successful"); });