This commit is contained in:
commit
05d80aee69
48
.drone.yml
Normal file
48
.drone.yml
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: main
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: prepare
|
||||||
|
image: docker:latest
|
||||||
|
volumes:
|
||||||
|
- name: docker-socket
|
||||||
|
path: /var/run/docker.sock
|
||||||
|
commands:
|
||||||
|
- echo 'http://dl-cdn.alpinelinux.org/alpine/edge/community' > /etc/apk/repositories
|
||||||
|
- apk update
|
||||||
|
- apk add git yq
|
||||||
|
- git clone https://github.com/drone/drone.git .
|
||||||
|
- LATEST_VERSION=$(git tag --sort v:refname | grep '^v[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}$' | tail -n 1)
|
||||||
|
- git checkout $LATEST_VERSION
|
||||||
|
- GOLANG_IMG=$(yq read .drone.yml 'steps[0].image')
|
||||||
|
- docker pull $GOLANG_IMG
|
||||||
|
- docker tag $GOLANG_IMG drone-builder:latest
|
||||||
|
- docker image rm $GOLANG_IMG
|
||||||
|
|
||||||
|
- name: compile
|
||||||
|
image: drone-builder:latest
|
||||||
|
environment:
|
||||||
|
GOARCH: amd64
|
||||||
|
GOOS: linux
|
||||||
|
commands:
|
||||||
|
- go build -ldflags "-extldflags \"-static\"" -tags nolimit -o release/linux/amd64/drone-server github.com/drone/drone/cmd/drone-server
|
||||||
|
|
||||||
|
- name: docker-build
|
||||||
|
image: docker:latest
|
||||||
|
volumes:
|
||||||
|
- name: docker-socket
|
||||||
|
path: /var/run/docker.sock
|
||||||
|
commands:
|
||||||
|
- docker build -t registry.jfmonty2.com/drone:latest -f docker/Dockerfile.server.linux.amd64 .
|
||||||
|
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: docker-socket
|
||||||
|
host:
|
||||||
|
path: /var/run/docker.sock
|
15
README.md
Normal file
15
README.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# No-limit Drone server CI pipeline
|
||||||
|
|
||||||
|
The official Docker images provided by the Drone CI project use the Enterprise version, which is
|
||||||
|
limied to a total of 5000 builds unless the server is in posession of a valid Enterprise license.
|
||||||
|
For personal or small-company (<$1M yearly revenue) use this limitation can be avoided by compiling
|
||||||
|
the Drone server with the `nolimit` tag.
|
||||||
|
|
||||||
|
This CI pipeline attempts to build the latest version of the Drone server by:
|
||||||
|
|
||||||
|
* Cloning the repository from Github
|
||||||
|
* Checking out the latest version tag
|
||||||
|
* Parsing the repository's `.drone.yml` file to determine what Golang image to use
|
||||||
|
* Compiling with the `nolimit` tag
|
||||||
|
* Building the Docker image using the included Dockerfile
|
||||||
|
* Deploying said dockerfile to a private registry
|
Loading…
x
Reference in New Issue
Block a user