Skip to content

Commit

Permalink
updated vendor files and paths
Browse files Browse the repository at this point in the history
  • Loading branch information
bradrydzewski committed Sep 30, 2015
1 parent 155576f commit dfea14c
Show file tree
Hide file tree
Showing 719 changed files with 128,547 additions and 34,572 deletions.
13 changes: 0 additions & 13 deletions .dockerignore

This file was deleted.

46 changes: 18 additions & 28 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ env:
- PATH=$PATH:$GOROOT/bin:$GOPATH/bin

script:
- go run make.go deps
- go run make.go bindata
- go run make.go vet
- go run make.go fmt
- go run make.go build
- go run make.go test

- make dist
- apt-get -y -qq update
- apt-get -y -qq install libsqlite3-dev
- make deps
- make
- make test
- make deb

notify:
email:
Expand All @@ -29,34 +27,26 @@ publish:
bucket: downloads.drone.io
access_key: $$AWS_KEY
secret_key: $$AWS_SECRET
source: dist/drone.deb
source: contrib/debian/drone.deb
target: $DRONE_BRANCH/
when:
owner: drone



---

clone:
path: github.com/drone/drone

build:
image: golang:1.5.0
image: golang:1.5
commands:
- export GOPATH=/drone
- export PATH=$PATH:$GOPATH/bin

- go run make.go deps
- go run make.go bindata
- go run make.go vet
- go run make.go fmt
- go run make.go build
- go run make.go test

- make dist

compose:
database:
image: mysql:5.5
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
- MYSQL_DATABASE=test
- apt-get -y -qq update
- apt-get -y -qq install libsqlite3-dev
- make deps
- make gen
- make test
- make build
- make build_static
- make deb
41 changes: 10 additions & 31 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,34 +1,13 @@
drone.sublime-project
drone.sublime-workspace
.vagrant

*~
~*
drone
drone_*
*.sqlite
*.sqlite3
*.deb
*.deb.*
*.rpm
*.out
*.prof
*.rice-box.go
*.db
*_gen.go
*.html
*.css
*.txt
*.min.css
*.zip
*.gz
*.out
*.min.js
*_bindata.go
*.toml

# generate binaries
cmd/drone-agent/drone-agent
cmd/drone-build/drone-build
cmd/drone-agent/drone-server

# generated binaries in ./bin
bin/drone
bin/drone-agent
bin/drone-build
bin/drone-server

# generated binaries in dpkg
dist/drone/usr/local/bin/drone
*.deb
temp/
36 changes: 17 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
FROM golang:1.4.2
# Build the drone executable on a x64 Linux host:
#
# go build --ldflags '-extldflags "-static"' -o drone_static
#
#
# Alternate command for Go 1.4 and older:
#
# go build -a -tags netgo --ldflags '-extldflags "-static"' -o drone_static
#
#
# Build the docker image:
#
# docker build --rm=true -t drone/drone .

ENV DRONE_SERVER_PORT :80
WORKDIR $GOPATH/src/github.com/drone/drone
FROM centurylink/ca-certs
EXPOSE 8080

EXPOSE 80
ADD drone_static /drone_static

ENTRYPOINT ["/usr/local/bin/drone"]
CMD ["-config", "/tmp/drone.toml"]

RUN apt-get update \
&& apt-get install -y libsqlite3-dev \
&& git clone git://github.com/gin-gonic/gin.git $GOPATH/src/github.com/gin-gonic/gin \
&& go get -u github.com/jteeuwen/go-bindata/...

RUN touch /tmp/drone.toml

ADD . .
RUN make bindata deps \
&& make build \
&& mv bin/* /usr/local/bin/ \
&& rm -rf bin cmd/drone-server/drone_bindata.go
ENTRYPOINT ["/drone_static"]
26 changes: 0 additions & 26 deletions Dockerfile.alpine

This file was deleted.

66 changes: 31 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
.PHONY: dist
.PHONY: vendor

SHA := $(shell git rev-parse --short HEAD)
VERSION := 0.4.0-alpha
PACKAGES = $(shell go list ./... | grep -v /vendor/)

all: build
all: gen build

deps:
go get golang.org/x/tools/cmd/cover
go get golang.org/x/tools/cmd/vet
go get -u github.com/kr/vexp
go get -u github.com/eknkc/amber/amberc
go get -u github.com/jteeuwen/go-bindata/...
go get -u github.com/elazarl/go-bindata-assetfs/...

gen:
go generate $(go list ./... | grep -v /vendor/)

build:
go run make.go bindata build


# Execute the database test suite against mysql 5.5
#
# You can launch a mysql container locally for testing:
# docker run -rm -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -e MYSQL_DATABASE=test -p 3306:3306 mysql:5.5
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/pkg/store/builtin
mysql -P 3306 --protocol=tcp -u root -e 'drop database test;'

run:
bin/drone --debug

# installs the drone binaries into bin
install:
install -t /usr/local/bin bin/drone
install -t /usr/local/bin bin/drone-agent

docker:
docker build --file=cmd/drone-build/Dockerfile.alpine --rm=true -t drone/drone-build .

# creates a debian package for drone
# to install `sudo dpkg -i drone.deb`
dist:
mkdir -p dist/drone/usr/local/bin
mkdir -p dist/drone/var/lib/drone
mkdir -p dist/drone/var/cache/drone
cp bin/drone dist/drone/usr/local/bin
-dpkg-deb --build dist/drone
GO15VENDOREXPERIMENT=1 go build

build_static:
GO15VENDOREXPERIMENT=1 go build --ldflags '-extldflags "-static"' -o drone_static

test:
go test -cover $(PACKAGES)

deb:
mkdir -p contrib/debian/drone/usr/local/bin
mkdir -p contrib/debian/drone/var/lib/drone
mkdir -p contrib/debian/drone/var/cache/drone
cp drone contrib/debian/drone/usr/local/bin
-dpkg-deb --build contrib/debian/drone

vendor:
vexp
1 change: 0 additions & 1 deletion contrib/debian/README

This file was deleted.

6 changes: 6 additions & 0 deletions contrib/generate-amber.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// +build ignore

// This program converts amber templates to standard
// Go template files.

package main
60 changes: 60 additions & 0 deletions contrib/generate-js.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// +build ignore

// This program minifies JavaScript files
// $ go run generate-js.go -dir scripts/ -out scripts/drone.min.js

package main

import (
"bytes"
"flag"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"

"github.com/dchest/jsmin"
)

var (
dir = flag.String("dir", "scripts/", "")
out = flag.String("o", "scripts/drone.min.js", "")
)

func main() {
flag.Parse()

var buf bytes.Buffer

// walk the directory tree and write all
// javascript files to the buffer.
filepath.Walk(*dir, func(path string, info os.FileInfo, err error) error {
if filepath.Ext(path) != ".js" {
return nil
}

f, err := os.Open(path)
if err != nil {
return nil
}
defer f.Close()

// write the file name to the minified output
fmt.Fprintf(&buf, "// %s\n", path)

// copy the file to the buffer
_, err = io.Copy(&buf, f)
return err
})

// minifies the javascript
data, err := jsmin.Minify(buf.Bytes())
if err != nil {
fmt.Println(err)
os.Exit(1)
}

// write the minified output
ioutil.WriteFile(*out, data, 0700)
}
11 changes: 11 additions & 0 deletions contrib/setup-sqlite.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

cd /tmp

curl -O https://www.sqlite.org/2015/sqlite-autoconf-3081101.tar.gz
tar xzf sqlite-autoconf-3081101.tar.gz
cd sqlite-autoconf-3081101
cd sqlite-3.6.421
./configure -prefix=/scratch/usr/local
make
make install
Loading

0 comments on commit dfea14c

Please sign in to comment.