diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8d2a358..3daff2a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,16 +1,16 @@ version: 2 updates: -- package-ecosystem: gomod - directory: "/" - schedule: - interval: daily - time: "11:00" - open-pull-requests-limit: 10 - ignore: - - dependency-name: github.com/AlecAivazis/survey/v2 - versions: - - 2.2.8 - - 2.2.9 - - dependency-name: github.com/spf13/cobra - versions: - - 1.1.2 + - package-ecosystem: gomod + directory: "/" + schedule: + interval: daily + time: "11:00" + open-pull-requests-limit: 10 + ignore: + - dependency-name: github.com/AlecAivazis/survey/v2 + versions: + - 2.2.8 + - 2.2.9 + - dependency-name: github.com/spf13/cobra + versions: + - 1.1.2 diff --git a/.github/images/cgapp_create.gif b/.github/images/cgapp_create.gif new file mode 100644 index 0000000..2a81c8a Binary files /dev/null and b/.github/images/cgapp_create.gif differ diff --git a/.github/images/cgapp_create.jpg b/.github/images/cgapp_create.jpg new file mode 100644 index 0000000..6cee773 Binary files /dev/null and b/.github/images/cgapp_create.jpg differ diff --git a/.github/images/cgapp_deploy.gif b/.github/images/cgapp_deploy.gif new file mode 100644 index 0000000..5f7b2e6 Binary files /dev/null and b/.github/images/cgapp_deploy.gif differ diff --git a/.github/images/cgapp_deploy.jpg b/.github/images/cgapp_deploy.jpg new file mode 100644 index 0000000..bcd0e63 Binary files /dev/null and b/.github/images/cgapp_deploy.jpg differ diff --git a/.github/images/cgapp_logo.png b/.github/images/cgapp_logo.png new file mode 100644 index 0000000..f910a2c Binary files /dev/null and b/.github/images/cgapp_logo.png differ diff --git a/.github/images/cgapp_logo.svg b/.github/images/cgapp_logo.svg new file mode 100644 index 0000000..7b424d6 --- /dev/null +++ b/.github/images/cgapp_logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/.github/images/cgapp_logo.webp b/.github/images/cgapp_logo.webp new file mode 100644 index 0000000..ad7b2bb Binary files /dev/null and b/.github/images/cgapp_logo.webp differ diff --git a/.github/images/logo-preview.jpg b/.github/images/logo-preview.jpg new file mode 100644 index 0000000..d1229cf Binary files /dev/null and b/.github/images/logo-preview.jpg differ diff --git a/.github/workflows/testing_build.yml b/.github/workflows/testing_build.yml index 0794978..81e00bc 100644 --- a/.github/workflows/testing_build.yml +++ b/.github/workflows/testing_build.yml @@ -29,4 +29,4 @@ jobs: uses: actions/checkout@v2 - name: Test - run: go test -v -cover -race -timeout 60s ./... + run: go test -v -cover -race -timeout 120s ./... diff --git a/.goreleaser.yml b/.goreleaser.yml index bdc78ce..b41f154 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -8,6 +8,7 @@ before: builds: - # Build macOS, Linux and Windows versions + main: ./cmd/cgapp/main.go goos: - linux - darwin diff --git a/Dockerfile b/Dockerfile index 5aa5219..f41f44f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -# This Dockerfile used ONLY with GoReleaser project (`task release [TAG...]`). # Please DO NOT use it for build a normal Docker image for Create Go App CLI! +# This Dockerfile used ONLY with GoReleaser project (`task release [TAG...]`). -FROM alpine:3.12 +FROM alpine:edge -LABEL maintainer="Vic Shóstak " +LABEL maintainer="Vic Shóstak " # Copy Create Go App CLI binary. COPY cgapp /cgapp @@ -11,13 +11,5 @@ COPY cgapp /cgapp # Install git, npm (with nodejs). RUN apk add --no-cache git npm -# Install frontend CLIs (globally and in silent mode). -RUN npm i -g -s --unsafe-perm \ - create-react-app \ - preact-cli \ - @vue/cli \ - @angular/cli \ - degit - # Set entry point. ENTRYPOINT ["/cgapp"] \ No newline at end of file diff --git a/Makefile b/Makefile index 9dd2fcc..4e222f3 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ security: gosec -quiet ./... install: security lint test - CGO_ENABLED=0 go build -ldflags="-s -w" -o $(GOPATH)/bin/cgapp main.go + CGO_ENABLED=0 go build -ldflags="-s -w" -o $(GOPATH)/bin/cgapp ./cmd/cgapp/main.go build: security test goreleaser --snapshot --skip-publish --rm-dist diff --git a/README.md b/README.md index 8ad6ec0..bfc8cf3 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

Create a new production-ready project with backend (Golang), frontend (JavaScript, TypeScript)
and deploy automation (Ansible, Docker) by running one CLI command.

Focus on writing code and thinking of business-logic! The CLI will take care of the rest.

-

cli version go version go cover go report license

+

cli version go version go cover go report license

## ⚡️ Quick start @@ -13,7 +13,7 @@ First of all, [download](https://golang.org/dl/) and install **Go**. Version `1. Installation is done by using the [`go install`](https://golang.org/cmd/go/#hdr-Compile_and_install_packages_and_dependencies) command and rename installed binary in `$GOPATH/bin`: ```bash -go install -ldflags="-s -w" github.com/create-go-app/cli && mv $GOPATH/bin/cli $GOPATH/bin/cgapp +go install github.com/create-go-app/cli/cmd/cgapp@latest ``` Also, macOS and GNU/Linux users available way to install via [Homebrew](https://brew.sh/): @@ -26,292 +26,118 @@ brew tap create-go-app/cli brew install create-go-app/cli/cgapp ``` -Let's create a new project via **interactive console UI** (or **CUI** for short) into current folder: +Let's create a new project via **interactive console UI** (or **CUI** for short) in current folder: ```bash cgapp create ``` -Okay, it works! Now, you can run this project on your **local machine** or deploy to a **remote server**. Project works in isolated Docker containers and automates via Ansible playbook: +Next, open the generated Ansible inventory file (called `hosts.ini`) and fill in the variables according to your server configuration. And you're ready to **automatically deploy** this project: ```bash cgapp deploy ``` -That's all you need to start! 🎉 +That's all you need to know to start! 🎉 -### ~ Docker-way to quick start +### 🐳 Docker-way to quick start If you don't want to install Create Go App CLI to your system, you feel free to using our official [Docker image](https://hub.docker.com/r/koddr/cgapp) and run CLI from isolated container: ```bash -docker run --rm -it -v ${PWD}:${PWD} -w ${PWD} koddr/cgapp:latest +docker run --rm -it -v ${PWD}:${PWD} -w ${PWD} koddr/cgapp:latest [COMMAND] ``` -With this Docker image, you do **not** have to worry about installing tools/CLI of frontend UI libraries/frameworks. Everything is **already included**: `create-react-app`, `preact-cli`, `vue-cli`, `ng-cli` and `degit` (for Svelte and Sapper). +> 🔔 Please note: the `deploy` command is currently **unavailable** in this image. -Available commands for [official Docker image](https://create-go.app/detailed-guides/official-docker-image/): +## 📖 Project Wiki -- [x] [`init`](https://create-go.app/detailed-guides/commands-and-options/#init) -- [x] [`create`](https://create-go.app/detailed-guides/commands-and-options/#create) - -> 🔔 Please note: a [`deploy`](https://create-go.app/detailed-guides/commands-and-options/#deploy) command is currently unavailable in this image. - -## 📺 Video screencast - -A short video screencast to introduce main features of the Create Go App CLI. - - - youtube preview
- 🔗 https://youtu.be/5-DNZFU9TOQ -
- -## 📖 Official Documentation - -Unfortunately, we are unable to include all helpful documentation to the `README` file. That's why, the best way to better explore all the features of the **Create Go App CLI** is to read the [Official Documentation](https://create-go.app/) and explore [Discussions](https://github.com/create-go-app/cli/discussions). - -> 🔥 We've put together a subject index specifically for you, so you can find any answer you want in seconds! - -- [Detailed guides](https://create-go.app/detailed-guides/) - - [CLI Installation](https://create-go.app/detailed-guides/installation/) - - [Alternative installations](https://create-go.app/detailed-guides/installation/#alternative-installations) - - [Understanding CLI commands and options](https://create-go.app/detailed-guides/commands-and-options/) - - [`init`](https://create-go.app/detailed-guides/commands-and-options/#init) - - [`create`](https://create-go.app/detailed-guides/commands-and-options/#create) - - [`deploy`](https://create-go.app/detailed-guides/commands-and-options/#deploy) - - [Working with the official Docker image](https://create-go.app/detailed-guides/official-docker-image/) - - [Run project on your local machine](https://create-go.app/detailed-guides/run-on-local/) - - [Deploy project to a production server](https://create-go.app/detailed-guides/deploy-to-server/) - - [Make your own template](https://create-go.app/detailed-guides/make-custom-template/) - - [Make your own container](https://create-go.app/detailed-guides/make-custom-container/) -- [FAQ](https://create-go.app/faq/) - - [Automation of a deploy process](https://create-go.app/automation/) - - [How do I ask the right question?](https://create-go.app/ask-question/#how-do-i-ask-the-right-question) -- [Official logo](https://create-go.app/logo/) +The best way to better explore all the features of the **Create Go App CLI** is to read the project [Wiki](https://github.com/create-go-app/cli/wiki) and take part in [Discussions](https://github.com/create-go-app/cli/discussions) and/or [Issues](https://github.com/create-go-app/cli/issues). Yes, the most frequently asked questions (_FAQ_) are also [here](https://github.com/create-go-app/cli/wiki/FAQ). ## ⚙️ Commands & Options -### `init` - -CLI command for generate a default `.cgapp.yml` config file in current folder: - -```bash -cgapp init -``` - -- 📺 Preview: https://recordit.co/yvlnIu8Lyp -- 📖 Docs: https://create-go.app/detailed-guides/commands-and-options/#init - -
-Generated config file - -
- -```yaml -# Project config. -project: - # Backend for your project. - # (Required) - # String: - # - `net/http` - # - `fiber` - # User template: supported, set to URL (without protocol), - # like `github.com/user/template` - - backend: fiber - - # Frontend for your project. - # (Optional, to skip set to `none`) - # String: - # - `react` - # - `react: