-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitpod.yml
119 lines (100 loc) · 2.65 KB
/
.gitpod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
tasks:
- name: Build migration program
init: |
cd ./examples/simple/migrations
go build .
gp sync-done migration
command: |
exit 0
- name: MySQL
env:
DB_CONNECTION: "root:password@tcp(localhost:3306)/gobblr"
DB_TYPE: mysql
command: |
docker run \
-e MYSQL_ROOT_PASSWORD=password \
-e MYSQL_DATABASE=gobblr \
--rm \
-p 3306:3306 \
--name mysql \
mysql &
gp sync-await migration
./examples/simple/migrations/simple
- name: MongoDB
command: |
docker run \
--rm \
-p 27017:27017 \
--name mongodb \
mongo
- name: PostgreSQL
env:
DB_CONNECTION: "user=postgres password=password host=localhost port=5432 dbname=gobblr"
DB_TYPE: postgres
command: |
docker run \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=gobblr \
--rm \
-p 5432:5432 \
--name pgsql \
postgres &
gp sync-await migration
./examples/simple/migrations/simple
- name: SQLite
env:
DB_TYPE: sqlite
command: |
export DB_CONNECTION="$GITPOD_REPO_ROOT/sqlite.db"
gp sync-await migration
./examples/simple/migrations/simple
- before: |
curl -sfL gpm.simonemms.com | bash
gpm install goreleaser pre-commit
init: |
go install github.com/spf13/cobra-cli@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install github.com/kisielk/errcheck@latest
go install mvdan.cc/gofumpt@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
go install golang.org/x/tools/cmd/goimports@latest
go install ./...
env:
GOBBLR_DATABASE: gobblr
GOBBLR_PATH: ./examples/simple/data
command: |
# Copy .cobra.yaml to $HOME
cp .cobra.yaml $HOME/.cobra.yaml
export GIT_REPO="${GITPOD_WORKSPACE_CONTEXT_URL/https:\/\//}"
export PROJECT_NAME="${GIT_REPO##*/}"
if [ ! -f "go.mod" ]; then
echo "Creating Go module"
go mod init "$GIT_REPO"
fi
if [ ! -f "main.go" ]; then
echo "Create Cobra project"
cobra-cli init
go mod tidy
fi
pre-commit install --install-hooks
ports:
- port: 1443
name: SQL server
visibility: private
- port: 3306
name: MySQL
visibility: private
- port: 5432
name: PostgreSQL
visibility: private
- port: 5670
name: Gobblr web server
visibility: private
- port: 27017
name: MongoDB
visibility: private
vscode:
extensions:
- donjayamanne.git-extension-pack
- EditorConfig.EditorConfig
- golang.go