tamagokun / pomander Goto Github PK
View Code? Open in Web Editor NEWDeploy your PHP with PHP. Inspired by Capistrano and Vlad.
Home Page: http://tamagokun.github.io/pomander/
License: MIT License
Deploy your PHP with PHP. Inspired by Capistrano and Vlad.
Home Page: http://tamagokun.github.io/pomander/
License: MIT License
PHP has terrible shell support, but if we can use the SSH2 extension, we should be able to work with a much nicer shell and do things like write to STDIN with an interactive terminal.
If the user doesn't have the extension installed, just fallback to using passthru
When server responds with add to known_hosts prompt, pomander should be able to answer "yes"
If remote deployments require passwords after the initial SSH connection, Pomander is currently unable to handle them.
It would be great if Pomander could auto-respond to these prompts with a password or key_password from the environment config, or if the prompt could be presented to the user to provide input.
I have code like this:
$env->user('user');
$env->repository('repo');
$env->scm('svn');
$env->deploy_to('/var/web');
$env->key_path("key");
$env->app(array('server1.com','server2.com'));
When i run deploy:update this command perform deploy only on the first server in the list. It there some additional options that enables deploying process on multiple servers?
Sometimes rsync does totally weird stuff.
Also, currently Pomander does not utilize key_path
or key_pass
when using rsync, so those commands would fail even though ssh connections elsewhere would be successful.
It might be better to straight up use phpseclib's SCP implementation, or just hunker down and get this rsync thing working like a champ.
If Pomander catches a SIGTERM during a deployment and things can be rolled back, it should!
My merge requests were merged, so we can get rid of special SSH2 sub classes.
Hi, thks for the merge ;)
Do you consider that this version is stable enough to be tag ?
I prefer to link my plugin to a stable version.
++
basic database tasks should be a part of Pomander, with the Wordpress specific bits belonging to the plugin.
Hello!
Sorry, if I have missed something, but is there in Pomander feature like :linked_dirs in Capistrano? This feature allows to put directories to shared folder and creates symlinks to these directories in the releases dirs.
There is a shared folder in Pomander, but I didn't find any option to create symlinks neigher in the docs, nor in the code.
Best regards
Working support for Windows would be awesome.
Things that need to be taken care of:
@msschwartz whatchu think? Have any thoughts?
I'd rather change the scm
option to method, so that users can use alternative deploy methods (read: rsync) since sometimes the remote will not be fully configured to handle git or svn.
Methods to include:
If a path contains a space, this can cause task running commands.
Need to go through the codebase and wrap paths with ""
I have setup my first pomander deploy and after running :setup it seems to get hung on
* info deploy setting up environment
It looks like it has created the shared and releases directories, but nothing happens after that.
Also, if I remove $env->releases('true') it deletes the parent directory (one that I created, not pomander). Not sure if that's the intended action, seems off.
Being able to deploy a specific tag based on semantic versioning constraint similarly to Composer would be awesome. Along the lines of:
$env->version('3.2.*');
Where it then clones and checks out the latest tag from 3.2.x, e.g. tags/3.2.14.
PHP has few semver parsers that implements the full spec and allow constraints, making resolving pretty easy; run git tags
, $tags = explode("\n", $output)
and find the highest satisfying version from the array, along the lines of:
use vierbergenlars\SemVer\expression;
$expression = new expression($env->version);
$version = $expression->maxSatisfying($tags);
Then checkout the tag in the $version, e.g. git checkout tags/$version
.
Rollback are... well, weird. Need to support the following:
Hi, I faced a problem when updated my local server to PHP7.
I've got an error in console:
Methods with the same name as their class will not be constructors in a future version of PHP; Net_SSH2 has a deprecated constructor
A few scenarios to discuss to try and perfect the update command:
Currently, the command is something along the lines of:
git reset --hard --quiet && git checkout branch --quiet && git pull --quiet
depending upon whether or not you specify a branch or revision.
Here is where some issues start to arise:
@leopoiroux does this make sense? I think it may be best to go back to using git fetch, but incorporate your additional checks for branch/revision.
Something like:
for branches:
git fetch --all --quiet && git reset --hard --quiet && git checkout branch --quiet
for revisions/versions:
git fetch --all --quiet && get reset --hard --quiet revision
Currently there is no way to automatically remove old releases.
The idea is sort of already implemented when you set the releases option (true or any number), just need to implement the finding and removal of releases in the task itself.
When deploying an environment any "after" blocks within any deploy config will be executed. Possibly resolve this by creating a new file named _after.php, then letting pom load the file based on the environment being deployed to.
There is no option to ignore exit code > 0 in the run
. Please add it or create a run_silent
or so.
Thanks.
These appear to be broken.
tamagokun/pomander-wordpress#17
If a get()
or put()
fail, this won't trigger the rollback task in a deployment, which can lead to broken deploys.
We need some helpful docs for writing tasks.
Things like $env->database and $env->wordpress (plugin) should have default array blocks.
I'm trying out pomander, but I can't get it function. My config:
<?php
$env->repository('http://<svn-repository>')
->releases(true)
->keep_releases(5)
->user('<me>')
->scm('svn')
->revision('trunk')
//
->backup(true)
;
//
// If you are deploying your application to a remote server:
//
$env->deploy_to('/usr/src/build/pom/track');
$env->app('<internal ip>');
When trying to check the setup, I get the following error:
hermes:pom gp$ pom deploy:setup
(in <my dir>)
* info target <host ip>
* info deploy setting up environment
bash: git: command not found
* abort fail aborted!
I'm not using git. git isn't on the server. But SVN is. And I am trying to use SVN.
Hi,
I'm used to Capistrano and deployers and really enjoy you built one made of PHP.
But I'm having an issue : the script can't connect through ssh to my server.
I tried to set the key path with $env->key_path('/System/Users/Username/.ssh/id_rsa')
but I'm still getting the "Unable to load RSA key" message.
I digged a little in the source code. The loadKey
method from phpseclib is always returning false, I can't figure out why.
How do you manage to make it work ? I'm having no trouble connecting through my console.
Should be able to detect composer.json and attempt to install vendor libs.
This requires composer to be installed on the remote end of the deployment, but there will be an option to turn this off:
$env->composer(false);
pom production rollback
- This will rollback to the previous release.
It would be nice if we could do something to rollback to other releases:
pom production rollback releases=2 # go back 2 releases.
Is is possible with Pomander?
I seek PHP alternative for Capistrano, it can do parallel deployment to multiple servers.
Cataloging notes and ideas about being able to manage deployments to Heroku via Pomander.
This should be a straightforward process as Heroku takes care of nearly everything for us. Pomander just really needs to run the key deploy tasks with empty commands so that before/after hooks can be triggered, and anything special can be taken care of.
Notes:
Example Capistrano task for deploying to Heroku:
namespace :deploy do
desc 'Deploy the app'
task :production do
app = "my-amazing-heroku-app-name"
remote = "[email protected]:#{app}.git"
system "heroku maintenance:on --app #{app}"
system "git push #{remote} master"
system "heroku run rake db:migrate --app #{app}"
system "heroku maintenance:off --app #{app}"
end
end
Using a Composer plugin to trigger pom heroku
Just rely on heroku run: heroku run vendor/bin/pom heroku
Need some basics flag options like:
--version, -v
--help, -h
While a deploy is running, create a deploy.lock file so that subsequent deploys cannot be happening at the same time.
Things to look out for:
If a deploy fails, will it always be able to remove the deploy.lock file? If it cannot, people will be stuck without being able to deploy.
I tried to deploy with pomander, but it fails with my working SSH Key. A plain ssh login works.
Error message:
* abort ssh Unable to load RSA key.
Tried against ǜersion "pomander/pomander": "dev-master"
.
The head of my private key:
$ cat .ssh/id_rsa
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,E731CBEFD26F9C7560C79A3E7C53C516
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.