-
All checks were successful
Deploy / CreateImage (push) Successful in 2m18s
Deploy / DeployService (push) Successful in 25s

This commit is contained in:
Pasha 2024-12-09 15:35:37 +03:00 committed by skeris
parent 74e86a793a
commit 29c76bcf96
4 changed files with 11 additions and 23 deletions

@ -10,7 +10,7 @@ on:
jobs: jobs:
CreateImage: CreateImage:
runs-on: [hubstaging] runs-on: [hubstaging]
uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/build-image.yml@v1.0.1 uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/build-image.yml@v1.1.6-p
with: with:
runner: hubstaging runner: hubstaging
secrets: secrets:
@ -19,7 +19,7 @@ jobs:
DeployService: DeployService:
runs-on: [hubstaging] runs-on: [hubstaging]
needs: CreateImage needs: CreateImage
uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/deploy.yml@v1.0.3 uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/deploy.yml@v1.1.4-p7
with: with:
runner: hubstaging runner: hubstaging
actionid: ${{ gitea.run_id }} actionid: ${{ gitea.run_id }}

@ -1,27 +1,19 @@
# BUILD # BUILD
FROM penahub.gitlab.yandexcloud.net:5050/devops/dockerhub-backup/golang:main.3862 AS build FROM gitea.pena/penadevops/container-images/golang:main as build
# Update packages and clear cache # Update packages and clear cache
RUN apk add --no-cache curl
# Set work directory # Set work directory
WORKDIR /app WORKDIR /app
RUN apk add git
# Create binary directory # Create binary directory
RUN mkdir /app/bin -p RUN mkdir /app/bin -p
# Create golang migrate util directory
RUN mkdir /bin/golang-migrate -p
# Add migrate tool
ADD ./tools/migrate /bin/golang-migrate/
# Add main files to app
ADD . . ADD . .
RUN git config --global url."https://buildToken:glpat-axA8ttckx3aPf_xd2Dym@penahub.gitlab.yandexcloud.net/".insteadOf "https://penahub.gitlab.yandexcloud.net/"
# Download go depences # Download go depences
RUN go mod download RUN go mod download
# Build app # Build app
RUN GOOS=linux go build -o bin ./... RUN GOOS=linux go build -o bin ./...
# PRODUCTION # PRODUCTION
FROM penahub.gitlab.yandexcloud.net:5050/devops/dockerhub-backup/alpine:main.3862 AS production FROM gitea.pena/penadevops/container-images/alpine:main
# Install packages # Install packages
RUN apk --no-cache add ca-certificates RUN apk --no-cache add ca-certificates
@ -30,7 +22,5 @@ WORKDIR /app
# Copy build file # Copy build file
COPY --from=build /app/bin/app ./app COPY --from=build /app/bin/app ./app
COPY ./report.docx ./report.docx COPY ./report.docx ./report.docx
# Install migrate tool
COPY --from=build /bin/golang-migrate /usr/local/bin
# CMD # CMD
CMD ["./app"] CMD ["./app"]

@ -68,7 +68,7 @@ func loadConfig() (*models.Config, error) {
var config models.Config var config models.Config
if err := env.Parse(&config); err != nil { if err := env.Parse(&config); err != nil {
log.Fatalf("failed to parse environment variables: %v", err) return nil, err
} }
return &config, nil return &config, nil

@ -1,10 +1,8 @@
version: "3.3" version: "3.3"
services: services:
customer-app-stagingv1.0.1: customerv1.0.1:
hostname: customerv1.0.1 image: gitea.pena:3000/penaside/customer/staging:$GITHUB_RUN_NUMBER
container_name: customerv1.0.1
image: $CI_REGISTRY_IMAGE/staging:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
tty: true tty: true
labels: labels:
com.pena.allowed_headers: content-type,authorization,response-type com.pena.allowed_headers: content-type,authorization,response-type
@ -19,7 +17,7 @@ services:
# - MONGO_PORT=27017 # - MONGO_PORT=27017
# - MONGO_USER=$MONGO_USER # - MONGO_USER=$MONGO_USER
# - MONGO_PASSWORD=$MONGO_PASSWORD # - MONGO_PASSWORD=$MONGO_PASSWORD
- MONGO_URL = TODO - MONGO_URL=mongodb://customer:WAR2Fr6SuPKhtvEp@10.7.0.6:27017/?authSource=customer
- MONGO_DB_NAME=customer - MONGO_DB_NAME=customer
# - MONGO_AUTH=customer # - MONGO_AUTH=customer
- TELEGRAM_RS_PAY_CHANNEL_ID=-1002338593104 - TELEGRAM_RS_PAY_CHANNEL_ID=-1002338593104
@ -49,8 +47,8 @@ services:
- TRASH_LOG_HOST=10.8.0.15:7113 - TRASH_LOG_HOST=10.8.0.15:7113
- TELEGRAM_TOKEN=6112841016:AAH2nO1c6mqfMewBvHwdXCDp5PCclOuc99s - TELEGRAM_TOKEN=6112841016:AAH2nO1c6mqfMewBvHwdXCDp5PCclOuc99s
ports: ports:
- 10.8.0.6:8067:8065 - 10.7.0.6:8067:8065
- 10.8.0.6:8070:8066 - 10.7.0.6:8070:8066
- 10.8.0.6:9060:9065 - 10.7.0.6:9060:9065
networks: networks:
- default - default