Skip to content

SimplySmart-IT/cookiecutter-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

 

🚀 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://[email protected]/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: "[email protected]"
    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.