From e38643938a322583864e097ceac83aee7764a0e8 Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Tue, 7 May 2024 22:20:50 -0700 Subject: [PATCH] dumb rename and attempting to get CI working --- .drone.yaml | 60 +++++++++++++++++++ .../refreshTokens.go | 2 +- .../userService.go | 2 +- internal/services/database.go | 10 ++-- 4 files changed, 67 insertions(+), 7 deletions(-) create mode 100644 .drone.yaml rename internal/{respositoryServices => repositoryServices}/refreshTokens.go (98%) rename internal/{respositoryServices => repositoryServices}/userService.go (99%) diff --git a/.drone.yaml b/.drone.yaml new file mode 100644 index 0000000..3a51629 --- /dev/null +++ b/.drone.yaml @@ -0,0 +1,60 @@ +--- +kind: pipeline +type: docker +name: buildLatestImage + +steps: + - name: buildLatestImage + image: plugins/docker + settings: + repo: jtom38/newsbot-collector + username: jtom38 + password: + from_secret: DockerPushPat +trigger: + branch: + include: + - main + + event: + exclude: + - pull_request +--- +kind: pipeline +type: docker +name: buildReleaseImage + +steps: + - name: buildReleaseImage + image: plugins/docker + settings: + repo: jtom38/newsbot-collector + username: jtom38 + password: + from_secret: DockerPushPat +trigger: + branch: + include: + - releases/* + ref: + include: + - refs/tags/** + event: + exclude: + - pull_request + + +--- +kind: pipeline +type: docker +name: PullRequestCompileTest +steps: + - name: Compile project + image: golang:1.22 + commands: + - go test ./internal/repository + - go build ./cmd/server.go + - +trigger: + event: + - pull_request \ No newline at end of file diff --git a/internal/respositoryServices/refreshTokens.go b/internal/repositoryServices/refreshTokens.go similarity index 98% rename from internal/respositoryServices/refreshTokens.go rename to internal/repositoryServices/refreshTokens.go index ddd6033..ca5b800 100644 --- a/internal/respositoryServices/refreshTokens.go +++ b/internal/repositoryServices/refreshTokens.go @@ -1,4 +1,4 @@ -package respositoryservices +package repositoryservices import ( "context" diff --git a/internal/respositoryServices/userService.go b/internal/repositoryServices/userService.go similarity index 99% rename from internal/respositoryServices/userService.go rename to internal/repositoryServices/userService.go index ea02f51..7a4bed2 100644 --- a/internal/respositoryServices/userService.go +++ b/internal/repositoryServices/userService.go @@ -1,4 +1,4 @@ -package respositoryservices +package repositoryservices import ( "context" diff --git a/internal/services/database.go b/internal/services/database.go index 900c1a0..94a1506 100644 --- a/internal/services/database.go +++ b/internal/services/database.go @@ -4,16 +4,16 @@ import ( "database/sql" "git.jamestombleson.com/jtom38/newsbot-api/internal/repository" - repositoryservice "git.jamestombleson.com/jtom38/newsbot-api/internal/respositoryServices" + repositoryservices "git.jamestombleson.com/jtom38/newsbot-api/internal/repositoryServices" ) type RepositoryService struct { AlertDiscord repository.AlertDiscordRepo Articles repository.ArticlesRepo DiscordWebHooks repository.DiscordWebHookRepo - RefreshTokens repositoryservice.RefreshToken + RefreshTokens repositoryservices.RefreshToken Sources repository.Sources - Users repositoryservice.UserServices + Users repositoryservices.UserServices UserSourceSubscriptions repository.UserSourceRepo } @@ -22,9 +22,9 @@ func NewRepositoryService(conn *sql.DB) RepositoryService { AlertDiscord: repository.NewAlertDiscordRepository(conn), Articles: repository.NewArticleRepository(conn), DiscordWebHooks: repository.NewDiscordWebHookRepository(conn), - RefreshTokens: repositoryservice.NewRefreshTokenService(conn), + RefreshTokens: repositoryservices.NewRefreshTokenService(conn), Sources: repository.NewSourceRepository(conn), - Users: repositoryservice.NewUserService(conn), + Users: repositoryservices.NewUserService(conn), UserSourceSubscriptions: repository.NewUserSourceRepository(conn), } }