gerhard / deliver Goto Github PK
View Code? Open in Web Editor NEWPure bash deployment tool with customisable strategies.
Pure bash deployment tool with customisable strategies.
Initialized empty Git repository in /home/dashboard/app/assets/_lib/d3/.git/
Host key verification failed.
fatal: The remote end hung up unexpectedly
If working in teams, it's important to keep your remote repo in sync when deploying releases. As deliver uses forced updates to push refs to the $HOSTS, it risks overwriting the target with an old working copy if the remote was not synced beforehand.
It would be useful to have an option such as $SYNC_REMOTE=origin which will perform a git pull, deliver, git push.
Alternatively, an option to exercise caution by checking your working copy is up to date with remote before a deliver is performed, because you don't always necessarily want deliver and automatically push code you've just pulled from the remote before you check it.
__remote()
uses ssh syntax, which will evaluate the entire quoted command with env sh
, which unfortunately on SmartOS is defined as ksh
. The side effect is input redirection fails. It would be nice if __remote could explicitly tell ssh to execute bash and then the command. Not sure how to do this.
Currently, ^C just stops right there, no message.
When delivering, it would be nice if we could notify Campfire of fail/success. We might want to track successful/failed deploys via Graphite, librato metrics or any other endpoint (be it HTTP or some random process listening on a port, locally or remotely).
I'm thinking something along the lines:
declare -f pre_init_app_remotely > /dev/null
if [ "$?" = 0 ]
then
pre_init_app_remotely
fi
This needs to be a generic function that checks all strategy functions.
time to tag v0.8.0?
Calista ➜ q git:(master) deliver check
APP q
APP_ROOT /Users/gerhard/code/q
STRATEGY ruby
APP_USER q
DELIVER_TO ~q/app
SERVERS
CAN'T DELIVER, WE'RE MISSING A FEW THINGS
Calista ➜ q git:(master) deliver -V
DELIVERING Q WITH RUBY STRATEGY
Q DELIVERED!
This is just a quick thought dump:
Should the launch() command be in common, and just use foreman start/status/stop?
Should the launch() command be factored out to common, and have a switch/case for each export format supported by foreman?
#!/usr/bin/env bash
APP="myapp"
BRANCH="node"
SERVERS="12.34.56.78"
PORT="2222"
STRATEGY="nodejs"
results in:
-----> Ensuring remote is ready to accept git pushes
ssh: connect to host 12.34.56.78 port 22: Connection refused
Why won't it go for the right port? or is there something I am misunderstanding?
If for some reason the server is restarted, will the upstart scripts automatically start on boot? And is there a reason why it's exported to /tmp rather than /etc/init? Thanks!
Handle SSH timeouts properly. Currently, if the SSH can't be executed, the script won't timeout.
The launch
task will not utilize APP_USER
. All the other tasks prior to launch
will ssh APP_USER@HOST
but launch
will ssh HOST
, causing it to use the local username by default..
I'll try to fix it, but my bash scripting is VERY rusty so I don't know how long it'll take me.
Installing through git clone
is ok, but I would greatly appreciate if we could install deliver through npm install
...
Think many small and self-contained ruby services (APIs? background workers?) in a single repository.
If I need to tweak the setup function from the nodejs strategy, I shouldn't need to create a custom strategy. Overloading specific strategy functions in the config file makes most sense in this scenario.
One thing I expect from deployment tool is ability to easily rollback to previous version in case of some failure (e.g. app deployed to production introduces bug and we want quickly revert to older, working version).
Does deliver
supports that?
-h|--help
Authorizing hosts happens in the background. Only one of the bg jobs accepts STDIN, the other one will wait indefinitely.
Authorize hosts in sequence, NOT in parallel.
Illumos support would be greatly appreciated, for those using SmartOS or the like. Modifications are required for launch
to check if `SUPERVISOR="smf", and use the following commands to check status, stop and start a service:
svcs: lists enabled services, even if they're not running. To see all services use 'svcs -a'
svcadm enable <foo>: start the service named <foo>
svcadm disable <foo>: stop the service named <foo>
svcadm restart <foo>: restart the service named <foo>
svcadm clear <foo>: if a service is in maintenance mode, this clears it so it can be enabled
svccfg export <foo>: shows the service manifest about what binary is being run and how
The real work will be in generating a service definition file, which is described here
Any interest in this?
If I need to tweak the setup function from the nodejs strategy, I shouldn't need to create a custom strategy. Overloading specific strategy functions in the config file would make the entire experience a lot neater.
When using a private npm module, sourced from bitbucket.org for example. Same for a ruby gem.
Currently, only the STRATEGY_VARS
& REQUIRED_VARS
are displayed.
Currently deliver only supports pushing master branches. As we're abstracting git push, we should be able to push any branch to the remote.
Both the ruby & nodejs strategies leverage foreman. Deliver is primarily used on Ubuntu with upstart, and this requires sudo privileges to start/stop upstart jobs.
The way I think this should work is to have a custom foreman upstart template which monitors files in the app itself and takes appropriate action. For example, touch tmp/restart-timeseries-api
triggers a restart of /etc/init/timeseries-api.conf
.
git_submodules()
needs to be able to handle:
https://github.com/user/repo
[email protected]:user/repo
git://github.com/user/repo
See the submodules-fix branch.
Just started testing, created config file and a strategy file for composer ... all is fine.
The question I have is how do we handle multiple environments (testing / staging / production)? I can't see anyway to do this other than to completely change the config file each time.
remote: error: refusing to update checked out branch: refs/heads/master
I can't push local master to nodejs01-myapp master, it says that it needs to be a bare repo for this to work.
I clearly wasn't in my best of naming moods. Deprecate SERVERS as of 0.7.0.
In my specific case, if -p
option is given an empty argument, foreman command fails silently (double-check this), and the upstart files are not generated. When the resulting conf files are meant to be moved into place, the command fails without an indication as to what exactly happened.
Think this was introduced in 9579a8c - when delivering using the generated
strategy, deliver will attempt to reset the remotes to the revision of the repo before the content was generated, which (as it's on a different branch) doesn't get pushed to the remotes, so fails with a fatal: Could not parse object: '123456...'
error.
Think gh-pages & ruby.
In a properly distributed service, the front-end servers are separate from the back-end ones. All static assets should be pushed to the front-end servers. This means nothing more than doing the same push as to the back-ends, the difference being that all app-related tasks need dropping. So no dependency installs (npm, gems etc.) & no app restarts.
The next step would be to allow assets to be pushed directly to CDNs. I'm thinking CloudFront to start with (possibly Rackspace Files).
I still need to understand how useful this really is with the new services such as Cloud Flare and Fastly.
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.