Code to implement staging in Fabric and recipes for using that staging for pelican deployments and Django to Heroku.
Project description
# fab_support
.. image:: https://img.shields.io/pypi/v/fab_support.svg
:target: https://pypi.python.org/pypi/fab_support
.. image:: https://img.shields.io/travis/drummonds/fab_support.svg
:target: https://travis-ci.org/drummonds/fab_support
.. image:: https://readthedocs.org/projects/fab-support/badge/?version=latest
:target: https://fab-support.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://pyup.io/repos/github/drummonds/fab_support/shield.svg
:target: https://pyup.io/repos/github/drummonds/fab_support/
:alt: Updates
Code to implement staging in Fabric and recipes for using that staging for pelican deployments and Django to Heroku.
It supports a local .env file importing for storing secrets that you don't want to store in git.
In the root fabfile create a dictionary like this which documents how to deploy each stage
STAGES = {
'localhost': {
'comment': 'Local build and serving from output directory',
'destination': '',
'copy_method': copy_null,
},
'harddisk': {
'comment': 'For serving locally on this computer in another directory. ',
'destination': 'C:/Sites/www.drummond.info',
'copy_method': copy_file,
},
'production': {
'destination': 'W:/www.drummond.info',
'copy_method': copy_file,
},
}
## Stages
I have create a fab-support.py which does the heavy lifting. In the root fabfile create a dictionary like this which
documents how to deploy each stage:
```python
# Definition of different environments to deploy to
set_stages (globals(), {
'localsite': {
'comment': 'stage: For serving locally on this computer via mongoose. ',
'config_file': 'local_conf.py',
'destination': 'C:/Sites/local.drummond.info',
'copy_method': copy_file,
'SITEURL': 'http://localhost:8042',
},
'production': {
'comment': 'stage: For serving on local file server',
'destination': '//10.0.0.1/web/www.drummond.info',
'config_file': 'local_conf.py',
'copy_method': copy_file,
'SITEURL': 'http://www.drummond.info',
},
})
```
Then the deployment by Pelican is pretty standardised eg build deploy and you have commands such as:
`fab localsite deploy`
I think it was inspired by [Breyten Ernsting]. I copied the idea and then elaborated.
[Breyten Ernsting]: http://yerb.net/blog/2014/03/03/multiple-environments-for-deployment-using-fabric/
* Free software: MIT license
* Documentation: https://fab-support.readthedocs.io.
## Features
--------
* TODO
## Credits
---------
This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template. Thanks Audrey
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
=======
History
=======
0.1.0 (2018-02-04)
------------------
* First release on PyPI.
.. image:: https://img.shields.io/pypi/v/fab_support.svg
:target: https://pypi.python.org/pypi/fab_support
.. image:: https://img.shields.io/travis/drummonds/fab_support.svg
:target: https://travis-ci.org/drummonds/fab_support
.. image:: https://readthedocs.org/projects/fab-support/badge/?version=latest
:target: https://fab-support.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://pyup.io/repos/github/drummonds/fab_support/shield.svg
:target: https://pyup.io/repos/github/drummonds/fab_support/
:alt: Updates
Code to implement staging in Fabric and recipes for using that staging for pelican deployments and Django to Heroku.
It supports a local .env file importing for storing secrets that you don't want to store in git.
In the root fabfile create a dictionary like this which documents how to deploy each stage
STAGES = {
'localhost': {
'comment': 'Local build and serving from output directory',
'destination': '',
'copy_method': copy_null,
},
'harddisk': {
'comment': 'For serving locally on this computer in another directory. ',
'destination': 'C:/Sites/www.drummond.info',
'copy_method': copy_file,
},
'production': {
'destination': 'W:/www.drummond.info',
'copy_method': copy_file,
},
}
## Stages
I have create a fab-support.py which does the heavy lifting. In the root fabfile create a dictionary like this which
documents how to deploy each stage:
```python
# Definition of different environments to deploy to
set_stages (globals(), {
'localsite': {
'comment': 'stage: For serving locally on this computer via mongoose. ',
'config_file': 'local_conf.py',
'destination': 'C:/Sites/local.drummond.info',
'copy_method': copy_file,
'SITEURL': 'http://localhost:8042',
},
'production': {
'comment': 'stage: For serving on local file server',
'destination': '//10.0.0.1/web/www.drummond.info',
'config_file': 'local_conf.py',
'copy_method': copy_file,
'SITEURL': 'http://www.drummond.info',
},
})
```
Then the deployment by Pelican is pretty standardised eg build deploy and you have commands such as:
`fab localsite deploy`
I think it was inspired by [Breyten Ernsting]. I copied the idea and then elaborated.
[Breyten Ernsting]: http://yerb.net/blog/2014/03/03/multiple-environments-for-deployment-using-fabric/
* Free software: MIT license
* Documentation: https://fab-support.readthedocs.io.
## Features
--------
* TODO
## Credits
---------
This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template. Thanks Audrey
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
=======
History
=======
0.1.0 (2018-02-04)
------------------
* First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fab_support-0.0.3.tar.gz
(38.0 kB
view hashes)
Built Distribution
Close
Hashes for fab_support-0.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f6ab3576d05a20080b37c0604df2588ee99c223d104664517cb325856fbb6e9 |
|
MD5 | 2e4a73c2102bb6363ef4d642b7d26374 |
|
BLAKE2b-256 | 62a7c311fa0a8fe18250f9f62f99417d60c822832d03f14b2bb503aacfc3e5a4 |