gitea ci implements
This commit is contained in:
parent
edede9c35c
commit
acd44c0b97
24
.gitea/workflows/deploy.yml
Normal file
24
.gitea/workflows/deploy.yml
Normal file
@ -0,0 +1,24 @@
|
||||
name: Deploy
|
||||
run-name: ${{ gitea.actor }} build image and push to container registry
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'staging'
|
||||
|
||||
jobs:
|
||||
CreateImage:
|
||||
runs-on: [squizstaging]
|
||||
uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/build-image.yml@v1.1.6-p
|
||||
with:
|
||||
runner: squizstaging
|
||||
secrets:
|
||||
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
DeployService:
|
||||
runs-on: [squizstaging]
|
||||
needs: CreateImage
|
||||
uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/deploy.yml@v1.1.7
|
||||
with:
|
||||
runner: squizstaging
|
14
.gitea/workflows/lint.yml
Normal file
14
.gitea/workflows/lint.yml
Normal file
@ -0,0 +1,14 @@
|
||||
name: Lint
|
||||
run-name: ${{ gitea.actor }} produce linting
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'dev'
|
||||
|
||||
jobs:
|
||||
Lint:
|
||||
runs-on: [hubstaging]
|
||||
uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/lint.yml@v1.1.2
|
||||
with:
|
||||
runner: hubstaging
|
@ -1,13 +1,11 @@
|
||||
FROM penahub.gitlab.yandexcloud.net:5050/devops/dockerhub-backup/golang as build
|
||||
FROM gitea.pena/penadevops/container-images/golang:main as build
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN apk add git
|
||||
ENV GOPRIVATE=penahub.gitlab.yandexcloud.net/backend/penahub_common
|
||||
RUN git config --global url."https://buildToken:glpat-axA8ttckx3aPf_xd2Dym@penahub.gitlab.yandexcloud.net/".insteadOf "https://penahub.gitlab.yandexcloud.net/"
|
||||
RUN go mod download
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o wrkr ./main.go
|
||||
|
||||
FROM penahub.gitlab.yandexcloud.net:5050/devops/dockerhub-backup/alpine as prod
|
||||
FROM gitea.pena/penadevops/container-images/alpine:main
|
||||
COPY --from=build /app/wrkr .
|
||||
ENV IS_PROD_LOG=false
|
||||
ENV IS_PROD=false
|
||||
|
0
app/app.go
Normal file
0
app/app.go
Normal file
@ -1,20 +1,19 @@
|
||||
version: "3"
|
||||
services:
|
||||
workerv1.0.0:
|
||||
hostname: squiz-workerv1.0.0
|
||||
container_name: squiz-workerv1.0.0
|
||||
image: $CI_REGISTRY_IMAGE/staging-worker:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
|
||||
image: gitea.pena/squiz/worker/staging:$GITHUB_RUN_NUMBER
|
||||
tty: true
|
||||
environment:
|
||||
IS_PROD_LOG: 'false'
|
||||
IS_PROD: 'false'
|
||||
PG_CRED: 'host=10.8.0.5 port=5433 user=squiz password=Redalert2 dbname=squiz sslmode=disable'
|
||||
KAFKA_BROKER: '10.8.0.6:9092'
|
||||
PG_CRED: 'host=10.7.0.10 port=5432 user=squiz password=Redalert2 dbname=squiz sslmode=disable'
|
||||
KAFKA_BROKER: '10.7.0.6:9092'
|
||||
KAFKA_TOPIC: 'tariffs'
|
||||
QUIZ_ID: quizCnt
|
||||
AMOUNT: 10
|
||||
UNLIM_ID: quizUnlimTime
|
||||
REDIS_HOST: '10.8.0.5:6379'
|
||||
REDIS_HOST: '10.7.0.10:6379'
|
||||
REDIS_PASSWORD: 'Redalert2'
|
||||
REDIS_DB: 2
|
||||
SMTP_HOST: 'connect.mailclient.bz'
|
||||
@ -24,7 +23,7 @@ services:
|
||||
SMTP_USERNAME: 'kotilion.95@gmail.com'
|
||||
SMTP_PASSWORD: 'vWwbCSg4bf0p'
|
||||
SMTP_API_KEY: 'P0YsjUB137upXrr1NiJefHmXVKW1hmBWlpev'
|
||||
CUSTOMER_SERVICE_ADDRESS: '10.8.0.6:9066'
|
||||
CUSTOMER_SERVICE_ADDRESS: '10.7.0.6:9060'
|
||||
MINIO_EP: s3.timeweb.cloud
|
||||
MINIO_AK: 5CV77KVDUU9H0II9R24M
|
||||
MINIO_SK: 0W0m8DyvdAKRJnsAy6mB5zndQ7RouJBLhqhtThcu
|
||||
|
2
go.mod
2
go.mod
@ -2,8 +2,6 @@ module gitea.pena/SQuiz/worker
|
||||
|
||||
go 1.23.2
|
||||
|
||||
toolchain go1.23.4
|
||||
|
||||
require (
|
||||
gitea.pena/PenaSide/customer v0.0.0-20250218224641-8d89ae8ff6b5
|
||||
gitea.pena/PenaSide/hlog v0.0.0-20241125221102-a54c29c002a9
|
||||
|
@ -147,8 +147,7 @@ func ToJSON(data interface{}) (string, error) {
|
||||
func CleanNullContent(answers []model.ResultAnswer) []model.ResultAnswer {
|
||||
var results []model.ResultAnswer
|
||||
for _, answer := range answers {
|
||||
// пока закоментил так как разделитель у нас используется
|
||||
//answer.Content = strings.ReplaceAll(strings.ReplaceAll(answer.Content, "`,`", "`<br>`"),"\n","<br>")
|
||||
answer.Content = strings.ReplaceAll(strings.ReplaceAll(answer.Content, "`,`", "`<br>`"),"\n","<br>")
|
||||
if answer.Content != "" {
|
||||
results = append(results, answer)
|
||||
}
|
||||
|
0
main.go
Normal file
0
main.go
Normal file
Loading…
Reference in New Issue
Block a user