7
All checks were successful
Deploy Production / Deploy to Staging (push) Has been skipped

This commit is contained in:
Alex Shevchuk
2025-08-18 17:52:44 +03:00
parent 5c38141718
commit 176cd406dd
4 changed files with 120 additions and 79 deletions

View File

@@ -1,86 +1,86 @@
name: Go Linter # name: Go Linter
on: # on:
pull_request: # pull_request:
branches: # branches:
- master # - master
push: # push:
branches: # branches:
- master # - master
jobs: # jobs:
lint: # lint:
name: Run golangci-lint # name: Run golangci-lint
runs-on: ubuntu-22.04 # runs-on: ubuntu-22.04
strategy: # strategy:
matrix: # matrix:
project: # project:
- api_gateway # - api_gateway
steps: # steps:
- name: Checkout repository # - name: Checkout repository
uses: actions/checkout@v3 # uses: actions/checkout@v3
- name: Set up Go # - name: Set up Go
uses: actions/setup-go@v4 # uses: actions/setup-go@v4
with: # with:
go-version: 1.23 # go-version: 1.23
- name: Install golangci-lint # - name: Install golangci-lint
run: | # run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.62.2 # curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.62.2
- name: Run golangci-lint # - name: Run golangci-lint
run: | # run: |
go mod tidy # go mod tidy
golangci-lint run -c ./.golangci-lint.yaml --fix=false --color=always # golangci-lint run -c ./.golangci-lint.yaml --fix=false --color=always
build: # build:
name: Build golang services # name: Build golang services
runs-on: ubuntu-22.04 # runs-on: ubuntu-22.04
needs: lint # needs: lint
strategy: # strategy:
matrix: # matrix:
project: # project:
- api_gateway # - api_gateway
steps: # steps:
- name: Checkout repository # - name: Checkout repository
uses: actions/checkout@v3 # uses: actions/checkout@v3
- name: Set up Go # - name: Set up Go
uses: actions/setup-go@v4 # uses: actions/setup-go@v4
with: # with:
go-version: 1.23 # go-version: 1.23
- name: Build golang services # - name: Build golang services
run: | # run: |
go mod tidy # go mod tidy
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o main cmd/main.go # CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o main cmd/main.go
push: # push:
name: Push Docker Images # name: Push Docker Images
runs-on: ubuntu-22.04 # runs-on: ubuntu-22.04
needs: lint # needs: lint
if: gitea.ref == 'refs/heads/master' # if: gitea.ref == 'refs/heads/master'
strategy: # strategy:
matrix: # matrix:
project: # project:
- api_gateway # - api_gateway
steps: # steps:
- name: Checkout репозитория # - name: Checkout репозитория
uses: actions/checkout@v4 # uses: actions/checkout@v4
- name: Build and Push # - name: Build and Push
env: # env:
SECDIST_CONFIG: ${{ secrets.FMT_CRM_SECDIST_CONFIG }} # SECDIST_CONFIG: ${{ secrets.FMT_CRM_SECDIST_CONFIG }}
run: | # run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin # echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
IMAGE_NAME="molvaapp/${{ matrix.project }}" # IMAGE_NAME="molvaapp/${{ matrix.project }}"
TAG="latest" # TAG="latest"
docker build -t $IMAGE_NAME:$TAG . # docker build -t $IMAGE_NAME:$TAG .
docker push $IMAGE_NAME:$TAG # docker push $IMAGE_NAME:$TAG

View File

@@ -85,8 +85,10 @@ jobs:
if [ "${{ inputs.version }}" == "latest" ]; then if [ "${{ inputs.version }}" == "latest" ]; then
TAG=${{ steps.git-metadata.outputs.GIT_TAG != "none" && steps.git-metadata.outputs.GIT_TAG || steps.git-metadata.outputs.GIT_SHA }} TAG=${{ steps.git-metadata.outputs.GIT_TAG != "none" && steps.git-metadata.outputs.GIT_TAG || steps.git-metadata.outputs.GIT_SHA }}
IMAGE_NAME="molvaapp/${{ matrix.project }}" IMAGE_NAME="molvaapp/${{ matrix.project }}"
docker build -t $IMAGE_NAME:$TAG . docker build -t $IMAGE_NAME:$TAG .
docker push $IMAGE_NAME:$TAG docker push $IMAGE_NAME:$TAG
echo "Pushed image $IMAGE_NAME:$TAG"
else else
echo "Using non-latest version ${{ inputs.version }}" echo "Using non-latest version ${{ inputs.version }}"
echo "Skipping pushing image..." echo "Skipping pushing image..."

48
.gitignore vendored Normal file
View File

@@ -0,0 +1,48 @@
.DS_Store
Thumbs.db
desktop.ini
.vscode/
.idea/
*.sublime-workspace
*.sublime-project
go.sum
*.log
*.tmp
*.swp
/bin/
/pkg/
/coverage.out
*.test
*.exe
*.dll
*.so
*.dylib
vendor/
*.o
*.obj
*.a
*.lib
*.out
*.class
*.pch
docker-compose.yaml
.env
dist/
tmp/
.vscod/
code-quality-repot.json
molva
test.sh
bin/
code-quality-report.json
.build/config/local.yaml

View File

@@ -37,15 +37,6 @@ services:
preferences: preferences:
- spread: node.labels.TZ - spread: node.labels.TZ
molva-notifications:
image: molvaapp/notification:latest
container_name: molva-notifications
restart: unless-stopped
volumes:
- /opt/molva:/opt/molva
networks:
- molva
networks: networks:
molva: molva:
external: true external: true