Passport
Tanker is an Open source, Self Hosted, Mobile Releases Deployment tool for iOS and Android.
WIP : We are not ready for production yet. You can sign up for our newsletter here, we will reach out to you as soon as we are ready.
Getting Started
Tanker consists of two different components.
Shipper, which connects to your CI or your local machine and uploads binaries.
Tanker, is the backend that saves binaries on Google Cloud Storage and makes it available for user's who should have access.
Please follow the instructions for both the repos.
Prerequisites
Here are the things that you would require before you get started
- Install git
- Install golang
- Install docker, we use it both for deployment and development
Installing
Clone the repo and build it
git clone https://github.com/build-tanker/passport.git
make build_fresh
Setup postgres
$ cd external
$ docker-compose up
$ passport migrate
repeat above till you see *Sadly, found no new migrations to run*
Start the binary by running passport
passport start
Running the tests
If you would like to run the automated tests for the complete package, run this
make coverage
open ./coverage.html
And coding style tests
We use the default golang coding conventions. Run the following to test for those
make fmt
make vet
make lint
Code Structure
/bin
compiled linux and mac binaries for the project, created with make build
/cmd
create multiple binaries from the app
/cmd/tanker
tanker binary
/external
has a docker-compose for dependencies, only for local setup, provides postgres, rabbitmq and redis
/pkg
internal packages
/pkg/shippers
handle functionality for shippers (service that uploads), has handler -> service -> datastore. Handler takes care of HTTP requests, Service takes care of validations etc, Datastore takes care of persisting to DB.
/pkg/builds
handle functionality for builds, has handler -> service -> datastore. Handler takes care of HTTP requests, Service takes care of validations etc, Datastore takes care of persisting to DB.
/pkg/filestore
store physical files, filestore -> gcsfilestore -> gcs. Filestore provides an interface, GCSFileStore provides an implementation for the interface for Google Cloud, GCS handles actual google cloud functionality
/pkg/pings
handle functionality for pings, should ideally have handler -> service -> datastore, but given that we only response with pong, only handler is implemented
/pkg/appcontext
create a context with config and logger to pass through the app
/pkg/config
handle config for app and database
/pkg/filesystem
provide a layer to mock the filesystem for tiny files
/pkg/logger
handle logging throughout the system, provides interface over logrus
/pkg/postgres
handles connections to postgres and migrations
/pkg/postgresmock
provides a mock sqlx database
/pkg/responses
provides generic response and error structures and responses
/pkg/server
provides a new server with negroni and a router
Deployment
We will have deployment instructions as soon as we are ready. You can sign up for our newsletter here, we will reach out to you as soon as we are ready.
Built With
- DEP - For dependency management
- CLI - For accessing the binary on CLI
- VIPER - For configuration management
- LOGRUS - For logging
- NEGRONI - HTTP Middleware
- MUX - For routing each request to the correct place
- PQ - SQL driver for postgres
- SQLX - For connecting to postgres
- MIGRATE - For migrating postgres
- GC STORAGE - For storing files on google cloud
- GO.UUID - For getting UUIDs
- TESTIFY - For asserting tests
- GO-SQLMOCK - For mocking postgres
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning based on the recommendation from Dave Chaney. For the versions available, see the tags on this repository.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details
Acknowledgments
- Hat tip to fabric.io and hockeyapp, we have been looking at them for inspiration