Skip to content

Commit 0a29c11

Browse files
author
Vic Shóstak
authored
Merge pull request #56 from create-go-app/dev
Update Create Go App CLI to v1.7.0
2 parents 3b623ba + b744f63 commit 0a29c11

File tree

21 files changed

+223
-327
lines changed

21 files changed

+223
-327
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
.gitattributes
66
.gitignore
77
Dockerfile
8+
Makefile
89
LICENSE
910
**/*_test.go
1011
*.yml
@@ -14,6 +15,5 @@ LICENSE
1415
# Folders
1516
.git/
1617
.github/
17-
.task/
1818
app/
1919
tmp/

.github/workflows/testing_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
go-version: [1.11.x, 1.12.x, 1.13.x, 1.14.x, 1.15.x]
16+
go-version: [1.16.x]
1717
platform: [ubuntu-latest, windows-latest, macos-latest]
1818

1919
runs-on: ${{ matrix.platform }}

.goreleaser.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ env_files:
55
before:
66
hooks:
77
- go mod download
8-
- go generate ./...
98

109
builds:
1110
- # Build macOS, Linux and Windows versions
@@ -15,26 +14,24 @@ builds:
1514
- windows
1615
goarch:
1716
- amd64
17+
- arm64
1818
targets:
1919
- linux_amd64
2020
- darwin_amd64
21+
- darwin_arm64
2122
- windows_amd64
2223
env:
2324
- CGO_ENABLED=0
25+
ldflags:
26+
- -s -w
2427

2528
dockers:
2629
- # GOOS of the built binary that should be used.
2730
goos: linux
2831
goarch: amd64
2932

3033
# Name templates of the built binaries that should be used.
31-
binaries:
32-
- cgapp
33-
34-
# Skips the docker push. Could be useful if you also do draft releases.
35-
# If set to auto, the release will not be pushed to the docker repository
36-
# in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1
37-
skip_push: true
34+
ids: ["cgapp"]
3835

3936
# Templates of the Docker image names.
4037
image_templates:

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.PHONY: test security install build release
2+
3+
test:
4+
go test -coverprofile=coverage.out ./...
5+
go tool cover -func=coverage.out
6+
7+
security:
8+
gosec -quiet ./...
9+
10+
install: security test
11+
CGO_ENABLED=0 go build -ldflags="-s -w" -o $(GOPATH)/bin/cgapp main.go
12+
13+
build: security test
14+
goreleaser --snapshot --skip-publish --rm-dist
15+
16+
release: security test
17+
git tag -a $(VERSION) -m "$(VERSION)"
18+
goreleaser --snapshot --skip-publish --rm-dist
19+
20+
delete-tag:
21+
git tag --delete $(VERSION)
22+
23+
update-pkg-cache:
24+
curl -i https://proxy.golang.org/github.com/create-go-app/cli/@v/$(VERSION).info

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
</h1>
55
<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>
66

7-
<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>
7+
<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>
88

99
## ⚡️ Quick start
1010

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

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

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

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

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

246246
- [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.
247247
- [x] [`fiber`](https://create-go.app/production-templates/fiber-go/) — Backend template with [Fiber](https://github.com/gofiber/fiber).
248-
- [ ] [`echo`](https://create-go.app/production-templates/echo-go/) _WIP_ — Backend template with [Echo](https://github.com/labstack/echo).
249-
- [ ] [`gin`](https://create-go.app/production-templates/gin-go/) _WIP_ — Backend template with [Gin](https://github.com/gin-gonic/gin).
248+
- [ ] [`echo`](https://create-go.app/production-templates/echo-go/) (_WIP_) — Backend template with [Echo](https://github.com/labstack/echo).
249+
- [ ] [`gin`](https://create-go.app/production-templates/gin-go/) (_WIP_) — Backend template with [Gin](https://github.com/gin-gonic/gin).
250250

251251
**Frontend:**
252252

Taskfile.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

cmd/create.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131

3232
"github.com/AlecAivazis/survey/v2"
3333
"github.com/create-go-app/cli/pkg/cgapp"
34-
"github.com/create-go-app/cli/pkg/embed"
3534
"github.com/create-go-app/cli/pkg/registry"
3635
"github.com/spf13/cobra"
3736
)
@@ -102,10 +101,10 @@ var runCreateCmd = func(cmd *cobra.Command, args []string) {
102101

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

119118
// Create playbook.
120119
fileToMake := map[string][]byte{
121-
"deploy-playbook.yml": embed.Get("/deploy-playbook.yml"),
120+
"deploy-playbook.yml": registry.EmbedDeployPlaybook,
122121
}
123122
if err := cgapp.MakeFiles(currentDir, fileToMake); err != nil {
124123
cgapp.SendMsg(true, "[ERROR]", err.Error(), "red", true)

cmd/init.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"os"
2929

3030
"github.com/create-go-app/cli/pkg/cgapp"
31-
"github.com/create-go-app/cli/pkg/embed"
31+
"github.com/create-go-app/cli/pkg/registry"
3232
"github.com/spf13/cobra"
3333
)
3434

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

5151
// Create configuration file.
5252
fileToMake := map[string][]byte{
53-
".cgapp.yml": embed.Get("/.cgapp.yml"),
53+
".cgapp.yml": registry.EmbedCGAPPConfig,
5454
}
5555
if err := cgapp.MakeFiles(currentDir, fileToMake); err != nil {
5656
cgapp.SendMsg(true, "[ERROR]", err.Error(), "red", true)

configs/Taskfile.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module github.com/create-go-app/cli
22

3-
go 1.11
3+
go 1.16
44

55
require (
6-
github.com/AlecAivazis/survey/v2 v2.2.7
6+
github.com/AlecAivazis/survey/v2 v2.2.8
77
github.com/go-git/go-git/v5 v5.2.0
88
github.com/spf13/cobra v1.1.3
99
github.com/spf13/viper v1.7.1

0 commit comments

Comments
 (0)