update yaml for s3 upload

This commit is contained in:
Brad Rydzewski 2016-05-26 11:08:48 -07:00
parent 5b1748aafd
commit 64785c8b47
13 changed files with 92 additions and 33 deletions

2
.dockerignore Normal file
View file

@ -0,0 +1,2 @@
*
!release/*

View file

@ -12,7 +12,8 @@ pipeline:
- export PATH=$PATH:$GOPATH/bin - export PATH=$PATH:$GOPATH/bin
- make deps gen - make deps gen
- make test test_postgres test_mysql - make test test_postgres test_mysql
dist:
build:
image: drone/golang:1.5 image: drone/golang:1.5
environment: environment:
- GO15VENDOREXPERIMENT=1 - GO15VENDOREXPERIMENT=1
@ -23,6 +24,14 @@ pipeline:
when: when:
event: push event: push
publish:
image: s3
bucket: downloads.drone.io
source: release/**/*.tar.gz
when:
event: push
branch: master
docker: docker:
repo: drone/drone repo: drone/drone
tag: [ "0.5.0", "0.5" ] tag: [ "0.5.0", "0.5" ]

View file

@ -1 +1 @@
eyJhbGciOiJIUzI1NiJ9.d29ya3NwYWNlOgogIGJhc2U6IC9kcm9uZQogIHBhdGg6IHNyYy9naXRodWIuY29tL2Ryb25lL2Ryb25lCgpwaXBlbGluZToKICB0ZXN0OgogICAgaW1hZ2U6IGRyb25lL2dvbGFuZzoxLjUKICAgIGVudmlyb25tZW50OgogICAgICAtIEdPMTVWRU5ET1JFWFBFUklNRU5UPTEKICAgICAgLSBHT1BBVEg9L2Ryb25lCiAgICBjb21tYW5kczoKICAgICAgLSBleHBvcnQgUEFUSD0kUEFUSDokR09QQVRIL2JpbgogICAgICAtIG1ha2UgZGVwcyBnZW4KICAgICAgLSBtYWtlIHRlc3QgdGVzdF9wb3N0Z3JlcyB0ZXN0X215c3FsCiAgZGlzdDoKICAgIGltYWdlOiBkcm9uZS9nb2xhbmc6MS41CiAgICBlbnZpcm9ubWVudDoKICAgICAgLSBHTzE1VkVORE9SRVhQRVJJTUVOVD0xCiAgICAgIC0gR09QQVRIPS9kcm9uZQogICAgY29tbWFuZHM6CiAgICAgIC0gZXhwb3J0IFBBVEg9JFBBV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PTEKICAgICAgLSBHT1BBVEg9L2Ryb25lCiAgICBjb21tYW5kczoKICAgICAgLSBleHBvcnQgUEFUSD0kUEFUSDokR09QQVRIL2JpbgogICAgICAtIG1ha2UgYnVpbGQKICAgIHdoZW46CiAgICAgIGV2ZW50OiBwdXNoCgogIHB1Ymxpc2g6CiAgICBpbWFnZTogczMKICAgIGJ1Y2tldDogZG93bmxvYWRzLmRyb25lLmlvCiAgICBzb3VyY2U6IHJlbGVhc2UvKiovKi50YXIuZ3oKICAgIHdoZW46CiAgICAgIGV2ZW50OiBwdXNoCiAgICAgIGJyYW5jaDogbWFzdGVyCgogIGRvY2tlcjoKICAgIHJlcG86IGRyb25lL2Ryb25lCiAgICB0YWc6IFsgIjAuNS4wIiwgIjAuNSIgXQogICAgc3RvcmFnZV9kcml2ZXI6IG92ZXJsYXkKICAgIHdoZW46CiAgICAgIGJyYW5jaDogbWFzdGVyCiAgICAgIGV2ZW50OiBwdXNoCgpzZXJ2aWNlczoKICBwb3N0Z3JlczoKICAgIGltYWdlOiBwb3N0Z3Jlczo5LjQuNQogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gUE9TVEdSRVNfVVNFUj1wb3N0Z3JlcwogIG15c3FsOgogICAgaW1hZ2U6IG15c3FsOjUuNi4yNwogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gTVlTUUxfREFUQUJBU0U9dGVzdAogICAgICAtIE1ZU1FMX0FMTE9XX0VNUFRZX1BBU1NXT1JEPXllcwo.r5LDjpl57Aj5esstD0OtJ1_kwI0iYp1cX9LAhxLoVaE

1
.gitignore vendored
View file

@ -11,6 +11,7 @@ drone/drone
*.deb *.deb
.env .env
temp/ temp/
release/
server/swagger/files/*.json server/swagger/files/*.json

View file

@ -1,24 +1,13 @@
# Build the drone executable on a x64 Linux host:
#
# go build --ldflags '-extldflags "-static"' -o drone
#
# Build the docker image:
#
# docker build --rm=true -t drone/drone . # docker build --rm=true -t drone/drone .
FROM centurylink/ca-certs FROM centurylink/ca-certs
EXPOSE 8000 EXPOSE 8000
ADD contrib/docker/etc/nsswitch.conf /etc/
ENV DATABASE_DRIVER=sqlite3 ENV DATABASE_DRIVER=sqlite3
ENV DATABASE_CONFIG=/var/lib/drone/drone.sqlite ENV DATABASE_CONFIG=/var/lib/drone/drone.sqlite
ENV GODEBUG=netdns=go
ADD drone/drone /drone ADD release/drone /drone
# Alpine Linux doesn't use pam, which means that there is no /etc/nsswitch.conf,
# but Go and CGO rely on /etc/nsswitch.conf to check the order of DNS resolving.
# To fix this we just create /etc/nsswitch.conf and add the following line:
#RUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf
ENTRYPOINT ["/drone"] ENTRYPOINT ["/drone"]
CMD ["server"] CMD ["server"]

11
Dockerfile.arm64 Normal file
View file

@ -0,0 +1,11 @@
FROM ??????????
EXPOSE 8000
ENV DATABASE_DRIVER=sqlite3
ENV DATABASE_CONFIG=/var/lib/drone/drone.sqlite
ENV GODEBUG=netdns=go
ADD release/linux/arm64/drone /drone
ENTRYPOINT ["/drone"]
CMD ["server"]

11
Dockerfile.armhf Normal file
View file

@ -0,0 +1,11 @@
FROM ??????????
EXPOSE 8000
ENV DATABASE_DRIVER=sqlite3
ENV DATABASE_CONFIG=/var/lib/drone/drone.sqlite
ENV GODEBUG=netdns=go
ADD release/linux/arm/drone /drone
ENTRYPOINT ["/drone"]
CMD ["server"]

11
Dockerfile.windows Normal file
View file

@ -0,0 +1,11 @@
FROM ??????????
EXPOSE 8000
ENV DATABASE_DRIVER=sqlite3
ENV DATABASE_CONFIG=/var/lib/drone/drone.sqlite
ENV GODEBUG=netdns=go
ADD release/windows/amd64/drone /drone
ENTRYPOINT ["/drone"]
CMD ["server"]

View file

@ -1,8 +1,8 @@
.PHONY: vendor docs .PHONY: vendor docs release
PACKAGES = $(shell go list ./... | grep -v /vendor/) PACKAGES = $(shell go list ./... | grep -v /vendor/)
all: gen build all: gen build_static
deps: deps:
go get -u golang.org/x/tools/cmd/cover go get -u golang.org/x/tools/cmd/cover
@ -24,11 +24,6 @@ gen_template:
gen_migrations: gen_migrations:
go generate github.com/drone/drone/store/datastore/ddl go generate github.com/drone/drone/store/datastore/ddl
build: build_static
build_static:
cd drone && go build --ldflags '-extldflags "-static" -X github.com/drone/drone/version.VersionDev=$(DRONE_BUILD_NUMBER)' -o drone
test: test:
go test -cover $(PACKAGES) go test -cover $(PACKAGES)
@ -40,9 +35,25 @@ test_mysql:
test_postgres: test_postgres:
DATABASE_DRIVER="postgres" DATABASE_CONFIG="host=127.0.0.1 user=postgres dbname=postgres sslmode=disable" go test github.com/drone/drone/store/datastore DATABASE_DRIVER="postgres" DATABASE_CONFIG="host=127.0.0.1 user=postgres dbname=postgres sslmode=disable" go test github.com/drone/drone/store/datastore
deb:
mkdir -p contrib/debian/drone/usr/local/bin # build the release files
mkdir -p contrib/debian/drone/var/lib/drone build: build_static build_cross build_tar
mkdir -p contrib/debian/drone/var/cache/drone
cp drone contrib/debian/drone/usr/local/bin build_static:
-dpkg-deb --build contrib/debian/drone go build --ldflags '-extldflags "-static" -X github.com/drone/drone/version.VersionDev=$(DRONE_BUILD_NUMBER)' -o release/drone github.com/drone/drone/drone
# TODO this is getting moved to a shell script, do not alter
build_cross:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o release/linux/amd64/drone github.com/drone/drone/drone
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o release/linux/arm64/drone github.com/drone/drone/drone
GOOS=linux GOARCH=arm CGO_ENABLED=0 go build -o release/linux/arm/drone github.com/drone/drone/drone
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o release/windows/amd64/drone github.com/drone/drone/drone
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -o release/darwin/amd64/drone github.com/drone/drone/drone
# TODO this is getting moved to a shell script, do not alter
build_tar:
tar -cvzf release/linux/amd64/drone.tar.gz release/linux/amd64/drone
tar -cvzf release/linux/arm64/drone.tar.gz release/linux/arm64/drone
tar -cvzf release/linux/arm/drone.tar.gz release/linux/arm/drone
tar -cvzf release/windows/amd64/drone.tar.gz release/windows/amd64
tar -cvzf release/darwin/amd64/drone.tar.gz release/darwin/amd64/drone

View file

@ -3,5 +3,5 @@ package model
type Netrc struct { type Netrc struct {
Machine string `json:"machine"` Machine string `json:"machine"`
Login string `json:"login"` Login string `json:"login"`
Password string `json:"user"` Password string `json:"password"`
} }

8
store/datastore/init.go Normal file
View file

@ -0,0 +1,8 @@
// +build !cgo
package datastore
import (
_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
)

View file

@ -0,0 +1,9 @@
// +build cgo
package datastore
import (
_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
_ "github.com/mattn/go-sqlite3"
)

View file

@ -7,9 +7,6 @@ import (
"github.com/drone/drone/store" "github.com/drone/drone/store"
"github.com/drone/drone/store/datastore/ddl" "github.com/drone/drone/store/datastore/ddl"
_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
_ "github.com/mattn/go-sqlite3"
"github.com/rubenv/sql-migrate" "github.com/rubenv/sql-migrate"
"github.com/russross/meddler" "github.com/russross/meddler"