Skip to content

Commit eb9bda2

Browse files
fixig the release process
1 parent eb5e1fe commit eb9bda2

File tree

7 files changed

+4
-203
lines changed

7 files changed

+4
-203
lines changed

.goreleaser.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ builds:
3434

3535

3636
release:
37-
target_commitish: " {{ .ShortCommit }}"
3837
name_template: "{{ .Env.APP_NAME }}_{{ .ShortCommit }}"
3938

4039
archives:

ci/ground_control.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,11 @@ package main
33
import (
44
"context"
55
"fmt"
6-
"log/slog"
76

87
"container-registry.com/harbor-satellite/ci/internal/dagger"
98
)
109

11-
func (m *HarborSatellite) StartGroundControlCI(ctx context.Context, source *dagger.Directory, GITHUB_TOKEN, name string) error {
12-
// Build Ground Control
13-
slog.Info("Building Ground Control")
14-
_ = m.Build(ctx, source, name)
15-
16-
release_output, err := m.Release(ctx, source, GITHUB_TOKEN, name)
17-
if err != nil {
18-
slog.Error("Failed to release Ground Control")
19-
slog.Error(err.Error())
20-
slog.Error((fmt.Sprintf("Release Directory: %s", release_output)))
21-
return err
22-
}
23-
return nil
24-
}
25-
10+
// Would execute the tests for the ground control. Source should be the path to the path to main.go file.
2611
func (m *HarborSatellite) ExecuteTestsForGroundControl(ctx context.Context, source *dagger.Directory) (string, error) {
2712
goContainer := dag.Container().
2813
From(DEFAULT_GO)

ci/main.go

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"fmt"
66
"log/slog"
7-
"os"
87

98
"container-registry.com/harbor-satellite/ci/internal/dagger"
109
)
@@ -13,46 +12,19 @@ const (
1312
DEFAULT_GO = "golang:1.22"
1413
PROJ_MOUNT = "/app"
1514
DOCKER_PORT = 2375
16-
SYFT_VERSION = "v1.9.0"
1715
GORELEASER_VERSION = "v2.1.0"
1816
GROUND_CONTROL_PATH = "./ground-control"
1917
SATELLITE_PATH = "."
2018
)
2119

2220
type HarborSatellite struct{}
2321

24-
func (m *HarborSatellite) Start(ctx context.Context, name string, source *dagger.Directory, GITHUB_TOKEN string) {
25-
26-
if name == "" {
27-
slog.Error("Please provide the app name (satellite or ground-control) as an argument")
28-
os.Exit(1)
29-
}
30-
31-
switch name {
32-
case "satellite":
33-
slog.Info("Starting satellite CI")
34-
err := m.StartSatelliteCi(ctx, source, GITHUB_TOKEN, name)
35-
if err != nil {
36-
slog.Error("Failed to start satellite CI")
37-
os.Exit(1)
38-
}
39-
case "ground-control":
40-
slog.Info("Starting ground-control CI")
41-
err := m.StartGroundControlCI(ctx, source, GITHUB_TOKEN, name)
42-
if err != nil {
43-
slog.Error("Failed to complete ground-control CI")
44-
os.Exit(1)
45-
}
46-
default:
47-
slog.Error("Invalid app name. Please provide either 'satellite' or 'ground-control'")
48-
os.Exit(1)
49-
}
50-
}
51-
22+
// Build function would start the build process for the name provided. Source should be the path to the main.go file.
5223
func (m *HarborSatellite) Build(ctx context.Context, source *dagger.Directory, name string) *dagger.Directory {
5324
return m.build(source, name)
5425
}
5526

27+
// Release function would release the build to the github with the tags provided. Directory should be "." for both the satellite and the ground control.
5628
func (m *HarborSatellite) Release(ctx context.Context, directory *dagger.Directory, token, name string) (string, error) {
5729
var path_to_main string
5830

ci/release.sh

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

ci/satellite.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,11 @@ package main
33
import (
44
"context"
55
"fmt"
6-
"log/slog"
76

87
"container-registry.com/harbor-satellite/ci/internal/dagger"
98
)
109

11-
func (m *HarborSatellite) StartSatelliteCi(ctx context.Context, source *dagger.Directory, GITHUB_TOKEN, name string) error {
12-
// Build Satellite
13-
slog.Info("Building Satellite")
14-
_ = m.Build(ctx, source, name)
15-
16-
release_output, err := m.Release(ctx, source, GITHUB_TOKEN, name)
17-
if err != nil {
18-
slog.Error("Failed to release Ground Control: ", err, ".")
19-
slog.Error("Release Directory:", release_output, ".")
20-
return err
21-
}
22-
return nil
23-
}
24-
10+
// Would execute the tests for the satellite. Source should be the path to the path to main.go file.
2511
func (m *HarborSatellite) ExecuteTestsForSatellite(ctx context.Context, source *dagger.Directory) (string, error) {
2612
goContainer := dag.Container().
2713
From("golang:1.22-alpine").

ci/setup.sh

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

ground-control/.goreleaser.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ builds:
3737
- "{{ .ProjectName }}-{{ .ShortCommit}}"
3838

3939
release:
40-
target_commitish: " {{ .ShortCommit }}"
4140
name_template: "{{ .Env.APP_NAME }}_{{ .ShortCommit }}"
4241

4342
archives:

0 commit comments

Comments
 (0)