Giter Site home page Giter Site logo

avocado's Introduction

develop: | master:

Avocado

Avocado is a deployment framework for web applications written in Ruby.

The current release is 0.6.1.

Licensing

Avocado is licensed under the GPLv2. For more Information have a look into the LICENSE file.

Getting started

Be sure that you have installed Ruby 2.0 or higher and RubyGems. Then the Installation is as easy as

$ gem install avodeploy

After the installation completed successfully, you can run the avo command to access the Avocado command line utility.

Use Avocado in your project

In your project folder just run

$ avo install

to let Avocado place a deployment manifest file, called Avofile, in your project root folder. Then just open up the file in your editor of choice to customize your deployment process. The file is fully commented, giving you a basic understanding of how Avocado helps you to get your deployments done.

Limitations

Avocado does currently only work if you use Git or Bazaar for as version control system and SSH to deploy. Furthermore, the only implemented authentication method for both SSH and Git/Bazaar is public key authentication.

Changelog

There is a CHANGELOG file that contains all the changes throughout every version.

Need more documentation?

I'm currently creating documents that both the end user and developers might find helpful.

Authors and Contributors

The project is founded and maintained by @dprandzioch. You are welcome to contribute your changes and enhancements by just creating a pull request to the develop branch.

avocado's People

Contributors

dprandziochatomeco avatar

Stargazers

Simon Heinen avatar David-Lee Kulsch avatar

Watchers

James Cloos avatar David Stapp avatar  avatar

avocado's Issues

API is not accessible when requiring the gem

The Avocado API is not accessible when requiring the gem directly, paths are not resolved.

/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- avocado (LoadError)
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from includetest.rb:1:in `<main>'

Deploy tags

It would be nice to deploy tags directly, e.g.

avo start production deploy -t 1.0.3

Local Echo in Tasks not working as expected

Following Code from example Avofile dont echo anything:
# A basic task definition can look like that:
#
task :do_that do
command "echo 'foo'"
end

If you redirect into a file it works.

SCP fails with non usefull errormessage

If remote file can't be written because of no space left on device avodeploy -d raises following error.
Maybe mention this in docs or add different errormessages?

(second line is added by me to see full destination path)

I, [2015-01-20T16:32:22.758867 #29079] INFO -- : started upload of file deploy.tar.gz to web
I, [2015-01-20T16:32:22.758943 #29079] INFO -- : DBG: remote /tmp/deploy.tar.gz
/home/david-lee/.rvm/gems/ruby-2.1.5/gems/net-scp-1.2.1/lib/net/scp.rb:365:in block (3 levels) in start_command': SCP did not finish successfully (1): (Net::SCP::Error) from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:591:incall'
from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:591:in do_close' from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:586:inchannel_close'
from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:465:in dispatch_incoming_packets' from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:inpreprocess'
from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in process' from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:inblock in loop'
from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in loop' from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:inloop'
from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:118:in close' from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/net-ssh-2.9.1/lib/net/ssh.rb:212:inensure in start'
from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/net-ssh-2.9.1/lib/net/ssh.rb:212:in start' from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/avodeploy-0.5/lib/avodeploy/task/local_task_execution_environment.rb:75:incopy_to_target'
from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/avodeploy-0.5/lib/avodeploy/strategy/local_copy.rb:96:in block (3 levels) in <top (required)>' from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/avodeploy-0.5/lib/avodeploy/strategy/local_copy.rb:95:ineach_pair'
from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/avodeploy-0.5/lib/avodeploy/strategy/local_copy.rb:95:in block (2 levels) in <top (required)>' from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/avodeploy-0.5/lib/avodeploy/task/task.rb:82:ininstance_eval'
from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/avodeploy-0.5/lib/avodeploy/task/task.rb:82:in invoke' from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/avodeploy-0.5/lib/avodeploy/task/task_manager.rb:201:ininvoke_task'
from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/avodeploy-0.5/lib/avodeploy/task/task_manager.rb:121:in block in invoke_task_chain_containing' from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/avodeploy-0.5/lib/avodeploy/task/task_manager.rb:120:ineach_pair'
from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/avodeploy-0.5/lib/avodeploy/task/task_manager.rb:120:in invoke_task_chain_containing' from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/avodeploy-0.5/bin/avo:49:instart'
from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command'
from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor.rb:359:in dispatch' from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/base.rb:440:instart'
from /home/david-lee/.rvm/gems/ruby-2.1.5/gems/avodeploy-0.5/bin/avo:132:in <top (required)>' from /home/david-lee/.rvm/gems/ruby-2.1.5/bin/avo:23:inload'
from /home/david-lee/.rvm/gems/ruby-2.1.5/bin/avo:23:in <main>' from /home/david-lee/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:ineval'
from /home/david-lee/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `

'

Git tags in deployment logfile

It would be nice to have the git tags in the deployment logfile to easier identify when a specific version was deployed.

Currently you only have the commit hashes in the deployment log and have to search for the corresponding tags yourself. As the git tags are already a cli param, this shouldn't be a big change

README Correction-Suggestion

"Avocado does currently only work if you use Git for as version control system and SSH to deploy. Furthermore, the only implemented authentication method for both SSH and Git is public key authentication."

It's also possible to use password-auth with ssh, if allowed serverside.

Web hook support

POST json metadata about the deployment to a configurable http endpoint.

remote cmd execution: target not specified

When a command is executed on a remote system, the only output is

I, [2014-11-13T18:31:28.036145 #8008]  INFO -- : Executing [rm /tmp/deploy.tar.gz] on remote 

The target should be specified to give a better overview of what's going on, like that:

I, [2014-11-13T18:31:28.036145 #8008]  INFO -- : Executing [rm /tmp/deploy.tar.gz] on web 

Crossplatform Highlighting for post-deploy Information

It would be nice to have a command to call which gives bold or colorful output for information- and warningmessages defined in Avofile. This would be better than a custom solution, because it could implement the outputformatting cross-platform.

Is:

 task :deployment_info, after: :log_deployment, scope: :local do
        command "echo 'after deployment, remember to do step X and clean cache Y'"
    end

Would be nice:

 task :deployment_info, after: :log_deployment, scope: :local do
        warningmessage "after deployment, remember to do step X and clean cache Y"
    end

or even better:
warningmessage "{red,bold}after deployment, remember to do step X and {yellow}clean cache Y"

:)

Tasks: Add file to deployment

When using a task e.g. for compiling scss, the resulting css files will not be uploaded when using the local_copy_partial strategy. It would be nice to have a function that lets you add specific files or folders to the deployment list.

Avo ignores files_ignore directive and also deploys .git and .gitignore too

Log:

I, [2015-01-21T09:55:25.940546 #4904]  INFO -- : checking ssh connection
I, [2015-01-21T09:55:25.940769 #4904]  INFO -- : Executing [command -v tar >/dev/null 2>&1 || exit 1;] locally
I, [2015-01-21T09:55:25.950068 #4904]  INFO -- : Executing [command -v git >/dev/null 2>&1 || exit 1;] locally
I, [2015-01-21T09:55:25.955607 #4904]  INFO -- : Executing [command -v awk >/dev/null 2>&1 || exit 1;] locally
I, [2015-01-21T09:55:25.959686 #4904]  INFO -- : Executing [command -v grep >/dev/null 2>&1 || exit 1;] locally
I, [2015-01-21T09:55:26.046839 #4904]  INFO -- : Executing [uname -a] on remote web
I, [2015-01-21T09:55:26.054017 #4904]  INFO -- : Executing [command -v tar >/dev/null 2>&1 || exit 1;] on remote web
I, [2015-01-21T09:55:26.058923 #4904]  INFO -- : Executing [mkdir .avocado-tmp/] locally
I, [2015-01-21T09:55:26.065286 #4904]  INFO -- : Executing [git clone [email protected]:xxx/shop.git working-copy] locally
I, [2015-01-21T09:55:31.737575 #4904]  INFO -- : Executing [git checkout 1.0] locally
I, [2015-01-21T09:55:32.050446 #4904]  INFO -- : Executing [git rev-parse HEAD] locally
I, [2015-01-21T09:55:32.055473 #4904]  INFO -- : Executing [echo 'f8cbcedbda923b50c734e57031fe8f57abceccb1' > REVISION] locally
I, [2015-01-21T09:55:32.060164 #4904]  INFO -- : Executing [mv config_production.dist.php config.php] locally
I, [2015-01-21T09:55:32.064756 #4904]  INFO -- : Executing [rm config_*.dist.php] locally
I, [2015-01-21T09:55:32.071290 #4904]  INFO -- : Executing [tar cfz ../deploy.tar.gz  --exclude='^Avofile$' --exclude='^.htaccess$' --exclude='^Vagrantfile$' --exclude='^_dist/$' --exclude='^log/$' --exclude='^config.php.dist$' --exclude='^.git$' --exclude='^.gitignore$' .] locally
I, [2015-01-21T09:55:36.930735 #4904]  INFO -- : started upload of file deploy.tar.gz to web
I, [2015-01-21T09:55:36.930938 #4904]  INFO -- : DBG: remote /tmp/deploy.tar.gz
I, [2015-01-21T09:55:42.580216 #4904]  INFO -- : upload completed
I, [2015-01-21T09:55:42.658566 #4904]  INFO -- : Executing [if [ ! -d '/mnt/data/shopware/' ]; then mkdir -p /mnt/data/shopware/; fi] on remote web
I, [2015-01-21T09:55:42.740470 #4904]  INFO -- : Executing [tar xvfz /tmp/deploy.tar.gz -C /mnt/data/shopware//] on remote web
I, [2015-01-21T09:55:52.149574 #4904]  INFO -- : Executing [cd /mnt/data/shopware/ && make clean install] on remote web
I, [2015-01-21T09:55:52.155889 #4904]  INFO -- : Executing [cd /mnt/data/shopware/cache/ && /bin/bash clear_cache.sh] on remote web
I, [2015-01-21T09:55:52.304094 #4904]  INFO -- : Executing [rm /tmp/deploy.tar.gz] on remote web
I, [2015-01-21T09:55:52.388085 #4904]  INFO -- : Executing [chown -R www-data:www-data /mnt/data/shopware] on remote web
I, [2015-01-21T09:55:52.442719 #4904]  INFO -- : Executing [rm -rf .avocado-tmp] locally
I, [2015-01-21T09:55:52.755992 #4904]  INFO -- : Executing [echo '[2015-01-21 09-55-52] revision f8cbcedbda923b50c734e57031fe8f57abceccb1 deployed by david-lee' >> /mnt/data/deploy.log] on remote web

Avofile, setup_stage

Currently says
setup_stage 'staging'

should be a symbol:
setup_stage :staging

Documentation Enhancement Taskorder Avofile

If you declare a task (task2) which gets executed "after: :task1" before task1 in Avofile a runtimerror is thrown, because when reading task-line it's not yet declared.

Sample throws runtime error. Fixed if you declare :copy_config first.

task :set_permissions, after: :copy_config...
...
end
task :copy_config, do
...
end

Version requirement in Avofile [Enhancement]

What about adding a configure var for Avoversion?
New Avofiles could contain something like "Avoversion_minimum: ", then you could check and make sure new config options are supported in this version yet.

Delete removed files on deployment

Currently, when files are deleted from the version control system, they still exist on the server after deployment. This may cause problems, so files removed from the vcs should also be removed on the server.

Git command for detecting the files removed between two revisions:

git diff --name-status 2038d4f18f0f3e39e8ce59274bf799795e9f3f9c 9a8fc699304123c10366ccbd8214ec8ba0400120 | grep "^D" | awk '{print $2}'

Task usability - chdir

You should not have to chdir to the working directory everytime. Instead this should be the default dir.

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.