Wykres commitów

434 Commity (f97ba26631bb01fae4436ffbfb1ddd705057499a)

Autor SHA1 Wiadomość Data
Chris McCormick 85d8be87eb Support pushes to non-master branches. (#75) 2019-08-05 09:07:47 +01:00
Chris McCormick 3778088da7 Don't mangle stdout with header. (#67)
This fix allows you to usefully pipe things from the output of 'piku run' into other scripts.
For example you might pipe a request log into goaccess for analysis.
2019-07-22 13:53:24 +01:00
Rui Carmo b920c85c08
Update and rename raspbian-9.4-stretch.md to raspbian-9.4-stretch-10-buster.md 2019-07-21 16:22:44 +01:00
Rui Carmo cbc8211702
Update README.md 2019-07-21 15:37:55 +01:00
Chris McCormick fc0abee262 If nginx config test fails remove app nginx conf. (#62) 2019-07-14 17:12:43 +01:00
Rui Carmo 9ba6b5828d
Update README.md 2019-07-14 17:08:58 +01:00
Chris McCormick 6556706e4a Documentation and readme updates (#59)
* Updated README with first-timers in mind.

This patch adds information about how to use the  script. It also
re-orders the information in the README so that the most pertinent
information for somebody using it for the first time is at the top.

* Logo proposition.

* Possibly punchier tag line.

* Tagline spacing tweak.

* README fixes.

* Added a note about the examples folder.

* Incorporated @dwightmulcahy suggestion.
2019-07-13 16:30:25 +01:00
Chris McCormick dce587c053 Node improvements and versioning (#58)
* Fix node path insert to not clobber env.

* Tighter check on python venv for uwsgi conf.

* Install NODE_VERSION if nodeenv on PATH.

* Document NODE_VERSION setting.
2019-07-13 16:29:34 +01:00
dependabot[bot] 1b3e471342 Bump django from 2.1.9 to 2.1.10 in /examples/python-django (#57)
Bumps [django](https://github.com/django/django) from 2.1.9 to 2.1.10.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/2.1.9...2.1.10)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-09 11:16:11 +01:00
Chris McCormick 38aae8587b Added example for running wisp app. (#55) 2019-07-07 12:07:49 +01:00
Chris McCormick 9b9059c873 Add node_modules/.bin to node deploy path. (#54)
This change allows for npm installed binaries (such as wisp,
coffeescript, babel, etc.) to be used at deployment and run time.
2019-07-07 12:07:24 +01:00
Chris McCormick 19b301aaba Helper for running piku.py on configured remote. (#56)
This patch adds a little shell script called `piku`.

What it does is check for a git remote called `piku` and then uses that
remote to infer server & app name and SSH in to run piku.py.

Put it on your path and then from any piku configured local repo you can
do things like: `piku restart` and `piku destroy`.
2019-07-07 12:07:09 +01:00
Chris McCormick b5daedb5bc Move release worker to end of deploy. (#50)
* Move release worker to end of deploy.

This matches up with what other PaaS platforms do. This change also
makes the release worker inherit the environment (virtualenv etc.) from
the deploy process, making it easier to run e.g. Django manage.py
commands in the expected context without explicitly entering virtualenv
in the script.

* Update Django example to remove virtualenv.

Now that this happens automatically we don't need to explicitly enter
virtualenv in the script.

* Pass spawn env back through to release worker.

Conflicts:
	piku.py
2019-06-28 12:59:12 +01:00
Chris McCormick a4ded8c994 Nodejs example app (#52)
* Fix node deploy path handling.

This patch uses a temporary symlink to envs/APP/node_modules to force
node to install the modules into the right place even on older node
versions, like v4.2.6 which ships with Unbuntu 16.04.

Apps launching node servers will need to manually set
NODE_PATH="${VIRTUAL_ENV}/node_modules" to have it run correctly, and
in future we should consider setting this in spawn_app (though currently
spawn_app does not know what kind of app it's spawning).

* Add NODE_PATH to spawn env if node env present.

* Added nodejs websocket chat example app.
2019-06-28 12:58:36 +01:00
Chris McCormick e43b318d61 Fix node deploy path handling. (#49)
* Fix node deploy path handling.

This patch uses a temporary symlink to envs/APP/node_modules to force
node to install the modules into the right place even on older node
versions, like v4.2.6 which ships with Unbuntu 16.04.

Apps launching node servers will need to manually set
NODE_PATH="${VIRTUAL_ENV}/node_modules" to have it run correctly, and
in future we should consider setting this in spawn_app (though currently
spawn_app does not know what kind of app it's spawning).

* Add NODE_PATH to spawn env if node env present.
2019-06-28 12:56:37 +01:00
Chris McCormick d26fb6ee1c Clean up acme certs on destroy. (#51)
This will prevent the acme.sh cron job from continuing to request
certificates for apps which have been destroyed.
2019-06-28 12:55:34 +01:00
Chris McCormick 3ce615ec7a No virtualenv in uwsgi config if missing. (#48)
This patch skips adding the 'virtualenv' setting to the uwsgi config if
the project does not have a valid virtualenv.

This allows nodejs projects to run under the 'web' worker correct.
Presumably Go projects will be similarly hampered without this patch.
2019-06-27 07:42:54 +01:00
Chris McCormick 2c1b70b1b9 Ignore removed workers in SCALING file. (#47)
If a worker has been removed from the Procfile it may still have an
entry in the SCALING file on the server which causes a traceback when
the removed worker is attempted to be spawned. With this patch piku
ignores SCALING file entries which do not have a corresponding worker
defined in Procfile.
2019-06-27 07:41:22 +01:00
Chris McCormick 02c9017db9 Generate self-signed cert if acme fails. (#46)
Under certain conditions the acme cert generation will fail and create a
zero-byte certificate. Nginx does not like this so in that case piku.py
will generate a self-signed cert as a fallback with this patch.
2019-06-27 07:41:07 +01:00
Chris McCormick 8c835b28ad Improved AUTO_RESTART to prevent 2x uwsgi bounce. (#45)
The previous implementation of the AUTO_RESTART setting was causing
uwsgi have two separate configs installed one after the other very
quickly, which was causing issues.

This change fixes that by deleting the 'enabled' uwsgi config just
before re-generating it if AUTO_RESTART is true. This has the same basic
effect (reload on change) without the double-triggering of uwsgi reload.
2019-06-27 07:40:52 +01:00
Rui Carmo 8962fa9523
Better Cloudflare API error handling 2019-06-25 11:46:55 +01:00
Chris McCormick 9c913a8d5f Example Django app deployment with Piku. (#43)
This change requires PRs #38 #39 #41 to work properly.
2019-06-23 15:50:24 +01:00
Chris McCormick 8ca63c60de Release worker: provide full env + remove worker. (#39)
* Release worker: provide full env + remove worker.

This change improves the release task pseudo-worker.

 * Provides the full environment (both app env and config env) to the
   release task.

 * Uses a non-zero return value to bail early if release
   phase fails.

* Make ENV_ROOT (venv) accessible to release scripts.
2019-06-23 15:48:47 +01:00
Chris McCormick a9b58917b4 RFC: letsencrypt SSL certificate support (#38)
* Add Let's Encrypt SSL cert support.

This patch has piku use the acme.sh script to request and maintain Let's
Encrypt SSL certs rather than generate self-signed certs.  For it to
work you must install acme.sh as the user piku.  Installation
instructions here: https://github.com/Neilpang/acme.sh#1-how-to-install
The next commit updates piku-bootstrap to install acme.sh by default.

If acme.sh is not installed piku continues to default to a self-signed
certificate.

* Install acme.sh SSL cert wrangler in bootstrap.

The previous commit contains details about usage.
2019-06-23 15:47:58 +01:00
Chris McCormick 0a1dc6cf13 Fix static paths by switching to expandvars(). (#41)
This fixes #40.
2019-06-23 15:44:57 +01:00
Chris McCormick 2e3c56c891 piku-bootstrap script for provisioning a server with piku.py (#23)
* Bootstrap script initial working version.

* Bootstrap: more verbose messaging.

* Bootstrap: working up to piku over SSH.

* Bootstrap: full bootstrap minus nginx.

* Bootstrap: ensure py2 for Ansible.

* Bootstrap: more deps.

* Bootstrap: piku user Ansible tmp to avoid err.

* Bootstrap: local venv source in ~/.piku-bootstrap

* Bootstrap: nginx + incron install.

* Bootstrap: self-install logging and less verbose.

* Bootstrap: special permissions for --pi mode.

* Improved usage + self-install text.
2019-06-20 15:05:45 +01:00
Chris McCormick e424f3d7b5 Alias NGINX_HTTPS_ONLY and add doc. (#28) 2019-06-20 15:05:18 +01:00
Chris McCormick bccf3814a8 Warning should be in yellow. (#32) 2019-06-20 15:03:57 +01:00
Chris McCormick fb39bd8974 User can specify release command in Procfile. (#33)
Allows the user to run arbitrary release commands (such as running Django collectstatic and/or migrations). The 'release' command runs before workers are spawned.
Kind of works like this: https://devcenter.heroku.com/articles/release-phase
2019-06-20 15:03:16 +01:00
Chris McCormick 1d85c5adba Option to auto-restart after push. (#34)
This runs the 'restart' command after pushing if AUTO_RESTART is set in ENV. This addresses the concern raised in #27 and allows the user to optionally push-and-forget similar to other PaaS systems.
2019-06-20 15:02:11 +01:00
Chris McCormick 461af9f174 Allow `git push -f` to piku. (#35)
Before this change if you tried to `git push -f` it broke the update.
Git would output an error saying branches have diverged.
With this change piku basically assumes whatever you pushed into
origin/master is the thing you actually want to deploy, and uses that.
(even if it's a commit --amend or a reset to some previous point in
history etc.)
2019-06-20 15:01:37 +01:00
Chris McCormick 0ef930f57d Check out git submodules. (#36)
Git submodules can be a convenient way of including some 3rd party dependency/repo in your app. With this change piku automatically checks out any submodules included in the repository.
2019-06-20 14:59:38 +01:00
Chris McCormick c8328a3d93 Nit: typo. (#29) 2019-05-26 13:54:28 +01:00
Rui Carmo a14519e8e3
Update README.md 2019-05-22 19:26:15 +01:00
Rui Carmo cad8f4744b URL 2019-05-22 19:22:38 +01:00
Rui Carmo 190dc00019 tidy 2019-05-22 19:19:32 +01:00
Rui Carmo 9253b21e0f SVG demo 2019-05-22 19:19:08 +01:00
Rui Carmo 8350a6b883
Added demo 2019-05-22 19:11:10 +01:00
Rui Carmo 601bfa32f8
Update README.md 2019-05-22 18:52:42 +01:00
Rui Carmo 8307dafa86
Missed a spot 2019-05-22 13:37:18 +01:00
Rui Carmo 4e3653110c
Update README.md 2019-05-22 13:29:06 +01:00
Rui Carmo bc78418d26
Update piku.py 2019-05-22 13:27:42 +01:00
Rui Carmo d339966247
Shorter descriptions
As per roadmap, this will eventually be revisited for better help and documentation
2019-05-22 13:24:30 +01:00
Rui Carmo b17e5af4ea
Shorter help 2019-05-22 13:20:10 +01:00
Rui Carmo 99a176d9a1
Fixes #21
Also adds a few more examples.
2019-05-22 13:13:30 +01:00
Rui Carmo be0bd232f6 added clock worker 2019-05-21 22:31:19 +01:00
Rui Carmo 3f80e00aaa confirms that #20 actually works and tests #19 2019-05-21 22:27:44 +01:00
Rui Carmo 99724bd890 Merge branch 'master' of github.com:rcarmo/piku 2019-05-21 21:21:14 +01:00
Rui Carmo 526f6284dd
Update README.md 2019-04-17 13:13:08 +01:00
Rui Carmo f10f4c3835 pylint 2018-12-23 15:32:46 +00:00