45d2e84fd7
- Added a new Dockerfile for the scraper application located at cmd/scraper/Dockerfile to streamline the build process. - Updated the CI configuration in .drone.yml to correctly build the scraper application with the new Dockerfile. - Refactored the main application entry point to utilize a new bootstrap package for configuration, logging, and MongoDB initialization. - Enhanced the scraper's configuration management by defining a dedicated Config struct for better organization and maintainability.
99 lines
2.2 KiB
YAML
99 lines
2.2 KiB
YAML
################################################################################
|
|
# 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: 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
|
|
|
|
- name: build scraper
|
|
image: plugins/docker
|
|
settings:
|
|
build_args:
|
|
- BUILD_APP=scraper
|
|
username: cicd
|
|
password:
|
|
from_secret: REGISTRY_PASSWORD
|
|
dockerfile: ./cmd/scraper/Dockerfile
|
|
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
|
|
|