wp-letscode
v0.0.3
Published
An CLI for setup local env with WordPress for you develop your themes with CD integration with gitlab
Downloads
1
Readme
WP Letscode
It's a plugin with the purpose of make easy setup local env for develop WordPress and continuous delivery your projects after each pull request do master branch.
Things that you will need for use this little thing
- NodeJS
- Composer
- Docker (make sure that docker-compose command is avaiable)
- Git
Get Started
First of all, install the plugin:
npm i -g wp-letscode
After install, create a project with:
wp-letscode g my-new-site
After create a project, access the folder created and run:
wp-letscode run
At this moment, 3 docker containers will be created (one with php and your site, one with mysql and another with phpmyadmin) and you will be able to access: http://localhost:8080/
- With this setup, you will be able to versionate a version of your database for local development and share this with others developers of your team.
IMPORTANT
If you create one project, while the project it's beta, you may need to stop all containers created from docker. If you are new with Docker, just type these command in your terminal:
docker rm --force $(docker ps -a -q)
Installing Plugins
- Composer ...
Continous Delivery
It's a dream deploy our project after each git push
. Today we have some tools for this job like DeployHQ. Not everyone has founds on your job to pay for some tool and I found an alternative that I want to share with you.
- First, you have to create a GitLab account https://gitlab.com/
- Make the step-by-step to create an repository, push your code created with the command
wp-letscode g my-new-site
. - Check your
./gitlab-ci.yml
and fill correctly these settings with your Host info:
variables:
USERNAME: ""
PASSWORD: "" HOST: ""
REPO_FOLDER_PATH: "./wp-content" PROD_FOLDER_PATH: ""
- Commit these changes, and now after each commit your website will be deployed :)
ToDo: pt-br
- [] Criar os containers com o nome do projeto
- [] Criar comando
wp-letscode stop nomedoprojeto
- [] Incrementar número de portas para saber qual está disponível (só mandar um http.get() e verificar se tem algum retorno na hora de criar o docker-compose.yml)