This commit is contained in:
k.pirzargar
2025-08-30 23:47:36 +03:30
parent ea52e87443
commit 4b3172d058
+90 -89
View File
@@ -1,97 +1,98 @@
# ################################################################################ ################################################################################
# # web # web
# ################################################################################ ################################################################################
# kind: pipeline
# type: docker
# name: (web dev) build form and push to artifactory
# steps:
# - name: tag
# image: alpine/git:2.40.1
# environment:
# GOOS: linux
# GOARCH: amd64
# CGO_ENABLED: 0
# settings:
# debug: true
# commands:
# - APP_VERSION=$(git rev-list HEAD --count --no-merges)-$DRONE_BRANCH
# - echo "APP Version tags $APP_VERSION"
# - echo -n "$APP_VERSION" >> .tags
# - name: buid web
# image: plugins/docker
# settings:
# build_args:
# - BUILD_APP=web
# username: cicd
# password:
# from_secret: REGISTRY_PASSWORD
# dockerfile: Dockerfile-drone
# repo: artifactory.ravanertebat.ir/tm/web
# registry: artifactory.ravanertebat.ir
# - name: buid scraper
# image: plugins/docker
# settings:
# build_args:
# - BUILD_APP=scraper
# username: cicd
# password:
# from_secret: REGISTRY_PASSWORD
# dockerfile: Dockerfile-drone
# repo: artifactory.ravanertebat.ir/tm/scraper
# registry: artifactory.ravanertebat.ir
# node:
# tag: aecde-docker-runner
# trigger:
# branch:
# - develop
# event:
# - custom
kind: pipeline kind: pipeline
type: docker type: docker
name: go-pipeline name: (web dev) build form and push to artifactory
steps: steps:
- name: install-deps - name: tag
image: golang:1.21 image: alpine/git:2.40.1
volumes: environment:
- name: gocache GOOS: linux
path: /go/pkg/mod GOARCH: amd64
- name: gobuild CGO_ENABLED: 0
path: /root/.cache/go-build settings:
debug: true
commands: commands:
- go mod download - APP_VERSION=$(git rev-list HEAD --count --no-merges)-$DRONE_BRANCH
- echo "APP Version tags $APP_VERSION"
- echo -n "$APP_VERSION" >> .tags
- name: build-web - name: buid web
image: golang:1.21 image: plugins/docker
volumes: settings:
- name: gocache build_args:
path: /go/pkg/mod - BUILD_APP=web
- name: gobuild username: cicd
path: /root/.cache/go-build password:
commands: from_secret: REGISTRY_PASSWORD
- go build -o build/web ./cmd/web dockerfile: Dockerfile-drone
repo: artifactory.ravanertebat.ir/tm/web
registry: artifactory.ravanertebat.ir
- name: build-scraper - name: buid scraper
image: golang:1.21 image: plugins/docker
volumes: settings:
- name: gocache build_args:
path: /go/pkg/mod - BUILD_APP=scraper
- name: gobuild username: cicd
path: /root/.cache/go-build password:
commands: from_secret: REGISTRY_PASSWORD
- go build -o build/scraper ./cmd/scraper dockerfile: Dockerfile-drone
repo: artifactory.ravanertebat.ir/tm/scraper
registry: artifactory.ravanertebat.ir
node:
tag: aecde-docker-runner
trigger:
branch:
- develop
event:
- custom
# kind: pipeline
# type: docker
# name: go-pipeline
# steps:
# - name: install-deps
# image: golang:1.21
# volumes:
# - name: gocache
# path: /go/pkg/mod
# - name: gobuild
# path: /root/.cache/go-build
# commands:
# - go mod download
# - name: build-web
# image: golang:1.21
# volumes:
# - name: gocache
# path: /go/pkg/mod
# - name: gobuild
# path: /root/.cache/go-build
# commands:
# - go build -o build/web ./cmd/web
# - name: build-scraper
# image: golang:1.21
# volumes:
# - name: gocache
# path: /go/pkg/mod
# - name: gobuild
# path: /root/.cache/go-build
# commands:
# - go build -o build/scraper ./cmd/scraper
# volumes:
# - name: gocache
# host:
# path: /opt/drone/cache/go
# - name: gobuild
# host:
# path: /opt/drone/cache/go-build
volumes:
- name: gocache
host:
path: /opt/drone/cache/go
- name: gobuild
host:
path: /opt/drone/cache/go-build