Skip to content

Commit

Permalink
Merge pull request #56 from create-go-app/dev
Browse files Browse the repository at this point in the history
Update Create Go App CLI to v1.7.0
  • Loading branch information
Vic Shóstak authored Feb 25, 2021
2 parents 3b623ba + b744f63 commit 0a29c11
Show file tree
Hide file tree
Showing 21 changed files with 223 additions and 327 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.gitattributes
.gitignore
Dockerfile
Makefile
LICENSE
**/*_test.go
*.yml
Expand All @@ -14,6 +15,5 @@ LICENSE
# Folders
.git/
.github/
.task/
app/
tmp/
2 changes: 1 addition & 1 deletion .github/workflows/testing_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
go-version: [1.11.x, 1.12.x, 1.13.x, 1.14.x, 1.15.x]
go-version: [1.16.x]
platform: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.platform }}
Expand Down
13 changes: 5 additions & 8 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ env_files:
before:
hooks:
- go mod download
- go generate ./...

builds:
- # Build macOS, Linux and Windows versions
Expand All @@ -15,26 +14,24 @@ builds:
- windows
goarch:
- amd64
- arm64
targets:
- linux_amd64
- darwin_amd64
- darwin_arm64
- windows_amd64
env:
- CGO_ENABLED=0
ldflags:
- -s -w

dockers:
- # GOOS of the built binary that should be used.
goos: linux
goarch: amd64

# Name templates of the built binaries that should be used.
binaries:
- cgapp

# Skips the docker push. Could be useful if you also do draft releases.
# If set to auto, the release will not be pushed to the docker repository
# in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1
skip_push: true
ids: ["cgapp"]

# Templates of the Docker image names.
image_templates:
Expand Down
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.PHONY: test security install build release

test:
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out

security:
gosec -quiet ./...

install: security test
CGO_ENABLED=0 go build -ldflags="-s -w" -o $(GOPATH)/bin/cgapp main.go

build: security test
goreleaser --snapshot --skip-publish --rm-dist

release: security test
git tag -a $(VERSION) -m "$(VERSION)"
goreleaser --snapshot --skip-publish --rm-dist

delete-tag:
git tag --delete $(VERSION)

update-pkg-cache:
curl -i https://proxy.golang.org/github.com/create-go-app/cli/@v/$(VERSION).info
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
</h1>
<p align="center">Create a new production-ready project with <b>backend</b> (Golang), <b>frontend</b> (JavaScript, TypeScript)<br/>and <b>deploy automation</b> (Ansible, Docker) by running one CLI command.<br/><br/>Focus on <b>writing</b> code and <b>thinking</b> of business-logic! The CLI will take care of the rest.</p>

<p align="center"><a href="https://github.com/create-go-app/cli/releases" target="_blank"><img src="https://img.shields.io/badge/version-v1.6.12-blue?style=for-the-badge&logo=none" alt="cli version" /></a>&nbsp;<a href="https://pkg.go.dev/github.com/create-go-app/cli?tab=doc" target="_blank"><img src="https://img.shields.io/badge/Go-1.11+-00ADD8?style=for-the-badge&logo=go" alt="go version" /></a>&nbsp;<a href="https://gocover.io/github.com/create-go-app/cli/pkg/cgapp" target="_blank"><img src="https://img.shields.io/badge/Go_Cover-94%25-success?style=for-the-badge&logo=none" alt="go cover" /></a>&nbsp;<a href="https://goreportcard.com/report/github.com/create-go-app/cli" target="_blank"><img src="https://img.shields.io/badge/Go_report-A+-success?style=for-the-badge&logo=none" alt="go report" /></a>&nbsp;<img src="https://img.shields.io/badge/license-apache_2.0-red?style=for-the-badge&logo=none" alt="license" /></p>
<p align="center"><a href="https://github.com/create-go-app/cli/releases" target="_blank"><img src="https://img.shields.io/badge/version-v1.7.0-blue?style=for-the-badge&logo=none" alt="cli version" /></a>&nbsp;<a href="https://pkg.go.dev/github.com/create-go-app/cli?tab=doc" target="_blank"><img src="https://img.shields.io/badge/Go-1.16+-00ADD8?style=for-the-badge&logo=go" alt="go version" /></a>&nbsp;<a href="https://gocover.io/github.com/create-go-app/cli/pkg/cgapp" target="_blank"><img src="https://img.shields.io/badge/Go_Cover-94%25-success?style=for-the-badge&logo=none" alt="go cover" /></a>&nbsp;<a href="https://goreportcard.com/report/github.com/create-go-app/cli" target="_blank"><img src="https://img.shields.io/badge/Go_report-A+-success?style=for-the-badge&logo=none" alt="go report" /></a>&nbsp;<img src="https://img.shields.io/badge/license-apache_2.0-red?style=for-the-badge&logo=none" alt="license" /></p>

## ⚡️ Quick start

First of all, [download](https://golang.org/dl/) and install **Go**. Version `1.11` or higher is required.
First of all, [download](https://golang.org/dl/) and install **Go**. Version `1.16` or higher is required.

Next, download the **latest** version of the Create Go App CLI to your system:

Expand All @@ -19,7 +19,7 @@ go get github.com/create-go-app/cli
Installation is done by using the [`go build`](https://golang.org/cmd/go/#hdr-Compile_packages_and_dependencies) command with `$GOPATH/bin`:

```bash
go build -i -o $GOPATH/bin/cgapp github.com/create-go-app/cli
go build -ldflags="-s -w" -o $GOPATH/bin/cgapp github.com/create-go-app/cli
```

Let's create a new project via **interactive console UI** (or **CUI** for short) into current folder:
Expand Down Expand Up @@ -245,8 +245,8 @@ So, yes, this CLI gives you the ability to prepare everything you need to **star

- [x] [`net/http`](https://create-go.app/production-templates/net-http-go/) — Backend template with Golang built-in [net/http](https://golang.org/pkg/net/http/) package.
- [x] [`fiber`](https://create-go.app/production-templates/fiber-go/) — Backend template with [Fiber](https://github.com/gofiber/fiber).
- [ ] [`echo`](https://create-go.app/production-templates/echo-go/) _WIP_ — Backend template with [Echo](https://github.com/labstack/echo).
- [ ] [`gin`](https://create-go.app/production-templates/gin-go/) _WIP_ — Backend template with [Gin](https://github.com/gin-gonic/gin).
- [ ] [`echo`](https://create-go.app/production-templates/echo-go/) (_WIP_) — Backend template with [Echo](https://github.com/labstack/echo).
- [ ] [`gin`](https://create-go.app/production-templates/gin-go/) (_WIP_) — Backend template with [Gin](https://github.com/gin-gonic/gin).

**Frontend:**

Expand Down
60 changes: 0 additions & 60 deletions Taskfile.yml

This file was deleted.

11 changes: 5 additions & 6 deletions cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (

"github.com/AlecAivazis/survey/v2"
"github.com/create-go-app/cli/pkg/cgapp"
"github.com/create-go-app/cli/pkg/embed"
"github.com/create-go-app/cli/pkg/registry"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -102,10 +101,10 @@ var runCreateCmd = func(cmd *cobra.Command, args []string) {

// Create configuration files.
filesToMake := map[string][]byte{
".gitignore": embed.Get("/.gitignore"),
".gitattributes": embed.Get("/.gitattributes"),
".editorconfig": embed.Get("/.editorconfig"),
"Taskfile.yml": embed.Get("/Taskfile.yml"),
".gitignore": registry.EmbedGitIgnore,
".gitattributes": registry.EmbedGitAttributes,
".editorconfig": registry.EmbedEditorConfig,
"Makefile": registry.EmbedMakefile,
}
if err := cgapp.MakeFiles(currentDir, filesToMake); err != nil {
cgapp.SendMsg(true, "[ERROR]", err.Error(), "red", true)
Expand All @@ -118,7 +117,7 @@ var runCreateCmd = func(cmd *cobra.Command, args []string) {

// Create playbook.
fileToMake := map[string][]byte{
"deploy-playbook.yml": embed.Get("/deploy-playbook.yml"),
"deploy-playbook.yml": registry.EmbedDeployPlaybook,
}
if err := cgapp.MakeFiles(currentDir, fileToMake); err != nil {
cgapp.SendMsg(true, "[ERROR]", err.Error(), "red", true)
Expand Down
4 changes: 2 additions & 2 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"os"

"github.com/create-go-app/cli/pkg/cgapp"
"github.com/create-go-app/cli/pkg/embed"
"github.com/create-go-app/cli/pkg/registry"
"github.com/spf13/cobra"
)

Expand All @@ -50,7 +50,7 @@ var runInitCmd = func(cmd *cobra.Command, args []string) {

// Create configuration file.
fileToMake := map[string][]byte{
".cgapp.yml": embed.Get("/.cgapp.yml"),
".cgapp.yml": registry.EmbedCGAPPConfig,
}
if err := cgapp.MakeFiles(currentDir, fileToMake); err != nil {
cgapp.SendMsg(true, "[ERROR]", err.Error(), "red", true)
Expand Down
39 changes: 0 additions & 39 deletions configs/Taskfile.yml

This file was deleted.

4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module github.com/create-go-app/cli

go 1.11
go 1.16

require (
github.com/AlecAivazis/survey/v2 v2.2.7
github.com/AlecAivazis/survey/v2 v2.2.8
github.com/go-git/go-git/v5 v5.2.0
github.com/spf13/cobra v1.1.3
github.com/spf13/viper v1.7.1
Expand Down
Loading

0 comments on commit 0a29c11

Please sign in to comment.