Compare commits
2 Commits
ci/add-che
...
edc06aa181
| Author | SHA1 | Date | |
|---|---|---|---|
| edc06aa181 | |||
|
|
bbf47e61a7 |
@@ -1,26 +0,0 @@
|
|||||||
name: Check
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
||||||
|
|
||||||
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
|
|
||||||
- name: Install golangci-lint
|
|
||||||
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
|
||||||
|
|
||||||
- name: Install goimports
|
|
||||||
run: go install golang.org/x/tools/cmd/goimports@latest
|
|
||||||
|
|
||||||
- name: Run make check
|
|
||||||
run: make check
|
|
||||||
@@ -11,7 +11,6 @@ import (
|
|||||||
"log/slog"
|
"log/slog"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -716,7 +715,7 @@ func (svc *Service) cleanupCancelledDeploy(
|
|||||||
prefix := fmt.Sprintf("%d-", deployment.ID)
|
prefix := fmt.Sprintf("%d-", deployment.ID)
|
||||||
|
|
||||||
for _, entry := range entries {
|
for _, entry := range entries {
|
||||||
if entry.IsDir() && strings.HasPrefix(entry.Name(), prefix) {
|
if entry.IsDir() && len(entry.Name()) > len(prefix) && entry.Name()[:len(prefix)] == prefix {
|
||||||
dirPath := filepath.Join(buildDir, entry.Name())
|
dirPath := filepath.Join(buildDir, entry.Name())
|
||||||
|
|
||||||
removeErr := os.RemoveAll(dirPath)
|
removeErr := os.RemoveAll(dirPath)
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import (
|
|||||||
"log/slog"
|
"log/slog"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"git.eeqj.de/sneak/upaas/internal/config"
|
"git.eeqj.de/sneak/upaas/internal/config"
|
||||||
"git.eeqj.de/sneak/upaas/internal/docker"
|
"git.eeqj.de/sneak/upaas/internal/docker"
|
||||||
@@ -48,9 +47,7 @@ func NewTestServiceWithConfig(log *slog.Logger, cfg *config.Config, dockerClient
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CleanupCancelledDeploy exposes the build directory cleanup portion of
|
// CleanupCancelledDeploy exposes cleanupCancelledDeploy for testing.
|
||||||
// cleanupCancelledDeploy for testing. It removes build directories matching
|
|
||||||
// the deployment ID prefix.
|
|
||||||
func (svc *Service) CleanupCancelledDeploy(
|
func (svc *Service) CleanupCancelledDeploy(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
appName string,
|
appName string,
|
||||||
@@ -69,7 +66,7 @@ func (svc *Service) CleanupCancelledDeploy(
|
|||||||
prefix := fmt.Sprintf("%d-", deploymentID)
|
prefix := fmt.Sprintf("%d-", deploymentID)
|
||||||
|
|
||||||
for _, entry := range entries {
|
for _, entry := range entries {
|
||||||
if entry.IsDir() && strings.HasPrefix(entry.Name(), prefix) {
|
if entry.IsDir() && len(entry.Name()) > len(prefix) && entry.Name()[:len(prefix)] == prefix {
|
||||||
dirPath := filepath.Join(buildDir, entry.Name())
|
dirPath := filepath.Join(buildDir, entry.Name())
|
||||||
_ = os.RemoveAll(dirPath)
|
_ = os.RemoveAll(dirPath)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user