Files
athens/.drone.yml
2019-05-03 13:36:41 -07:00

128 lines
2.4 KiB
YAML

---
kind: pipeline
name: default
steps:
- name: chart-lint
image: quay.io/helmpack/chart-testing:v2.3.3
commands:
- ct lint --config test/ct.yaml
when:
branch:
- master
event:
- push
- pull_request
- name: build
image: golang:1.12
commands:
# wait for services to be ready.
- sleep 3
# build
- go build -mod=vendor cmd/proxy/*.go
# test
- ./scripts/check_gofmt.sh
- go vet -mod=vendor ./...
- go test -mod=vendor -v ./...
# end to end test
- ./main & # run the just-built athens server
- sleep 3 # wait for it to spin up
- mkdir -p ~/happy
- mkdir -p ~/emptygopath # ensure the gopath has no modules cached.
- cd ~/happy
- git clone https://github.com/athens-artifacts/happy-path.git
- cd happy-path
- GOPATH=~/emptygopath GOPROXY=http://localhost:3000 go build
environment:
GO111MODULE: on
ATHENS_MONGO_STORAGE_URL: mongodb://mongo:27017
ATHENS_MINIO_ENDPOINT: minio:9000
REDIS_TEST_ENDPOINT: redis:6379
GCS_SERVICE_ACCOUNT:
from_secret: GCS_SERVICE_ACCOUNT
GCS_PROJECT_ID:
from_secret: GOOGLE_CLOUD_PROJECT
when:
branch:
- master
event:
- push
- pull_request
- name: docker-latest
image: plugins/docker
settings:
username:
from_secret: DOCKER_USER
password:
from_secret: DOCKER_PASSWORD
repo: gomods/athens
tags:
- canary
dockerfile: cmd/proxy/Dockerfile
when:
branch:
- master
event:
- push
- name: docker-release
image: plugins/docker
settings:
username:
from_secret: DOCKER_USER
password:
from_secret: DOCKER_PASSWORD
repo: gomods/athens
tags:
- ${DRONE_TAG}
- latest
dockerfile: cmd/proxy/Dockerfile
when:
event:
- tag
- name: publish-helm
image: gomods/drone-helm
settings:
charts_repo: https://athens.blob.core.windows.net
environment:
AZURE_STORAGE_CONNECTION_STRING:
from_secret: AZURE_STORAGE_CONNECTION_STRING
when:
branch:
- master
event:
- push
# Here we can add any backend storage that can be tested.
services:
- name: mongo
image: mongo
ports:
- 27017
- name: minio
image: minio/minio:latest
command:
- server
- /data
ports:
- 9000
environment:
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
- name: redis
image: redis
ports:
- 6379
---
kind: signature
hmac: f15b6f458a1bd97950dfce43d1726958777ed22c2e3c0f1806af0e497bbbb23e
...