Initial commit: ozon-mock Go server

- Mock Ozon Seller API endpoints
- Products, Postings, Finance, Returns, Analytics
- JSON fixtures for testing
- Docker support
- Gitea Actions CI/CD
This commit is contained in:
Rinat
2026-07-15 16:19:24 +03:00
commit 842f87f576
13 changed files with 1285 additions and 0 deletions

View File

@ -0,0 +1,39 @@
name: deploy
on:
push:
branches:
- main
paths-ignore:
- '*.md'
workflow_dispatch:
jobs:
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Build binary
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /tmp/ozon-mock ./cmd/server
- name: Copy to ioffe
env:
IOFFE_HOST: ${{ vars.IOFFE_HOST }}
IOFFE_USER: ${{ vars.IOFFE_USER }}
run: |
ssh $IOFFE_USER@$IOFFE_HOST "mkdir -p /opt/ozon-mock"
scp /tmp/ozon-mock $IOFFE_USER@$IOFFE_HOST:/opt/ozon-mock/ozon-mock
- name: Restart service
env:
IOFFE_HOST: ${{ vars.IOFFE_HOST }}
IOFFE_USER: ${{ vars.IOFFE_USER }}
run: |
ssh $IOFFE_USER@$IOFFE_HOST "sudo systemctl restart ozon-mock || true"

32
.gitea/workflows/test.yml Normal file
View File

@ -0,0 +1,32 @@
name: test
on:
- push
- pull_request
jobs:
test:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Download dependencies
run: go mod download
- name: Vet
run: go vet ./...
- name: Build
run: go build -v ./...
- name: Test
run: go test -v -race ./...
- name: Build Docker image
run: |
docker build -t ozon-mock:${{ github.sha }} .
docker tag ozon-mock:${{ github.sha }} ozon-mock:latest