LadySolveig / cookiecutter-docker

Fork - Cookiecutter in a docker container

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

 

๐Ÿš€ Cookiecutter Docker

SimplySmart-IT - Open Source

About   |   Technologies   |   Let's start   |   License   |   Author

 

๐Ÿ“‘ About

Cookiecutter in a docker container based on alpine 3.19.

This repository and the associated Docker image are designed to help developers get started quickly and work with cookiecutters.

Joomla! Templates for Cookiecutter1

๐Ÿš€ Cookiecutter Templates for Joomla! cookiecutter-joomla ๐Ÿšง Under construction... ๐Ÿšง

Discover Templates for Cookiecutter

Discover a variety of ready-to-use templates on GitHub.

PHP Templates for Cookiecutter

Filterd list for PHP templates on GitHub

Thank you, Audrey Roy Greenfeld, for the great idea, implementation and maintenance of this very useful command-line utility and to make it available to the open source community.

 

โœ… Technologies

 

๐Ÿš€ Let's start

Pull the docker image

docker pull ghcr.io/simplysmart-it/cookiecutter-docker:alpine-13.9.1

Usage

Use a Cookiecutter project template directly from a repository to start your new project.

docker run -it --rm \
	-e TEMPLATE=gh:simplysmart-it/cookiecutter-joomla \
	-e OUT_DIR=/cookie_out \
	-v $PWD:/cookie_out \
	ghcr.io/simplysmart-it/cookiecutter-docker:alpine-13.9.1

This command runs Cookiecutter in your container and generates a new project in your current working directory based on the Github repository which you specified in the variable TEMPLATE.

Cookiecutter knows abbreviations for Github (gh), Bitbucket (bb), and GitLab (gl) projects, but you can also give it the full URL to any repository. Read more about this topic directly in the Cookiecutter documentation..

 

Checkout branch

You can also check out a specific branch by adding and filling the variable CHECKOUT with the branch name.

docker run -it --rm \
	-e TEMPLATE=gh:simplysmart-it/cookiecutter-joomla \
	-e OUT_DIR=/cookie_out \
	-e CHECKOUT=main \
	-v $PWD:/cookie_out \
	ghcr.io/simplysmart-it/cookiecutter-docker:alpine-13.9.1

 

Directory structured cookiecutter

Some repositories are organized hierarchically and contain more than one template. You can generate your project from a subfolder of the repository by adding and filling the variable DIRECTORY with the folder name.

docker run -it --rm \
	-e TEMPLATE=git+ssh://git@github.com/simplysmart-it/cookiecutter-joomla \
	-e OUT_DIR=/cookie_out \
	-e DIRECTORY=plugin \
	-v $PWD:/cookie_out \
	ghcr.io/simplysmart-it/cookiecutter-docker:alpine-13.9.1

It is also possible to combine the variables DIRECTORYand CHECKOUT to get a subfolder from a specific branch.

 

Local repository or folder

You can also use a local folder or a previously cloned local repository.

  • MOUNT your local directory with the Cookiecutter template -v YOUR-LOCAL-FOLDER-PATH:/cookie_in
  • FILL the TEMPLATE variable with the directory in your docker container that is mounted to the folder outside TEMPLATE=/cookie_in
docker run -it --rm \
	-e TEMPLATE=/cookie_in \
	-e OUT_DIR=/cookie_out \
	-v $PWD:/cookie_out \
	-v YOUR-LOCAL-FOLDER-PATH:/cookie_in \
	ghcr.io/simplysmart-it/cookiecutter-docker:alpine-13.9.1

 

Global Settings - User Config

If you use Cookiecutter a lot, it can be handy to set up a global configuration. This way, you can define the repeating params once and then use them wherever you need to without having to enter them again.

  • Example user config e.g. ~/cookiecutter-global.yaml
default_context:
    author: "Your Full Name"
    author_email: "support@example.local"
    author_company: "Example Company"
    author_url: "https://www.example.local"
    namespace: "YourNamespace"
  • MOUNT your local user config e.g. ~/.cookiecutterrc or any other yaml config file into the Cookiecutter container -v YOUR-LOCAL-FOLDER-PATH/cookiecutter-global.yaml:/cookie_config/.cookiecutterrc
docker run -it --rm \
	-e TEMPLATE=gh:simplysmart-it/cookiecutter-joomla \
	-e OUT_DIR=/cookie_out \
	-e CHECKOUT=main \
	-v $PWD:/cookie_out \
	-v YOUR-LOCAL-FOLDER-PATH/cookiecutter-global.yaml:/cookie_config/.cookiecutterrc \
	ghcr.io/simplysmart-it/cookiecutter-docker:alpine-13.9.1

 

๐Ÿ“ License

This project is under GNU General Public License version 3 or later;. For more details, see the LICENSE file.

 

โœจ Your support

Made with โค๏ธ by Martina Scholz

Would you like to support me and my future developments?!? ๐ŸŽ‰ ๐Ÿš€ Thank you !!! โค๏ธ

ko-fi

 

Back to top  โฌ†๏ธ

Footnotes

  1. This project is not affiliated with or endorsed by The Joomla! Projectโ„ข. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!ยฎ name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc. โ†ฉ

About

Fork - Cookiecutter in a docker container

License:GNU General Public License v3.0


Languages

Language:Shell 74.6%Language:Dockerfile 25.4%