shawnzhu / artifacts-v2

MIT License
0 stars 0 forks source link
file-upload s3-storage travis-ci

License: MIT Build Status Coverage Status Go Report Card

Artifacts

work with artifacts over HTTP API.

Requirements

Install

$ make install

Database setup

  1. Create a database named test_artifacts
  2. Deploy schema by sqitch:
$ sqitch deploy db:pg://postgres@localhost:5432/test_artifacts

AWS credentials

See Configuring Credentials

Public key

Make sure the environment variable JWT_PUBLIC_KEY contains public key in PEM format. E.g., export JWT_PUBLIC_KEY="$(cat public_key.pem)"

Testing

$ make test

Starting test server:

$ go run cmd/travis-artifacts/main.go

Build binary

make build

Release

Push to docker hub:

make TAG=<tag-name> release

Deploy to Kubernetes

Prerequisite: a secret object:

$ kubectl describe secret artifacts-drybag
Name:       artifacts-drybag
Namespace:  artifacts
Labels:     <none>
Annotations:    <none>

Type:   Opaque

Data
====
aws_access_key_id:      21 bytes
aws_secret_access_key:      41 bytes
db_url:             105 bytes
jwt_public_key:         451 bytes
travis-artifacts-psql.crt:  1224 bytes

create distributed app on ready Kubernetes cluster:

$ kubectl create secret tls artifacts-tls --cert=<cert-file-path> --key=<key-file-path>
$ kubectl create -f k8s-app.yml