updat epush

This commit is contained in:
Karim Pirzargar
2026-03-09 20:16:14 +03:30
parent d5a96a7cf7
commit 2ab001bc70
4 changed files with 110 additions and 76 deletions
+49 -29
View File
@@ -1,64 +1,84 @@
################################################################################
# build
# my118/5
################################################################################
kind: pipeline
type: docker
name: (build dev) build form and push to artifactory
name: (dev) build form and push to artifactory
clone:
depth: 1
steps:
- name: build tag
image: alpine/git:2.40.1
- name: build golang app admin and user
image: docker-mirror.ravanertebat.ir/hub/golang:1.24
environment:
GOOS: linux
GOARCH: amd64
CGO_ENABLED: 0
GOPROXY: "https://mirror.ravanertebat.ir/repository/golang-proxy,direct"
GOSUMDB: "sum.golang.org https://mirror.ravanertebat.ir/repository/golang-sum-proxy"
# GOINSECURE: "10.64.16.1"
# GOPRIVATE: "10.64.16.1"
settings:
debug: true
commands:
- APP_VERSION=$(git rev-list HEAD --count --no-merges)-$DRONE_BRANCH
- |
set -e
case "$DRONE_BRANCH" in
main) echo prod;;
uat) echo uat;;
dev) echo dev;;
*) echo dev;;
esac > .environment
- echo "Branch ${DRONE_BRANCH}, Environment $(cat .environment)"
- APP_VERSION=$(cat .environment)-${DRONE_BUILD_NUMBER}
- echo "APP Version tags $APP_VERSION"
- echo -n "$APP_VERSION" >> .tags
- name: build web
image: plugins/docker
settings:
build_args:
- BUILD_APP=web
username: cicd
password:
from_secret: REGISTRY_PASSWORD
dockerfile: ./cmd/web/Dockerfile
repo: artifactory.ravanertebat.ir/tm/web
registry: artifactory.ravanertebat.ir
- echo -n "$APP_VERSION,latest" >> .tags
- mkdir -p ./artifacts/go/bin ./artifacts/go/config
- go env
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./artifacts/go/bin/web ./cmd/web/main.go
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./artifacts/go/bin/scraper ./cmd/scraper/main.go
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./artifacts/go/bin/worker ./cmd/worker/main.go
- ls -ltrh ./artifacts/go/bin/
- name: build scraper
- name: push scraper
image: plugins/docker
settings:
build_args:
- BUILD_APP=scraper
debug: true
username: cicd
password:
from_secret: REGISTRY_PASSWORD
dockerfile: ./cmd/scraper/Dockerfile
repo: artifactory.ravanertebat.ir/tm/scraper
registry: artifactory.ravanertebat.ir
dockerfile: ./cmd/scraper/Dockerfile
- name: build worker
- name: push web
image: plugins/docker
settings:
build_args:
- BUILD_APP=worker
debug: true
username: cicd
password:
from_secret: REGISTRY_PASSWORD
repo: artifactory.ravanertebat.ir/tm/web
registry: artifactory.ravanertebat.ir
dockerfile: ./cmd/web/Dockerfile
- name: push worker
image: plugins/docker
settings:
debug: true
username: cicd
password:
from_secret: REGISTRY_PASSWORD
dockerfile: ./cmd/worker/Dockerfile
repo: artifactory.ravanertebat.ir/tm/worker
registry: artifactory.ravanertebat.ir
dockerfile: ./cmd/worker/Dockerfile
node:
tag: aecde-docker-runner
trigger:
branch:
- main
- develop
- uat
- dev
event:
- custom
- promote
- custom