merge commit f8a2561b460742ec990d52a51912f1d704954ee9
This commit is contained in:
commit
db50c618c3
@ -19,8 +19,9 @@ jobs:
|
||||
DeployService:
|
||||
runs-on: [hubstaging]
|
||||
needs: CreateImage
|
||||
uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/deploy.yml@v1.0.1
|
||||
uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/deploy.yml@v1.0.3
|
||||
with:
|
||||
runner: hubstaging
|
||||
actionid: ${{ gitea.run_id }}
|
||||
|
||||
|
||||
|
40
.gitlab-ci.yml
Normal file
40
.gitlab-ci.yml
Normal file
@ -0,0 +1,40 @@
|
||||
include:
|
||||
- project: "devops/pena-continuous-integration"
|
||||
file: "/templates/docker/build-template.gitlab-ci.yml"
|
||||
- project: "devops/pena-continuous-integration"
|
||||
file: "/templates/docker/deploy-template.gitlab-ci.yml"
|
||||
- project: "devops/pena-continuous-integration"
|
||||
file: "/templates/docker/golint.gitlab-ci.yml"
|
||||
- project: "devops/pena-continuous-integration"
|
||||
file: "/templates/docker/service-discovery.gitlab-ci.yml"
|
||||
stages:
|
||||
- lint
|
||||
- build
|
||||
- deploy
|
||||
- service-discovery
|
||||
|
||||
lint:
|
||||
extends: .golint_template
|
||||
|
||||
build-app:
|
||||
tags:
|
||||
- gobuild
|
||||
extends: .build_template
|
||||
|
||||
deploy-to-staging:
|
||||
rules:
|
||||
- if: "$CI_COMMIT_BRANCH == $STAGING_BRANCH"
|
||||
extends: .deploy_template
|
||||
tags:
|
||||
- staging
|
||||
extends: .deploy_template
|
||||
|
||||
deploy-to-prod:
|
||||
rules:
|
||||
- if: "$CI_COMMIT_BRANCH == $PRODUCTION_BRANCH"
|
||||
tags:
|
||||
- prod
|
||||
extends: .deploy_template
|
||||
|
||||
service-discovery:
|
||||
extends: .sd_artefacts_template
|
@ -1,9 +1,11 @@
|
||||
FROM gitea.pena/penadevops/container-images/golang:main as builder
|
||||
WORKDIR /app
|
||||
COPY go.mod ./
|
||||
COPY go.sum ./
|
||||
RUN go mod download
|
||||
RUN apk add git
|
||||
COPY . .
|
||||
ENV GOPRIVATE=gitea.pena/PenaSide/linters-golang
|
||||
ENV GOINSECURE=gitea.pena/PenaSide/linters-golang
|
||||
RUN go env
|
||||
RUN go mod download -x
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o heruvym
|
||||
|
||||
FROM gitea.pena/penadevops/container-images/alpine:main
|
||||
|
@ -3,7 +3,7 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
_ "gitea.pena/PenaSide/linters-golang.git/pkg/dummy"
|
||||
_ "gitea.pena/PenaSide/linters-golang/pkg/dummy"
|
||||
"heruvym/internal/app"
|
||||
"heruvym/internal/initialize"
|
||||
"log"
|
||||
|
@ -1,33 +1,24 @@
|
||||
services:
|
||||
heruvym:
|
||||
container_name: heruvym
|
||||
restart: unless-stopped
|
||||
image: $CI_REGISTRY_IMAGE/staging:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
|
||||
image: gitea.pena:3000/penaside/heruvym/staging:$GITHUB_RUN_NUMBER
|
||||
ports:
|
||||
- 1488:1488
|
||||
expose:
|
||||
- 1488
|
||||
networks:
|
||||
- backend_external
|
||||
- default
|
||||
hostname: heruvym
|
||||
- 10.7.0.6:1487:1488
|
||||
labels:
|
||||
com.pena.upload: true
|
||||
com.pena.allowed_headers: content-type,authorization,response-type
|
||||
tty: true
|
||||
environment:
|
||||
- BB_PORT=1488
|
||||
- BB_IS_PROD=true
|
||||
- BB_MINIO_AK=$BB_MINIO_AK
|
||||
- BB_MINIO_EP=$BB_MINIO_EP
|
||||
- BB_MINIO_SK=$BB_MINIO_SK
|
||||
- BB_MINIO_AK=5CV77KVDUU9H0II9R24M
|
||||
- BB_MINIO_EP=s3.timeweb.cloud
|
||||
- BB_MINIO_SK=0W0m8DyvdAKRJnsAy6mB5zndQ7RouJBLhqhtThcu
|
||||
- BB_MONGO_URI=$BB_MONGO_URI
|
||||
- S3_REGION=$S3_REGION
|
||||
- S3_REGION=ru-1
|
||||
- JWT_SECRET=$JWT_SECRET
|
||||
- TELEGRAM_TOKEN=6414077478:AAFk03HezovLT2kO_i9OYswH8Weirsgp9GU
|
||||
- TELEGRAM_CHAT_ID=1002089014760
|
||||
- REDIS_HOST=10.8.0.6:6379
|
||||
- REDIS_HOST=10.8.0.5:6379
|
||||
- REDIS_PASSWORD=Redalert2
|
||||
- REDIS_DB=4
|
||||
networks:
|
||||
backend_external:
|
||||
driver: bridge
|
||||
attachable: true
|
||||
internal: true
|
||||
|
1
go.mod
1
go.mod
@ -3,6 +3,7 @@ module heruvym
|
||||
go 1.23.2
|
||||
|
||||
require (
|
||||
gitea.pena/PenaSide/linters-golang v0.0.0-20241114215743-9a8e7d58cf96
|
||||
gitea.pena/PenaSide/linters-golang.git v0.0.0-20241107123845-60e4981764af
|
||||
github.com/caarlos0/env/v8 v8.0.0
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible
|
||||
|
3
go.sum
3
go.sum
@ -1,3 +1,4 @@
|
||||
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||
@ -56,6 +57,8 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
gitea.pena/PenaSide/linters-golang.git v0.0.0-20241107123845-60e4981764af h1:g9U+JXUI9daAZbSw+uW+5tlEdkejdRUwbJxu6FMHi24=
|
||||
gitea.pena/PenaSide/linters-golang.git v0.0.0-20241107123845-60e4981764af/go.mod h1:KOzb6hT9ASsvA6RB41GoQIwRhFr/U+f8jx3fnQsknXk=
|
||||
gitea.pena/PenaSide/linters-golang v0.0.0-20241114215743-9a8e7d58cf96 h1:m4EMXEhsA/glI6eJeZnRGUhYPSQdcWj3hzT2IDNlWS0=
|
||||
gitea.pena/PenaSide/linters-golang v0.0.0-20241114215743-9a8e7d58cf96/go.mod h1:gdd+vOT6up9STkEbxa2qESLIMZFjCmRbkcheFQCVgZU=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/ClickHouse/clickhouse-go v1.5.4 h1:cKjXeYLNWVJIx2J1K6H2CqyRmfwVJVY1OV1coaaFcI0=
|
||||
|
@ -20,7 +20,10 @@ type BlobStore struct {
|
||||
store *minio.Client
|
||||
}
|
||||
|
||||
const bucket = "pair"
|
||||
const (
|
||||
bucket = "3c580be9-cf31f296-d055-49cf-b39e-30c7959dc17b"
|
||||
folder = "angelsight"
|
||||
)
|
||||
|
||||
func New(ctx context.Context, deps Deps) (*BlobStore, error) {
|
||||
bStore := &BlobStore{
|
||||
@ -47,7 +50,7 @@ func (bs *BlobStore) PutFile(
|
||||
filename string,
|
||||
reader io.Reader,
|
||||
size int64) error {
|
||||
info, err := bs.store.PutObject(ctx, bucket, filename, reader, size, minio.PutObjectOptions{
|
||||
info, err := bs.store.PutObject(ctx, bucket, folder+"/"+filename, reader, size, minio.PutObjectOptions{
|
||||
//UserMetadata: nil,
|
||||
//UserTags: nil,
|
||||
//Progress: nil,
|
||||
@ -78,7 +81,7 @@ func (bs *BlobStore) PutFile(
|
||||
}
|
||||
|
||||
func (bs *BlobStore) DeleteFile(ctx context.Context, id string) error {
|
||||
if err := bs.store.RemoveObject(ctx, bucket, id, minio.RemoveObjectOptions{
|
||||
if err := bs.store.RemoveObject(ctx, bucket, folder+"/"+id, minio.RemoveObjectOptions{
|
||||
//GovernanceBypass: false,
|
||||
//VersionID: "",
|
||||
//Internal: AdvancedRemoveOptions
|
||||
@ -90,7 +93,7 @@ func (bs *BlobStore) DeleteFile(ctx context.Context, id string) error {
|
||||
}
|
||||
|
||||
func (bs *BlobStore) FileExists(ctx context.Context, filename string) (bool, error) {
|
||||
_, err := bs.store.StatObject(ctx, bucket, filename, minio.StatObjectOptions{})
|
||||
_, err := bs.store.StatObject(ctx, bucket, folder+"/"+filename, minio.StatObjectOptions{})
|
||||
if err != nil {
|
||||
if minio.ToErrorResponse(err).StatusCode == http.StatusNotFound {
|
||||
return false, nil
|
||||
|
Loading…
Reference in New Issue
Block a user