Skip to content

Commit

Permalink
experimental branch. playing around with boltdb
Browse files Browse the repository at this point in the history
  • Loading branch information
bradrydzewski committed Apr 7, 2015
1 parent 1f8d65b commit d9fd23a
Show file tree
Hide file tree
Showing 284 changed files with 1,076 additions and 22,907 deletions.
34 changes: 2 additions & 32 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,11 @@ env:
- GOROOT=/usr/local/go
- PATH=$PATH:$GOROOT/bin:$GOPATH/bin
script:
- sudo add-apt-repository ppa:git-core/ppa 1> /dev/null 2> /dev/null
- sudo apt-get update 1> /dev/null 2> /dev/null
- sudo apt-get update 1> /dev/null 2> /dev/null
- sudo apt-get -y install git zip libsqlite3-dev sqlite3 rpm 1> /dev/null 2> /dev/null
- gem install fpm
- rbenv rehash
- make docker
- make deps
- make
- make test
- make test_postgres
- make test_mysql
- make packages
services:
- postgres
- mysql

notify:
email:
recipients:
- brad@drone.io
webhook:
urls:
- https://webhooks.gitter.im/e/$$GITTER_KEY
on_started: false
on_success: true
on_failure: true

publish:
s3:
acl: public-read
region: us-east-1
bucket: downloads.drone.io
access_key: $$AWS_KEY
secret_key: $$AWS_SECRET
source: packaging/output/
target: $DRONE_BRANCH/
recursive: true
when:
owner: drone
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
NOTES.txt
drone.sublime-project
drone.sublime-workspace
.vagrant
Expand All @@ -11,8 +10,8 @@ drone.sublime-workspace
*.rpm
*.out
*.rice-box.go
*.db
*.txt
*.toml

cli/cli
client/client
server/server
packaging/root/usr/local
drone
17 changes: 0 additions & 17 deletions Dockerfile

This file was deleted.

89 changes: 3 additions & 86 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,101 +1,18 @@
SHA := $(shell git rev-parse --short HEAD)
VERSION := $(shell cat VERSION)
ITTERATION := $(shell date +%s)
VERSION := 0.4.0-alpha

all: build

deps:
go get github.com/GeertJohan/go.rice/rice
go get -t -v ./...

docker:
mkdir -p $$GOPATH/src/github.com/docker/docker
git clone --depth=1 --branch=v1.5.0 git://github.com/docker/docker.git $$GOPATH/src/github.com/docker/docker

test:
@test -z "$(shell find . -name '*.go' | xargs gofmt -l)" || (echo "Need to run 'go fmt ./...'"; exit 1)
go vet ./...
go test -cover -short ./...

test_mysql:
mysql -P 3306 --protocol=tcp -u root -e 'create database if not exists test;'
TEST_DRIVER="mysql" TEST_DATASOURCE="root@tcp(127.0.0.1:3306)/test" go test -short github.com/drone/drone/server/datastore/database
mysql -P 3306 --protocol=tcp -u root -e 'drop database test;'

test_postgres:
TEST_DRIVER="postgres" TEST_DATASOURCE="host=127.0.0.1 user=postgres dbname=postgres sslmode=disable" go test -short github.com/drone/drone/server/datastore/database

build:
mkdir -p packaging/output
mkdir -p packaging/root/usr/local/bin
go build -o packaging/root/usr/local/bin/drone -ldflags "-X main.revision $(SHA) -X main.version $(VERSION)" github.com/drone/drone/cli
go build -o packaging/root/usr/local/bin/droned -ldflags "-X main.revision $(SHA) -X main.version $(VERSION)" github.com/drone/drone/server

install:
install -t /usr/local/bin packaging/root/usr/local/bin/drone
install -t /usr/local/bin packaging/root/usr/local/bin/droned

run:
@go run server/main.go --config=$$HOME/.drone/config.toml
go build -ldflags "-X main.revision $(SHA) -X main.version $(VERSION).$(SHA)"

clean:
find . -name "*.out" -delete
rm -rf packaging/output
rm -f packaging/root/usr/local/bin/drone
rm -f packaging/root/usr/local/bin/droned

lessc:
lessc --clean-css server/app/styles/drone.less | autoprefixer > server/app/styles/drone.css

packages: clean build embed deb rpm

# embeds content in go source code so that it is compiled
# and packaged inside the go binary file.
embed:
rice --import-path="github.com/drone/drone/server" append --exec="packaging/root/usr/local/bin/droned"

# creates a debian package for drone to install
# `sudo dpkg -i drone.deb`
deb:
fpm -s dir -t deb -n drone -v $(VERSION) -p packaging/output/drone.deb \
--deb-priority optional --category admin \
--force \
--iteration $(ITTERATION) \
--deb-compression bzip2 \
--after-install packaging/scripts/postinst.deb \
--before-remove packaging/scripts/prerm.deb \
--after-remove packaging/scripts/postrm.deb \
--url https://github.com/drone/drone \
--description "Drone continuous integration server" \
-m "Brad Rydzewski <brad@drone.io>" \
--license "Apache License 2.0" \
--vendor "drone.io" -a amd64 \
--config-files /etc/drone/drone.toml \
packaging/root/=/
cp packaging/output/drone.deb packaging/output/drone.deb.$(SHA)

rpm:
fpm -s dir -t rpm -n drone -v $(VERSION) -p packaging/output/drone.rpm \
--rpm-compression bzip2 --rpm-os linux \
--force \
--iteration $(ITTERATION) \
--after-install packaging/scripts/postinst.rpm \
--before-remove packaging/scripts/prerm.rpm \
--after-remove packaging/scripts/postrm.rpm \
--url https://github.com/drone/drone \
--description "Drone continuous integration server" \
-m "Brad Rydzewski <brad@drone.io>" \
--license "Apache License 2.0" \
--vendor "drone.io" -a amd64 \
--config-files /etc/drone/drone.toml \
packaging/root/=/

# deploys drone to a staging server. this requires the following
# environment variables are set:
#
# DRONE_STAGING_HOST -- the hostname or ip
# DRONE_STAGING_USER -- the username used to login
# DRONE_STAGING_KEY -- the identity file path (~/.ssh/id_rsa)
deploy:
scp -i $$DRONE_STAGING_KEY packaging/output/drone.deb $$DRONE_STAGING_USER@$$DRONE_STAGING_HOST:/tmp
ssh -i $$DRONE_STAGING_KEY $$DRONE_STAGING_USER@$$DRONE_STAGING_HOST -- dpkg -i /tmp/drone.deb
rm -f drone
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

Loading

0 comments on commit d9fd23a

Please sign in to comment.