mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-25 11:21:02 +00:00
update yaml for s3 upload
This commit is contained in:
parent
5b1748aafd
commit
64785c8b47
13 changed files with 92 additions and 33 deletions
2
.dockerignore
Normal file
2
.dockerignore
Normal file
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
!release/*
|
11
.drone.yml
11
.drone.yml
|
@ -12,7 +12,8 @@ pipeline:
|
|||
- export PATH=$PATH:$GOPATH/bin
|
||||
- make deps gen
|
||||
- make test test_postgres test_mysql
|
||||
dist:
|
||||
|
||||
build:
|
||||
image: drone/golang:1.5
|
||||
environment:
|
||||
- GO15VENDOREXPERIMENT=1
|
||||
|
@ -23,6 +24,14 @@ pipeline:
|
|||
when:
|
||||
event: push
|
||||
|
||||
publish:
|
||||
image: s3
|
||||
bucket: downloads.drone.io
|
||||
source: release/**/*.tar.gz
|
||||
when:
|
||||
event: push
|
||||
branch: master
|
||||
|
||||
docker:
|
||||
repo: drone/drone
|
||||
tag: [ "0.5.0", "0.5" ]
|
||||
|
|
|
@ -1 +1 @@
|
|||
eyJhbGciOiJIUzI1NiJ9.d29ya3NwYWNlOgogIGJhc2U6IC9kcm9uZQogIHBhdGg6IHNyYy9naXRodWIuY29tL2Ryb25lL2Ryb25lCgpwaXBlbGluZToKICB0ZXN0OgogICAgaW1hZ2U6IGRyb25lL2dvbGFuZzoxLjUKICAgIGVudmlyb25tZW50OgogICAgICAtIEdPMTVWRU5ET1JFWFBFUklNRU5UPTEKICAgICAgLSBHT1BBVEg9L2Ryb25lCiAgICBjb21tYW5kczoKICAgICAgLSBleHBvcnQgUEFUSD0kUEFUSDokR09QQVRIL2JpbgogICAgICAtIG1ha2UgZGVwcyBnZW4KICAgICAgLSBtYWtlIHRlc3QgdGVzdF9wb3N0Z3JlcyB0ZXN0X215c3FsCiAgZGlzdDoKICAgIGltYWdlOiBkcm9uZS9nb2xhbmc6MS41CiAgICBlbnZpcm9ubWVudDoKICAgICAgLSBHTzE1VkVORE9S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1aWxkOgogICAgaW1hZ2U6IGRyb25lL2dvbGFuZzoxLjUKICAgIGVudmlyb25tZW50OgogICAgICAtIEdPMTVWRU5ET1JFWFBFUklNRU5UPTEKICAgICAgLSBHT1BBVEg9L2Ryb25lCiAgICBjb21tYW5kczoKICAgICAgLSBleHBvcnQgUEFUSD0kUEFUSDokR09QQVRIL2JpbgogICAgICAtIG1ha2UgYnVpbGQKICAgIHdoZW46CiAgICAgIGV2ZW50OiBwdXNoCgogIHB1Ymxpc2g6CiAgICBpbWFnZTogczMKICAgIGJ1Y2tldDogZG93bmxvYWRzLmRyb25lLmlvCiAgICBzb3VyY2U6IHJlbGVhc2UvKiovKi50YXIuZ3oKICAgIHdoZW46CiAgICAgIGV2ZW50OiBwdXNoCiAgICAgIGJyYW5jaDogbWFzdGVyCgogIGRvY2tlcjoKICAgIHJlcG86IGRyb25lL2Ryb25lCiAgICB0YWc6IFsgIjAuNS4wIiwgIjAuNSIgXQogICAgc3RvcmFnZV9kcml2ZXI6IG92ZXJsYXkKICAgIHdoZW46CiAgICAgIGJyYW5jaDogbWFzdGVyCiAgICAgIGV2ZW50OiBwdXNoCgpzZXJ2aWNlczoKICBwb3N0Z3JlczoKICAgIGltYWdlOiBwb3N0Z3Jlczo5LjQuNQogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gUE9TVEdSRVNfVVNFUj1wb3N0Z3JlcwogIG15c3FsOgogICAgaW1hZ2U6IG15c3FsOjUuNi4yNwogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gTVlTUUxfREFUQUJBU0U9dGVzdAogICAgICAtIE1ZU1FMX0FMTE9XX0VNUFRZX1BBU1NXT1JEPXllcwo.r5LDjpl57Aj5esstD0OtJ1_kwI0iYp1cX9LAhxLoVaE
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -11,6 +11,7 @@ drone/drone
|
|||
*.deb
|
||||
.env
|
||||
temp/
|
||||
release/
|
||||
|
||||
server/swagger/files/*.json
|
||||
|
||||
|
|
17
Dockerfile
17
Dockerfile
|
@ -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
|
||||
EXPOSE 8000
|
||||
ADD contrib/docker/etc/nsswitch.conf /etc/
|
||||
|
||||
ENV DATABASE_DRIVER=sqlite3
|
||||
ENV DATABASE_CONFIG=/var/lib/drone/drone.sqlite
|
||||
ENV GODEBUG=netdns=go
|
||||
|
||||
ADD drone/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
|
||||
ADD release/drone /drone
|
||||
|
||||
ENTRYPOINT ["/drone"]
|
||||
CMD ["server"]
|
||||
|
|
11
Dockerfile.arm64
Normal file
11
Dockerfile.arm64
Normal 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
11
Dockerfile.armhf
Normal 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
11
Dockerfile.windows
Normal 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"]
|
37
Makefile
37
Makefile
|
@ -1,8 +1,8 @@
|
|||
.PHONY: vendor docs
|
||||
.PHONY: vendor docs release
|
||||
|
||||
PACKAGES = $(shell go list ./... | grep -v /vendor/)
|
||||
|
||||
all: gen build
|
||||
all: gen build_static
|
||||
|
||||
deps:
|
||||
go get -u golang.org/x/tools/cmd/cover
|
||||
|
@ -24,11 +24,6 @@ gen_template:
|
|||
gen_migrations:
|
||||
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:
|
||||
go test -cover $(PACKAGES)
|
||||
|
||||
|
@ -40,9 +35,25 @@ test_mysql:
|
|||
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
|
||||
|
||||
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
|
||||
|
||||
# build the release files
|
||||
build: build_static build_cross build_tar
|
||||
|
||||
build_static:
|
||||
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
|
||||
|
|
|
@ -3,5 +3,5 @@ package model
|
|||
type Netrc struct {
|
||||
Machine string `json:"machine"`
|
||||
Login string `json:"login"`
|
||||
Password string `json:"user"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
|
8
store/datastore/init.go
Normal file
8
store/datastore/init.go
Normal file
|
@ -0,0 +1,8 @@
|
|||
// +build !cgo
|
||||
|
||||
package datastore
|
||||
|
||||
import (
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
_ "github.com/lib/pq"
|
||||
)
|
9
store/datastore/init_cgo.go
Normal file
9
store/datastore/init_cgo.go
Normal 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"
|
||||
)
|
|
@ -7,9 +7,6 @@ import (
|
|||
|
||||
"github.com/drone/drone/store"
|
||||
"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/russross/meddler"
|
||||
|
||||
|
|
Loading…
Reference in a new issue