-
Notifications
You must be signed in to change notification settings - Fork 262
FAQ
When we started this project, we asked ourselves this question too and... came to the conclusion, that approximately 8 out of 10 routine operations at the start of a new project can be automated. And it would be better to have all the necessary functions inside one CLI.
That's why we transferred all our experience to this project, which we use ourselves!
So, yes, this CLI gives you the ability to prepare everything you need to start a new project (as create-react-app
for the React ecosystem does) and deploy an existing project to a remote server in configured Docker containers.
If you are looking for documentation or code for the older CLI version, it is here:
We're strongly recommended to use Docker-ready (pre-installed) virtual servers to easily deploy your project. All modern cloud platforms provide such presets out of the box. For example, at DigitalOcean you can set up that droplet preset here:
Next, all you have to do is create a new server (or droplet), generate SSH key to authenticate your computer to this remote server, fill in Ansible inventory file (hosts.ini
) with your credentials and run the cgapp -deploy
command from the project root folder!
If you want or need to use your own roles, you can do it quite easily. Just follow the consistent structure of your role as described in the Ansible User Guide, and make sure you do only three things:
- Place the role in the
./roles
folder at the root of the project. - Edit the
./playbook.yml
file, like this:
# ...
- name: Deploy the Create Go App project
hosts: cgapp_project
# ...
roles:
# ...other roles...
- { role: my_role, tags: [my_role, another_tag] }
- Next, start the deployment process as usual with the
cgapp -deploy
command.
🔔 Note especially the order in which the roles are specified! Ansible will execute them by default in a strictly specified order (from top to bottom).
Sometimes even a few extra megabytes can give you a problem. With this command, you can reduce the size of the binary file without losing CLI functionality:
CGO_ENABLED=0 go install -ldflags="-s -w" github.com/create-go-app/cli/v5/cmd/cgapp@latest
👋 By the way, if you install the CLI by Homebrew or from Releases page of this repository, you're already have this optimization.
Found all available CLI versions on our pkg.go.dev page, choose any version you want and run this command, where X.X.X
it's a needed version of the Create Go App CLI package:
# For v5:
go install github.com/create-go-app/cli/v4/cmd/[email protected]
# For v4:
go install github.com/create-go-app/cli/v4/cmd/[email protected]
# For v3:
go install github.com/create-go-app/cli/v3/cmd/[email protected]
# For v2:
go install github.com/create-go-app/cli/v2/cmd/[email protected]
# For v1:
go install github.com/create-go-app/[email protected]
🔔 Don't forget to rename binary after installation, according to the version you have installed! This must be done to avoid confusion with the latest version.
Sometimes it happens, it's true... but don't get upset! 🙂
Wiki is a dynamically growing section, so write us your question and we'll try to answer it. If the question is interesting and/or repeated too often, we'll add it to a FAQ section (with reference to the author's issue).
The best way to ask a question is to create a new issue or a discussion in GitHub repository.
So, follow this checklist to ask a question that we can answer in the shortest possible time:
- Try to search similar question in the Create Go App CLI issues section.
- If your question is about Ansible, Docker, Go, JavaScript, TypeScript, or else, try to search at StackOverflow first.
- Please fully follow our template to create a new issue.
- If English is not your native language, please use online translator in advance (for example, DeepL or Google Translate).
- Demonstrate understanding to authors, because this is Open Source and not-for-profit product, and their support is not paid.
- Be nice to the other members of our community.