{"id":22908835,"url":"https://github.com/ipunkt/rancherize","last_synced_at":"2025-08-12T07:32:50.300Z","repository":{"id":56993264,"uuid":"60269438","full_name":"ipunkt/rancherize","owner":"ipunkt","description":"Rancherize your development workflow","archived":false,"fork":false,"pushed_at":"2020-04-08T08:46:19.000Z","size":1004,"stargazers_count":6,"open_issues_count":10,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-14T21:36:20.205Z","etag":null,"topics":["continuous-deployment","continuous-integration","deployment","docker","rancher","rancher-environment","rancher-server","setup-wizard"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipunkt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-02T14:10:05.000Z","updated_at":"2020-09-04T04:55:09.000Z","dependencies_parsed_at":"2022-08-21T10:10:50.211Z","dependency_job_id":null,"html_url":"https://github.com/ipunkt/rancherize","commit_stats":null,"previous_names":[],"tags_count":181,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipunkt%2Francherize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipunkt%2Francherize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipunkt%2Francherize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipunkt%2Francherize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipunkt","download_url":"https://codeload.github.com/ipunkt/rancherize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229654645,"owners_count":18103411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["continuous-deployment","continuous-integration","deployment","docker","rancher","rancher-environment","rancher-server","setup-wizard"],"created_at":"2024-12-14T03:32:30.443Z","updated_at":"2024-12-14T03:32:31.667Z","avatar_url":"https://github.com/ipunkt.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rancherize\n\n[![Latest Stable Version](https://poser.pugx.org/ipunkt/rancherize/v/stable.svg)](https://packagist.org/packages/ipunkt/rancherize) [![Latest Unstable Version](https://poser.pugx.org/ipunkt/rancherize/v/unstable.svg)](https://packagist.org/packages/ipunkt/rancherize) [![License](https://poser.pugx.org/ipunkt/rancherize/license.svg)](https://packagist.org/packages/ipunkt/rancherize) [![Total Downloads](https://poser.pugx.org/ipunkt/rancherize/downloads.svg)](https://packagist.org/packages/ipunkt/rancherize) [![Docker Pulls](https://img.shields.io/docker/pulls/ipunktbs/rancherize.svg)](https://hub.docker.com/r/ipunktbs/rancherize/) [![Docker Build Status](https://img.shields.io/docker/build/ipunktbs/rancherize.svg)](https://hub.docker.com/r/ipunktbs/rancherize/)\n\nRancherize is a php cli script based on symfony/console. It makes developing with docker and rancher easy for developers\nwithout specialized knowledge in the subjects.\nThis is done by choosing a blueprint that fits your apps required environment and setting abstract requirements instead\nof of adding and connecting services.\n\nFor a concrete example on how the configuration becomes easier through this see the example at the bottom of this page.\n\n# IMPORTANT UPDATE\nAs of 2.23.0 the default behaviour for pushed services has changed to always pull images on an upgrade.  \nThis can be disabled by setting `docker.always-pull: false` in either the defaults or the environment.\n\n# Usage as docker container (preferred)\nRancherize comes bundled as Docker Container [`ipunktbs/rancherize`](https://hub.docker.com/r/ipunktbs/rancherize/).\n## Requirements\nRancherize creates configuration to be used with external docker tools. Thus it is necessary to have the following tools\ninstalled to use Rancherize:\n\n- `docker` https://docs.docker.com/engine/installation/\n## Install on linux\nNo need to separately install it. To use it, just make a shell alias:\n```\nalias rancherize='docker run -it --init -v $HOME/.rancherize:/home/rancherize/.rancherize -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):$(pwd) -w $(pwd) -e \"USER_ID=$(id -u)\" -e \"GROUP_ID=$(id -g)\" ipunktbs/rancherize:2-stable'\n```\nor use the provided script `script/rancherize.sh`.\n\nFrom now on use rancherize without other dependencies for your local environment than docker.\n\n# Usage in build tools\nWith build tools like jenkins or gitlab-ci, you cannot rely on the presence of a .rancherize file in the home-dir. For this usecase you can set account settings with environment variables on the [docker container](https://hub.docker.com/r/ipunktbs/rancherize/) on runtime. best practise would be to include these variables via secrets.\n\n- `DOCKER_SERVER` - registry server (e.g. registry.gitlab.com), ignore or leave empty for dockerhub\n- `DOCKER_USER` - username for dockerhub / registry\n- `DOCKER_PASSWORD` - password for dockerhub / registry\n- `DOCKER_ECR` - true if using [AWS ECR](https://aws.amazon.com/ecr/)\n- `RANCHER_URL` - rancher environment api-url\n- `RANCHER_KEY` - rancher api-key\n- `RANCHER_SECRET` - rancher api-secret\n- `RANCHER_ACCOUNTNAME_URL` - alternative rancher environment api-url when using rancher.account = 'ACCOUNTNAME'\n- `RANCHER_ACCOUNTNAME_KEY` - alternative rancher api-key when using rancher.account = 'ACCOUNTNAME'\n- `RANCHER_ACCOUNTNAME_SECRET` - alternative rancher api-secret when using rancher.account = 'ACCOUNTNAME'\n\nNote that `RANCHER_ACCOUNTNAME_{URL,KEY,SECRET}` are only parsed when `RANCHER_URL` is set. Setting them without default\naccount will NOT work.\n\n# Usage in project\n## Requirements\nRancherize creates configuration to be used with external docker tools. Thus it is necessary to have the following tools\ninstalled to use Rancherize:\n\n- `docker` https://docs.docker.com/engine/installation/\n- `docker-compose` https://docs.docker.com/compose/install/\n- `rancher-compose` https://docs.rancher.com/rancher/v1.2/en/cattle/rancher-compose/#installation\n\n## Installation\nRancherize is installed using composer\n\n\tcomposer require 'ipunkt/rancherize:^2.5.0'\n\t\n# Configuration\n\n## Accounts\n\nRancherize knows 2 types of accounts: \n\n- docker accounts. They are used to push images to docker hub\n- rancher accounts. They are used to deploy your app to your rancher environment\n\nBoth are managed in the json file `~/.rancherize` which should be set to be only readable by your own user.  \nFor easy editing use the following command. It opens the file in your `$EDITOR` and creates a default file\nif it does not exist yet.\n\n\n\tvendor/bin/rancherize rancher:access\n\t\n## Environments\n\nRancherize configuration is split into `environments`. A typical app knows at least a `local` and a `production`\nenvironment. Environments are configured by editing the file `rancherize.json` inside the app work directory. \n\nNote that all configuration values can also be set in the `defaults` section. Values in this section will be used if the\nconfiguration value does not appear in the `environment`\nSee [Environments and Defaults](#environments-and-defaults) for a longer explanation on how to best use environments\n \nThe command `init` can be used to create an initial configuration for an environment.  \nIt will prompt the blueprint to create a sensible default production configuration. If the `--dev` Flag is used then\na configuration for a local development environment is created instead.\n\n\n\tvendor/bin/rancherize init [--dev] BLUEPRINT ENVIRONENTNAME1 ENVIRONEMNTNAME2... ENVIRONMENTNAMEX\n\t\n\te.g.\n\tvendor/bin/rancherize init --dev webserver local\n\tvendor/bin/rancherize init webserver production staging\n\n\n### Set Environment Variable\nThe command `environment:set` exists to conveniently set an environment value for all `environments`. It will go through\nall `environments`, display the current value and ask for the new value. If none is given then the old value\nwill be used again.\n\n\tvendor/bin/rancherize environment:set VARIABLENAME\n\n\te.g.\n\tvendor/bin/rancherize environment:set APP_KEY\n\t\n## Development Environment\n\nThe command `start` exists to start an environment of your app on the local machine.\n\n\tvendor/bin/rancherize start ENVIRONMENTNAME\n\t\n\te.g.\n\tvendor/bin/rancherize start local\n\t\nNote that this command does not currently build a docker image from your work directory so the `environment` should be\nset to mount your work directory directly. For the WebserverBlueprint this means setting\n\n- `\"use-app-container\": false`\n- `\"mount-workdir\":\"true\"`\n\nTheses settings are included when initializing with the `--dev` flag\n\n## Deploy\n### Push\nThe command `push` exists to deploy the current state of your work directory into Rancher.  \n\n\tvendor/bin/rancherize push ENVIRONEMNT VERSION\n\t\n\te.g.\n\tvendor/bin/rancherize push staging v1\n\n- The current state of your work directory is build as docker image and tagged as\n`$(docker.repository):$(docker.version-prefix)VERSION`  \n- The built Image is pushed to docker hub using the credentials from the global configuration named `$(docker.account)`\n- The current configuration of the stack in rancher is retrieved\n  - If the stack does not exist yet it is created empty\n- The apps configuration is added to the stack configuration\n- The app is deployed into the stack\n  - If no other version of the service is found it will be created\n  - !NEW! If `rancher.in-service` is set to `true` then a rolling upgrade will be triggered to a non-versionized name\n    and subsequently in-service upgrades of this service\n  - If the same version of the service is found then an in-service upgrade is triggered\n  - If a different version of the service is found then a rolling-upgrade ist triggered\n  - In case of an in-service upgrade rancherize waits for the stack to reach `upgraded` and confirms the upgrade.  \n    You can set `rancher.upgrade-healthcheck` to `true` to wait for it to report `healthy` instead. Not that this only\n    works if a service has a health-check is defined(not yet supported through rancherize)\n    \n### Build image\nThe command `build-image` exists to build the current state of your work directory into the docker registry, then deploy\nthem via `push -i`.\nIt is essentially the `push` command without any interaction with rancher.\n  \n# Blueprints\n## Blueprint neutral configuration\n- [Force resource limits](app/Validation/ForceResourceLimits/README.md)\n\n## Known Blueprints\n- [Php Webserver](app/Blueprint/Webserver/README.md)\n- [Php Cli](https://github.com/ipunkt/rancherize-blueprint-php-cli)\n\n## Developing Blueprints\n\nSee the [Blueprint readme](app/Blueprint/README.md) for more information on how to develop your own blueprints\n\n# Example\n[List of examples](EXAMPLES.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipunkt%2Francherize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipunkt%2Francherize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipunkt%2Francherize/lists"}