Skip to content
This repository was archived by the owner on Mar 9, 2025. It is now read-only.

Commit af02f66

Browse files
laszlocphdzsak
andauthored
Merging Gimletd with Dashboard (#423)
Co-authored-by: Ádám <[email protected]>
1 parent 857e2a2 commit af02f66

File tree

120 files changed

+1201
-3542
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+1201
-3542
lines changed

.github/workflows/build.yml

-18
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,6 @@ jobs:
5757
env:
5858
VERSION: "ci-build"
5959

60-
gimletd:
61-
name: 🏗️ Build GimletD
62-
runs-on: ubuntu-latest
63-
needs: test
64-
steps:
65-
- name: Set up Go
66-
uses: actions/setup-go@v2
67-
with:
68-
go-version: 1.19
69-
- name: ⬇️ Check out code into the Go module directory
70-
uses: actions/checkout@v1
71-
with:
72-
fetch-depth: 5
73-
- name: 🏗️ Build GimletD
74-
run: make build-gimletd
75-
env:
76-
VERSION: "ci-build"
77-
7860
agent:
7961
name: 🏗️ Build Agent
8062
runs-on: ubuntu-latest

.github/workflows/preview.yml

+62-62
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
1-
name: 🧪 Preview
2-
on:
3-
push:
4-
branches-ignore:
5-
- "main"
1+
# name: 🧪 Preview
2+
# on:
3+
# push:
4+
# branches-ignore:
5+
# - "main"
66

7-
jobs:
8-
preview-build:
9-
name: 🧪 Preview
10-
runs-on: ubuntu-latest
11-
steps:
12-
- name: 🛑 Cancel Previous Runs
13-
uses: styfle/[email protected]
14-
with:
15-
access_token: ${{ secrets.GITHUB_TOKEN }}
16-
- name: Set up Go
17-
uses: actions/setup-go@v2
18-
with:
19-
go-version: 1.19
20-
- name: ⬇️ Check out code into the Go module directory
21-
uses: actions/checkout@v2
22-
with:
23-
fetch-depth: 5
24-
- name: 🏗️ Build dashboard frontend
25-
run: make build-dashboard-frontend
26-
- name: Dist
27-
run: make dist-dashboard
28-
env:
29-
VERSION: ${{ github.sha }}
30-
- name: Set up Docker Buildx
31-
uses: docker/setup-buildx-action@v1
32-
- name: Login to GitHub Container Registry
33-
uses: docker/login-action@v1
34-
with:
35-
registry: ghcr.io
36-
username: ${{ github.repository_owner }}
37-
password: ${{ secrets.PAT }} # `PAT` is a secret that contains your Personal Access Token with `write:packages` scope
38-
- name: Build and push Dashboard image
39-
uses: docker/build-push-action@v2
40-
with:
41-
context: .
42-
file: docker/dashboard/Dockerfile
43-
platforms: linux/amd64
44-
push: true
45-
tags: |
46-
ghcr.io/gimlet-io/gimlet-dashboard:${{ github.sha }}
47-
- name: Build and push Agent image
48-
uses: docker/build-push-action@v2
49-
with:
50-
context: .
51-
file: docker/dashboard/Dockerfile.agent
52-
platforms: linux/amd64
53-
push: true
54-
tags: |
55-
ghcr.io/gimlet-io/gimlet-dashboard:agent-${{ github.sha }}
56-
- name: Shipping release artifact
57-
id: shipping
58-
uses: gimlet-io/[email protected]
59-
env:
60-
GIMLET_SERVER: ${{ secrets.GIMLET_SERVER }}
61-
GIMLET_TOKEN: ${{ secrets.GIMLET_TOKEN }}
62-
- name: Artifact ID
63-
run: echo "Artifact ID is ${{ steps.shipping.outputs.artifact-id }}"
7+
# jobs:
8+
# preview-build:
9+
# name: 🧪 Preview
10+
# runs-on: ubuntu-latest
11+
# steps:
12+
# - name: 🛑 Cancel Previous Runs
13+
# uses: styfle/[email protected]
14+
# with:
15+
# access_token: ${{ secrets.GITHUB_TOKEN }}
16+
# - name: Set up Go
17+
# uses: actions/setup-go@v2
18+
# with:
19+
# go-version: 1.19
20+
# - name: ⬇️ Check out code into the Go module directory
21+
# uses: actions/checkout@v2
22+
# with:
23+
# fetch-depth: 5
24+
# - name: 🏗️ Build dashboard frontend
25+
# run: make build-dashboard-frontend
26+
# - name: Dist
27+
# run: make dist-dashboard
28+
# env:
29+
# VERSION: ${{ github.sha }}
30+
# - name: Set up Docker Buildx
31+
# uses: docker/setup-buildx-action@v1
32+
# - name: Login to GitHub Container Registry
33+
# uses: docker/login-action@v1
34+
# with:
35+
# registry: ghcr.io
36+
# username: ${{ github.repository_owner }}
37+
# password: ${{ secrets.PAT }} # `PAT` is a secret that contains your Personal Access Token with `write:packages` scope
38+
# - name: Build and push Dashboard image
39+
# uses: docker/build-push-action@v2
40+
# with:
41+
# context: .
42+
# file: docker/dashboard/Dockerfile
43+
# platforms: linux/amd64
44+
# push: true
45+
# tags: |
46+
# ghcr.io/gimlet-io/gimlet-dashboard:${{ github.sha }}
47+
# - name: Build and push Agent image
48+
# uses: docker/build-push-action@v2
49+
# with:
50+
# context: .
51+
# file: docker/dashboard/Dockerfile.agent
52+
# platforms: linux/amd64
53+
# push: true
54+
# tags: |
55+
# ghcr.io/gimlet-io/gimlet-dashboard:agent-${{ github.sha }}
56+
# - name: Shipping release artifact
57+
# id: shipping
58+
# uses: gimlet-io/[email protected]
59+
# env:
60+
# GIMLET_SERVER: ${{ secrets.GIMLET_SERVER }}
61+
# GIMLET_TOKEN: ${{ secrets.GIMLET_TOKEN }}
62+
# - name: Artifact ID
63+
# run: echo "Artifact ID is ${{ steps.shipping.outputs.artifact-id }}"

.github/workflows/publish-gimletd.yml

-67
This file was deleted.

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ fixtures/k3s/kubeconfig.yaml
3838

3939
.vscode/settings.json
4040

41-
gimletd.sqlite
4241
gimlet-dashboard.sqlite
4342

4443
__debug_bin

.vscode/launch.json

-8
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@
3939
],
4040
"envFile": "${workspaceFolder}/.env"
4141
},
42-
{
43-
"name": "GimletD",
44-
"type": "go",
45-
"request": "launch",
46-
"mode": "auto",
47-
"program": "cmd/gimletd",
48-
"envFile": "${workspaceFolder}/.env"
49-
},
5042
{
5143
"name": "Gimlet Dashboard",
5244
"type": "go",

Makefile

-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ LDFLAGS = '-s -w -extldflags "-static" -X github.com/gimlet-io/gimlet-cli/pkg/ve
33

44
.PHONY: format test
55
.PHONY: build-cli dist-cli build-cli-frontend build-stack-frontend fast-dist-cli
6-
.PHONY: build-gimletd dist-gilmetd
76
.PHONY: build-installer dist-installer
87

98
format:
@@ -32,26 +31,19 @@ test-with-postgres:
3231
docker stop testpostgres || true
3332
docker run --rm -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 --name testpostgres -d postgres
3433

35-
DATABASE_DRIVER=postgres DATABASE_CONFIG=postgres://postgres:[email protected]:5432/postgres?sslmode=disable go test -count=1 -timeout 60s github.com/gimlet-io/gimlet-cli/pkg/gimletd/store/...
3634
DATABASE_DRIVER=postgres DATABASE_CONFIG=postgres://postgres:[email protected]:5432/postgres?sslmode=disable go test -count=1 -timeout 60s github.com/gimlet-io/gimlet-cli/pkg/dashboard/store/...
3735

3836
docker stop testpostgres || true
3937

4038
build-cli:
4139
CGO_ENABLED=0 go build -ldflags $(LDFLAGS) -o build/gimlet github.com/gimlet-io/gimlet-cli/cmd/cli
42-
build-gimletd:
43-
go build -ldflags $(LDFLAGS) -o build/gimletd github.com/gimlet-io/gimlet-cli/cmd/gimletd
4440
build-agent:
4541
CGO_ENABLED=0 go build -ldflags $(LDFLAGS) -o build/gimlet-agent github.com/gimlet-io/gimlet-cli/cmd/agent
4642
build-dashboard:
4743
CGO_ENABLED=0 go build -ldflags $(LDFLAGS) -o build/gimlet-dashboard github.com/gimlet-io/gimlet-cli/cmd/dashboard
4844
build-installer:
4945
CGO_ENABLED=0 go build -ldflags $(LDFLAGS) -o build/gimlet-installer github.com/gimlet-io/gimlet-cli/cmd/installer
5046

51-
dist-gimletd:
52-
mkdir -p bin
53-
GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/linux/amd64/gimletd github.com/gimlet-io/gimlet-cli/cmd/gimletd
54-
GOOS=linux GOARCH=arm64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/linux/arm64/gimletd github.com/gimlet-io/gimlet-cli/cmd/gimletd
5547
dist-dashboard:
5648
mkdir -p bin
5749
GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/linux/amd64/gimlet-dashboard github.com/gimlet-io/gimlet-cli/cmd/dashboard

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@
1111
<img alt="Gimlet" src="https://github.com/gimlet-io/gimlet-documentation/blob/main/public/logo.svg" width="200">
1212
</picture>
1313

14+
15+
##
16+
17+
One off SQLs:
18+
19+
```
20+
update users set admin=true where login='laszlocph';
21+
```
22+
23+
- gitopsRepos and gitopsRepo env vars support needs to be done: it should bootstrap an env entry, or we deprecate it
24+
25+
##
26+
1427
## Overview
1528

1629
With Gimlet, you can build and run your developer platform on Kubernetes.

cmd/dashboard/config/config.go

+26-7
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ func defaults(c *Config) {
3636
c.Chart.Repo = "https://chart.onechart.dev"
3737
}
3838
if c.Chart.Version == "" {
39-
c.Chart.Version = "0.38.0"
39+
c.Chart.Version = "0.41.0"
40+
}
41+
if c.GitSSHAddressFormat == "" {
42+
c.GitSSHAddressFormat = "[email protected]:%s.git"
43+
}
44+
if c.ReleaseStats == "" {
45+
c.ReleaseStats = "disabled"
4046
}
4147
}
4248

@@ -53,14 +59,25 @@ type Config struct {
5359
Github Github
5460
Gitlab Gitlab
5561
Database Database
56-
GimletD GimletD
5762
Notifications Notifications
5863
Chart Chart
5964
RepoCachePath string `envconfig:"REPO_CACHE_PATH"`
6065
WebhookSecret string `envconfig:"WEBHOOK_SECRET"`
6166
ReleaseHistorySinceDays int `envconfig:"RELEASE_HISTORY_SINCE_DAYS"`
6267
BootstrapEnv string `envconfig:"BOOTSTRAP_ENV"`
6368
UserflowToken string `envconfig:"USERFLOW_TOKEN"`
69+
70+
PrintAdminToken bool `envconfig:"PRINT_ADMIN_TOKEN"`
71+
AdminToken string `envconfig:"ADMIN_TOKEN"`
72+
73+
// Deprecated, use BootstrapEnv instead
74+
GitopsRepo string `envconfig:"GITOPS_REPO"`
75+
// Deprecated, use BootstrapEnv instead
76+
GitopsRepos string `envconfig:"GITOPS_REPOS"`
77+
78+
GitopsRepoDeployKeyPath string `envconfig:"GITOPS_REPO_DEPLOY_KEY_PATH"`
79+
GitSSHAddressFormat string `envconfig:"GIT_SSH_ADDRESS_FORMAT"`
80+
ReleaseStats string `envconfig:"RELEASE_STATS"`
6481
}
6582

6683
// Logging provides the logging configuration.
@@ -101,18 +118,20 @@ type Database struct {
101118
Config string `envconfig:"DATABASE_CONFIG"`
102119
}
103120

104-
type GimletD struct {
105-
URL string `envconfig:"GIMLETD_URL"`
106-
TOKEN string `envconfig:"GIMLETD_TOKEN"`
107-
}
108-
109121
type Notifications struct {
110122
Provider string `envconfig:"NOTIFICATIONS_PROVIDER"`
111123
Token string `envconfig:"NOTIFICATIONS_TOKEN"`
112124
DefaultChannel string `envconfig:"NOTIFICATIONS_DEFAULT_CHANNEL"`
113125
ChannelMapping string `envconfig:"NOTIFICATIONS_CHANNEL_MAPPING"`
114126
}
115127

128+
type GitopsRepoConfig struct {
129+
Env string
130+
RepoPerEnv bool
131+
GitopsRepo string
132+
DeployKeyPath string
133+
}
134+
116135
func (c *Config) IsGithub() bool {
117136
return c.Github.AppID != ""
118137
}

0 commit comments

Comments
 (0)