Package: gopythongo
GoPythonGo creates Python deployment artifacts==============================================You can go to many conferences and watch many talks on Youtube about Python deployment and they invariablyinclude a slide with a diagram that looks something like this:Developer -push-> GitHub/GitLab/BitBucket -webhook-> SomeBuildServer -magic-> Fabulous cloud stuffGoPythonGo is a opinionated, extensible, well-structured and highly configurable implementation of the arrowthat says "magic".GoPythonGo is built around 4 ideas:1. Python applications should always be run from a virtual environment.2. Builds should be as fast as possible, so Python Wheels should be used and should be cached.3. Applications should be deployed using manageable binary artifacts, like DEBs, RPMs or Docker containers and itshould be easy to switch between their type.4. The binary artifacts should be as small as possible.**This is still under very active development.** Currently you can use it to build .deb packages to deploy virtualenvironments using Apt. It will use pbuilder or Docker to do so, it can auto-increment your version strings or integratewith other tools that do that, it can integrate with aptly to publish your packages to your server or Amazon S3. Itincludes tools to integrate with Hashicorp Vault for secure package signing using GPG and implementing build serverSSL credential management. BUT, it's still changing all the time. That said, GoPythonGo is used to distributeGoPythonGo, so there.Basic philosophy----------------GoPythonGo is built to allow you to put build configuration where it makes the most sense. In practice, this meansthat the command-line tool takes it's parameters from three sources: a configuration file, environment variables andcommand-line parameters. This way, keep the configuration for *how to build* with your code in a checked-in configfile, but the configuration for *assembling* your build on your build server server in environment variables or onthe command-line or a second configuration file that will be merged.Getting started---------------On Debian:1. Install the GoPythonGo and Aptly distribution keysapt-key adv --keyserver hkp://keys.gnupg.net --recv-key DDB131CF1DF6A9CF8200799002CBD940A78049AFapt-key adv --keyserver keys.gnupg.net --recv-keys 9E3E53F19C7DE4602. Install GoPythonGo, [aptly](https://aptly.info), pbuilder and fpm. As `root`:echo "deb http://repo.gopythongo.com/nightly/stretch gopythongo main" > /etc/apt/sources.list.d/gopythongo.listecho "deb http://repo.aptly.info/ squeeze main" > /etc/apt/sources.list.d/aptly.listapt-get updateapt-get --no-install-recommends install gopythongo aptly pbuilder ruby ruby-devgem install fpm3. create a simple example project:mkdir -p /tmp/helloworld/helloworldcat > /tmp/helloworld/helloworld/__init__.py <<EOF# -* encoding: utf-8 *-def main():print("hello world!")if __name__ == "__main__":main()EOFcat > /tmp/helloworld/setup.py <<EOF#!/usr/bin/env python -uimport osfrom setuptools import setupsetup(name='helloworld',version="1.0",packages=["helloworld",],entry_points={"console_scripts": ["helloworld = helloworld:main"],},)EOF4. Create a GoPythonGo configuration:cd /tmp/helloworld/opt/gopythongo/bin/gopythongo --init pbuilder_debsed -e 's/mypackage/helloworld/g' .gopythongo/config > .gopythongo/config.1mv .gopythongo/config.1 .gopythongo/configsed -e 's/PACKAGENAME/helloworld/g' .gopythongo/fpm_opts > .gopythongo/fpm_opts.1mv .gopythongo/fpm_opts.1 .gopythongo/fpm_opts5. Create a Debian repository managed by aptlyaptly repo create helloworld6. Build the helloworld package (-v enables verbose output):/opt/gopythongo/bin/gopythongo -v /opt/helloworld /tmp/helloworld7. You know what? Build it again and watch how the version number changes as GoPythonGo appends a revision number!Also, the second build will go much faster now that the initial setup is out of the way.8. Now install your creationdpkg -i helloworld_1.0~dev1-1.deb9. And run it:/opt/helloworld/bin/helloworld10. Go party!Examples--------[Authserver](https://github.com/jdelic/authserver/) is a full project that I'm building using gopythongo. Just look inthe .gopythongo folder and its README.Next steps----------If you create an aptly configuration file, you can use GoPythonGo to sign and push the package to, for example,Amazon S3. Just look at GoPythonGo's own `.gopythongo` folder for examples. You should also have a look at the outputof `--debug-config` to see how GoPythonGo loads configuration from the different sources (config file, environmentvariables and command-line parameters).Future features---------------* Potentially add an additional class of plug-ins "composers" which execute even before the creation of thebuild environment to prepare the source tree for building. These might do things like: clean up temp files,request/download/install stuff or clone submodules.* Add Docker Store support to build, tag and upload Docker containers* Create integration and unittests* Add RPM and createrepo supportLicense=======GoPythonGo, meaning:1. It's source code as published on https://github.com/gopythongo/gopythongo2. It's documentation as published on https://github.com/gopythongo/gopythongois wholly subject to the Mozilla Public License v. 2.0 as published by the Mozilla Foundation and included with thissource code in the file "LICENSE". You can also find a copy of the full license athttps://www.mozilla.org/en-US/MPL/2.0/.```"Grant of license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