pipeline: name: Staging Promotion identifier: staging_promotion projectIdentifier: mev_bot orgIdentifier: default tags: {} properties: ci: codebase: connectorRef: account.git repoName: fraktal/mev-beta build: type: branch spec: branch: <+input> stages: - stage: name: Build & Test identifier: build_test description: Run Drone-equivalent checks inside Harness. type: CI spec: cloneCodebase: true platform: os: Linux arch: Amd64 execution: steps: - step: type: Run name: Lint identifier: lint spec: shell: Bash command: | go mod download golangci-lint run --timeout=10m - step: type: Run name: UnitTests identifier: unit_tests spec: shell: Bash command: | GOCACHE=$(pwd)/.gocache go test -race -coverprofile=coverage.out ./... test -s coverage.out - step: type: Run name: MathAudit identifier: math_audit spec: shell: Bash command: | GOCACHE=$(pwd)/.gocache go run ./tools/math-audit --vectors default --report reports/math/latest ls -l reports/math/latest - step: type: Run name: ProfitSimulation identifier: profit_simulation spec: shell: Bash command: | ./scripts/run_profit_simulation.sh cat reports/simulation/latest/summary.md caching: enabled: true - stage: name: Package identifier: package type: CI spec: cloneCodebase: false platform: os: Linux arch: Amd64 execution: steps: - step: type: Run name: DockerBuild identifier: docker_build spec: shell: Bash command: | docker build -t mev-bot:${HARNESS_BUILD_NUMBER} . docker save mev-bot:${HARNESS_BUILD_NUMBER} -o mev-bot.tar - step: type: Run name: PublishArtifact identifier: publish_artifact spec: shell: Bash command: | echo "Uploading mev-bot.tar to artifact store" when: pipelineStatus: Success - stage: name: Deploy to Staging identifier: deploy_staging type: CD spec: deploymentType: Kubernetes service: serviceRef: staging environment: environmentRef: staging execution: steps: - step: type: ShellScript name: HelmUpgrade identifier: helm_upgrade spec: shell: Bash source: Inline script: | helm upgrade --install mev-bot charts/mev-bot \ --set image.tag=${HARNESS_BUILD_NUMBER} \ --namespace mev-bot-staging - step: type: ShellScript name: PostDeployChecks identifier: post_deploy_checks spec: shell: Bash source: Inline script: | kubectl rollout status deploy/mev-bot -n mev-bot-staging --timeout=120s kubectl logs deploy/mev-bot -n mev-bot-staging | tail -n 100 rollbackSteps: - step: type: ShellScript name: Rollback identifier: rollback spec: shell: Bash source: Inline script: | helm rollback mev-bot 1 || true