Browse Source

package: Setup CI build.

master 0.1.0
Gisle Aune 6 years ago
parent
commit
8e963758cf
  1. 21
      .drone.yml
  2. 3
      .gitignore
  3. 29
      Dockerfile
  4. 26
      Gopkg.lock
  5. 38
      Gopkg.toml

21
.drone.yml

@ -0,0 +1,21 @@
workspace:
base: /go
path: src/git.aiterp.net/rpdata/logbot3
pipeline:
docker-release:
image: plugins/docker
repo: vmaple/rpdata-logbot3
auto_tag: true
secrets: [ docker_username, docker_password ]
when:
event: tag
ref: refs/tags/*
docker-release-latest:
image: plugins/docker
repo: vmaple/rpdata-logbot3
tags: latest
secrets: [ docker_username, docker_password ]
when:
event: tag
ref: refs/tags/*

3
.gitignore

@ -2,4 +2,5 @@
debug
debug.exe
logbot3
logbot3.exe
logbot3.exe
vendor/

29
Dockerfile

@ -0,0 +1,29 @@
## 1. Build Server
# Use Go 1.11
FROM golang:1.11 AS build
# Load repository into docker
WORKDIR /go/src/git.aiterp.net/rpdata/logbot3/
COPY . .
RUN rm -rf ./vendor
# Load and run dependencies
RUN go get -u github.com/golang/dep/cmd/dep
RUN dep ensure
# Build server and tools (CGO disabled to make them 100% static)
ENV CGO_ENABLED 0
RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/logbot3 .
## 2. Distribute
# Use alpine linux
FROM alpine:3.8 as main-dist
# Install certificates to enable HTTPS GET requests
RUN apk add --no-cache ca-certificates
# Copy build files into final container
COPY --from=build /binaries/* /usr/local/bin/
# The server is the main entry point
CMD ["/usr/local/bin/logbot3"]

26
Gopkg.lock

@ -0,0 +1,26 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "git.aiterp.net/gisle/irc"
packages = [
".",
"ircutil",
"isupport",
"list"
]
revision = "b4c7c5145f2e2c430d6a74035751e6d59df7ec32"
[[projects]]
name = "github.com/dgrijalva/jwt-go"
packages = ["."]
revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e"
version = "v3.2.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "7ef4c9d0736b7eb8e596036446cae5d12a8d7485db1559cfa8ade7ba1bf74263"
solver-name = "gps-cdcl"
solver-version = 1

38
Gopkg.toml

@ -0,0 +1,38 @@
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true
[[constraint]]
branch = "master"
name = "git.aiterp.net/gisle/irc"
[[constraint]]
name = "github.com/dgrijalva/jwt-go"
version = "3.2.0"
[prune]
go-tests = true
unused-packages = true
Loading…
Cancel
Save