{ "info": { "author": "Jose Riguera Lopez", "author_email": "jose.riguera@springernature.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: System :: Systems Administration" ], "description": "# ee-snpaas-cli\n\nSNPaaS Command line program is based on Docker. This command is just a Python\nwrapper for docker to execute:\n\n```\ndocker run --rm -v $(pwd):/data -it platformengineering/snpaas-tools \"${@}\"\n```\n\nPIP makes it easy to distribute as client for everybody. All the important things\nare done within the container.\n\nPotentially it should run on Windows by installing Docker client command line\nand delegating the execution to a box with docker daemon running (by defining\nthe proper environment variables), for example: the bastion host.\n\nEnvironment variables for this program:\n\n* `SNPAAS_DOCKER_IMAGE`: Docker image to launch. Default is `platformengineering/snpaas-tools:latest`.\n* `SNPAAS_SUPPRESS_INFO_REGEX`: Default is `^# `. Regular expression to remove the motd generated by the image when it runs the .envrc file of the current folder.\n* `SNPAAS_EXTRA_ENV`: Define extra variables to get exported inside the running container, plus the default ones defined above.\n\n\nThe script does not have any requirements, it should run on all platforms where\nPython (2.7-3.x) and Docker-cli are available. In Windows, it should be possible\nto delegate the execution of the Docker to a 3rd party server by setting the\nproper environment variables.\n\n\n# Docker development\n\nThe `docker` folder have all the sources to create the Docker container.\nCreating and publishing the container is done with the script `publish-dockers-dockerhub.sh`\nwhich takes all folders (they must have a `Dockerfile`) and creates a Docker image\nwith the name of each folder. Once the image is created is automatically pushed\nto dockerhub.com using *platformengineering* account. You have to be loged in\nwith `docker login` in other to publish the Image.\n\n* **Images are public available. DO NOT INCLUDE SECRETS THERE**\n* **Images are public available. DO NOT INCLUDE SECRETS THERE**\n* **Images are public available. DO NOT INCLUDE SECRETS THERE**\n* **Images are public available. DO NOT INCLUDE SECRETS THERE**\n* **Images are public available. DO NOT INCLUDE SECRETS THERE**\n* **Images are public available. DO NOT INCLUDE SECRETS THERE**\n* **Images are public available. DO NOT INCLUDE SECRETS THERE**\n* **Images are public available. DO NOT INCLUDE SECRETS THERE**\n* **Images are public available. DO NOT INCLUDE SECRETS THERE**\n* **Images are public available. DO NOT INCLUDE SECRETS THERE**\n* **Images are public available. DO NOT INCLUDE SECRETS THERE**\n* **Images are public available. DO NOT INCLUDE SECRETS THERE**\n* **Images are public available. DO NOT INCLUDE SECRETS THERE**\n\nIf you include them, your next task will be rotate all secrets everywhere!, without rest!\nAnyway, **if you include secrets, you are doing something wrong. Docker images are not created to store secrets!**\n\n\n## Upload to PyPI\n\n1. Create a `.pypirc` configuration file. This file holds your information for authenticating with PyPI.\n\n ```\n [distutils]\n index-servers = pypi\n \n [pypi]\n repository=https://pypi.python.org/pypi\n username=your_username\n password=your_password\n ```\n2. Login and upload it to PyPI\n\n ```\n python setup.py register -r pypi\n python setup.py sdist upload -r pypi\n ```\n\n\n## How this thing works?\n\n1. `Dockerfile` includes all software (with specific versions).\n2. Docker reads the `ENTRYPOINT [\"/bin/bash\", \"/run.sh\"]`, which will be always executed.\n3. Docker will make available the current folder to the running container inside `/data`, all programs and scripts will be executed there.\n4. The `run.sh` script reads the `.envrc` files and presents the usage (help) if needed.\n5. Depending on the first argument, it will execute a command like `bosh`, `credhub` ... or it will run `manage-deployment.sh` script\n\n\nThe script `manage-deployment.sh` parses all the folder structure and runs the commands to manage a deployment. It is very verbose and always shows what it is doing, with colors, you can replicate everything copying the blue commands.\n\n\n# Usage\n\nYou can install it by running `setup.py`:\n```\n$ python setup.py install\n```\n\nor using `pip`:\n\n```\n$ pip install snpaas-cli\n```\n\nAlso, you can copy and run it directly by calling the program \n`snpaas.py` instead of `snpaas`.\n\n\nOnce it is installed, type `snpaas`\n\n```\n$ snpaas\n\n*** Docker image: platformengineering/snpaas-tools ***\n\nThis docker image packages the tools SNPaaS team is using to \nmanage the deployments. It includes clients for cf, bosh, credhub ...\n\n\n# Usage\n\nYou can execute them directly. In the current folder you can define a '.envrc' file\nwith all environment variables you want to be setup in the running container.\nIf you do not have a '.envrc' file but you have the following environment variables\nin your environment, then Bosh-cli and Credhub-cli will automatically log-in: \n\n \"BOSH_CLIENT\"\n \"BOSH_CLIENT_SECRET\"\n \"BOSH_ENVIRONMENT\"\n \"BOSH_CA_CERT\"\n \"CREDHUB_SERVER\"\n \"CREDHUB_CLIENT\"\n \"CREDHUB_SECRET\"\n \"CREDHUB_CA_CERT\"\n \"GCP_PROJECT\"\n \"GCP_ZONE\"\n \"GCP_REGION\"\n\nThen you are ready to manage to manage deployments, with this subcommands and options:\n\n [options]\n\nOptions:\n -m Specify a manifest file, instead of generating a random one\n -p Deployments path. Default is \n -h Shows usage help\n\nSubcommands:\n help Shows usage help\n interpolate Create the manifest for an environment\n deploy [-f] Update or upgrade deployment after applying cloud/runtime configs\n destroy [-f] Delete deployment (does not delete cloud/runtime configs)\n cloud-config Apply cloud-config operations files from Director cloud-config\n runtime-config Apply runtime-config operations files from Director runtime-config\n import-secrets Set secrets in Credhub from / file\n list-secrets List secrets from Credhub for \n export-secrets Download secrets from Credhub to /\n\n\n# Folder structure:\n\n\n\u251c\u2500\u2500 \n\u251c\u2500\u2500 base.yml -> /manifest/logstash.yml\n\u251c\u2500\u2500 operations\n\u2502 \u251c\u2500\u2500 10-operation.yml -> ..//manifest/operations/operation.yml\n\u2502 \u251c\u2500\u2500 20-operation2.yml -> ..//manifest/operations/operation2.yml\n\u2502 \u251c\u2500\u2500 99-springer-nature-operation-custom.yml\n\u251c\u2500\u2500 secrets.yml\n\u251c\u2500\u2500 cloud-config\n\u251c\u2500\u2500 runtime-config\n\u2514\u2500\u2500 variables\n \u251c\u2500\u2500 variables-custom1.yml\n \u251c\u2500\u2500 variables-custom1.yml\n \u2514\u2500\u2500 variables-provided.yml -> ..//manifest/vars.yml\n\n\nCredhub secrets have to be type 'value' and they will be imported/exported inside a\n'secrets.yml' file, which, in case it exits, the script will read.\n\n\n# Usage examples\n\nGiven a deployment folder called 'app-logging' with this structure:\n\napp-logging\n\u251c\u2500\u2500 logstash.yml -> cf-logging-boshrelease/manifest/logstash.yml\n\u251c\u2500\u2500 operations\n\u2502 \u251c\u2500\u2500 20-cf-apps-es.yml -> ../cf-logging-boshrelease/manifest/operations/pipelines/cf-apps-es-throttling.yml\n\u2502 \u251c\u2500\u2500 25-add-statsd-conf.yml -> ../cf-logging-boshrelease/manifest/operations/add-statsd-conf.yml\n\u2502 \u251c\u2500\u2500 30-add-throttle-param.yml -> ../cf-logging-boshrelease/manifest/operations/add-throttle-param.yml\n\u2502 \u251c\u2500\u2500 50-add-es-cloud-id.yml -> ../cf-logging-boshrelease/manifest/operations/add-es-cloud-id.yml\n\u2502 \u251c\u2500\u2500 50-add-es-xpack.yml -> ../cf-logging-boshrelease/manifest/operations/add-es-xpack.yml\n\u2502 \u251c\u2500\u2500 80-add-logstash-exporter.yml -> ../cf-logging-boshrelease/manifest/operations/add-logstash-exporter.yml\n\u2502 \u251c\u2500\u2500 90-add-release-version.yml -> ../cf-logging-boshrelease/manifest/operations/add-release-version.yml\n\u2502 \u251c\u2500\u2500 99-deployment-settings.yml\n\u2502 \u2514\u2500\u2500 99-iaas.yml -> ../cf-logging-boshrelease/manifest/operations/add-iaas-parameters.yml\n\u251c\u2500\u2500 secrets.yml\n\u2514\u2500\u2500 variables\n \u251c\u2500\u2500 iaas.yml\n \u251c\u2500\u2500 throttle-param.yml\n \u2514\u2500\u2500 vars-release-version.yml -> ../cf-logging-boshrelease/manifest/vars-release-version.yml\n\n\n* To deploy or update the deployment called 'app-logging', execute: 'deploy app-logging'.\n If you do not want to answer 'y/n' question when bosh runs, just use '-f' option:\n 'deploy app-logging -f'\n* To list secrets of the deployment from Credhub: 'list-secrets app-logging'\n* Exporting the secrets of the deployment from Credhub to file 'app-logging/secrets.yml'\n is done with: 'export-secrets app-logging'. Only credentials type value are supported.\n* Import the secrets of the deployment to Credhub from a file 'app-logging/secrets.yml':\n 'import-secrets app-logging'. All credentials will be imported as type value.\n* In order to apply the name of the folder to the deployment, you need to provide\n an operations file with this operation.\n \n - type: replace\n path: /name\n value: ((deployment_name))\n\n The variable 'deployment_name' is provided by the program and taken from the\n folder name\n\n# Why?\n\n* Avoid writting documentation about each deployment. Each folder has a specific\n structure, the script only goes through the folder structure and generates\n and applies the operations to the base manifest.\n* Make it easy to manage bosh deployments. If the deployment folder is properly\n done, replicating it for testing purposes is as easy as clonning the folder\n and deploy again.\n* Easily manage Credhub secrets in a deployment. One can import, export and\n list secrets from files to Credhub (Only secrets type value, the other ones \n are managed via the 'variables' section in a manifest!).\n* Show you the commands it runs each time, with colorized output in order to\n stand out if something went wrong.\n* Loose coupled. The sript is a wrapper for Bosh and Credhub clients. If you do\n not like the script, you do not have to use it. The folder structure is \n self-documented, so you only need to build the bosh and credhub parameters\n from these files.\n\n\n# Programs and versions installed\n\nAdditionally you can directly execute all the following programs installed, just\nby typing then as argument.\n\n SPIFF: 1.0.8\n CREDHUB: 1.7.7\n GCLOUD_SDK: 220.0.0\n CF_CLI: 6.40.0\n BOSH_CLI: 5.2.1\n CERTSTRAP: 1.1.1\n JQ: 1.5\n BBR: 1.2.2\n SPRUCE: 1.18.0\n TERRAFORM: 0.11.8\n FLY: 3.14.1\n```\n\n\n# Author\n\nSpringer Nature Engineering Enablement (EE), Jose Riguera Lopez (jose.riguera@springer.com)\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/springernature/ee-snpaas-cli/releases/tag/v0.1.4", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/springernature/ee-snpaas-cli", "keywords": "snpaas cf bosh credhub manage deployments", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "snpaas-cli", "package_url": "https://pypi.org/project/snpaas-cli/", "platform": "", "project_url": "https://pypi.org/project/snpaas-cli/", "project_urls": { "Download": "https://github.com/springernature/ee-snpaas-cli/releases/tag/v0.1.4", "Homepage": "https://github.com/springernature/ee-snpaas-cli" }, "release_url": "https://pypi.org/project/snpaas-cli/0.1.4/", "requires_dist": null, "requires_python": "", "summary": "Manage SNPaaS", "version": "0.1.4" }, "last_serial": 4402007, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "36023112589f5526f9028d83d359656e", "sha256": "6bbd0dcf7d4cd4e9ac37da79812ecb7f3b0ee33394c47405dbcd5057f9cb67ec" }, "downloads": -1, "filename": "snpaas-cli-0.1.0.tar.gz", "has_sig": false, "md5_digest": "36023112589f5526f9028d83d359656e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9283, "upload_time": "2018-10-18T21:02:25", "url": "https://files.pythonhosted.org/packages/47/1f/e69fa096afbdfa85ccf9a7c228724b09e89acf3bd5b514bc63b00c9356ff/snpaas-cli-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "e5f120978f089de65a8cd305e5f544cb", "sha256": "bfd1c9f04510a31e1b6afe30f3bcf5541de3efe22b59ee39e3dc4c4684315fde" }, "downloads": -1, "filename": "snpaas-cli-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e5f120978f089de65a8cd305e5f544cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9129, "upload_time": "2018-10-19T08:32:05", "url": "https://files.pythonhosted.org/packages/20/ae/36320a19a0419a4a6ca2b72db8c7da8bcba0629e0fd43e0f1df827118c56/snpaas-cli-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "3555ef3ca64f4c00079197c3e17ed03c", "sha256": "eff5689256cc2a834ed45bfa3b5cd4ff020bc43293b6e496459ebabf9489d08a" }, "downloads": -1, "filename": "snpaas-cli-0.1.2.tar.gz", "has_sig": false, "md5_digest": "3555ef3ca64f4c00079197c3e17ed03c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9204, "upload_time": "2018-10-19T12:12:51", "url": "https://files.pythonhosted.org/packages/c4/05/82a56b43c6d07a211ee4a8073cae8eddea5572cbfc6ca9bc26cb227179f4/snpaas-cli-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "5c11adaae6c9b116d4455ec18089bc9b", "sha256": "917d39653d21425d84c77c56d389b311feacd5d71a5d8c37d92e4cca9701331e" }, "downloads": -1, "filename": "snpaas-cli-0.1.3.tar.gz", "has_sig": false, "md5_digest": "5c11adaae6c9b116d4455ec18089bc9b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9604, "upload_time": "2018-10-22T11:33:13", "url": "https://files.pythonhosted.org/packages/d1/2f/22549a246cb913ab25e72264ffe126e88ecf9209231365d170677eebcb06/snpaas-cli-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "8d8c41bbeae3168fb8a02913d9c6817f", "sha256": "4b256b5b6fe6b32c707158ddd1346c85bd5c63230f3f72856fa372875a663860" }, "downloads": -1, "filename": "snpaas-cli-0.1.4.tar.gz", "has_sig": false, "md5_digest": "8d8c41bbeae3168fb8a02913d9c6817f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9602, "upload_time": "2018-10-22T11:49:52", "url": "https://files.pythonhosted.org/packages/ba/20/252910efffea37b8ee2987dc95926fc0e5ede6d9502ebd8581bf83721e9c/snpaas-cli-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8d8c41bbeae3168fb8a02913d9c6817f", "sha256": "4b256b5b6fe6b32c707158ddd1346c85bd5c63230f3f72856fa372875a663860" }, "downloads": -1, "filename": "snpaas-cli-0.1.4.tar.gz", "has_sig": false, "md5_digest": "8d8c41bbeae3168fb8a02913d9c6817f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9602, "upload_time": "2018-10-22T11:49:52", "url": "https://files.pythonhosted.org/packages/ba/20/252910efffea37b8ee2987dc95926fc0e5ede6d9502ebd8581bf83721e9c/snpaas-cli-0.1.4.tar.gz" } ] }