Skip to content

Commit c270f04

Browse files
authored
Merge pull request #33 from dokku/master
Release 0.9.0
2 parents ac5534e + d81bbb3 commit c270f04

File tree

10 files changed

+1129
-89
lines changed

10 files changed

+1129
-89
lines changed

.circleci/config.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: CI
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- '*'
8+
push:
9+
branches:
10+
- 'master'
11+
- 'release'
12+
13+
jobs:
14+
build:
15+
name: build
16+
runs-on: ubuntu-18.04
17+
strategy:
18+
fail-fast: true
19+
env:
20+
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: make version
26+
run: |
27+
make version .env.docker
28+
- run: make ci-report
29+
- run: make build-docker-image
30+
- run: make build-in-docker
31+
- run: make validate-in-docker
32+
- name: upload packages
33+
uses: actions/upload-artifact@v2
34+
with:
35+
name: build
36+
path: build/**/*
37+
- name: make release-in-docker
38+
run: |
39+
if [[ "${GITHUB_REF#refs/heads/}" == "release" ]]; then
40+
export CI_BRANCH=${GITHUB_REF#refs/heads/}
41+
export PACKAGECLOUD_REPOSITORY=dokku/dokku
42+
rm .env.docker
43+
make .env.docker release-in-docker release-packagecloud-in-docker
44+
fi

.github/workflows/codeql-analysis.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ master ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ master ]
20+
schedule:
21+
- cron: '21 18 * * 3'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'go' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
37+
# Learn more:
38+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
39+
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v2
43+
44+
# Initializes the CodeQL tools for scanning.
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@v1
47+
with:
48+
languages: ${{ matrix.language }}
49+
# If you wish to specify custom queries, you can do so here or in a config file.
50+
# By default, queries listed here will override any specified in a config file.
51+
# Prefix the list here with "+" to use these queries and those in the config file.
52+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
53+
54+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55+
# If this step fails, then you should remove it and run the build manually (see below)
56+
- name: Autobuild
57+
uses: github/codeql-action/autobuild@v1
58+
59+
# ℹ️ Command-line programs to run using the OS shell.
60+
# 📚 https://git.io/JvXDl
61+
62+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63+
# and modify them (or add more) to build your code if your project
64+
# uses a compiled language
65+
66+
#- run: |
67+
# make bootstrap
68+
# make release
69+
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@v1

Dockerfile.build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
FROM golang:1.12.0-stretch
1+
FROM golang:1.17.2-buster
22

3+
# hadolint ignore=DL3027
34
RUN apt-get update \
4-
&& apt install apt-transport-https build-essential curl gnupg2 lintian rpm rsync rubygems-integration ruby-dev ruby -qy \
5+
&& apt install apt-transport-https bats build-essential curl gnupg2 lintian rpm rsync rubygems-integration ruby-dev ruby -qy \
56
&& apt-get clean \
67
&& rm -rf /var/lib/apt/lists/*
78

9+
# hadolint ignore=DL3028
810
RUN gem install --no-ri --no-rdoc --quiet rake fpm package_cloud
911

1012
WORKDIR /src

Makefile

Lines changed: 59 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ MAINTAINER_NAME = Jose Diaz-Gonzalez
55
REPOSITORY = dokku-event-listener
66
HARDWARE = $(shell uname -m)
77
SYSTEM_NAME = $(shell uname -s | tr '[:upper:]' '[:lower:]')
8-
BASE_VERSION ?= 0.7.0
8+
BASE_VERSION ?= 0.9.0
99
IMAGE_NAME ?= $(MAINTAINER)/$(REPOSITORY)
1010
PACKAGECLOUD_REPOSITORY ?= dokku/dokku-betafish
1111

12-
ifeq ($(CIRCLE_BRANCH),release)
12+
ifeq ($(CI_BRANCH),release)
1313
VERSION ?= $(BASE_VERSION)
1414
DOCKER_IMAGE_VERSION = $(VERSION)
1515
else
@@ -18,7 +18,7 @@ else
1818
endif
1919

2020
version:
21-
@echo "$(CIRCLE_BRANCH)"
21+
@echo "$(CI_BRANCH)"
2222
@echo "$(VERSION)"
2323

2424
define PACKAGE_DESCRIPTION
@@ -33,17 +33,19 @@ targets = $(addsuffix -in-docker, $(LIST))
3333
.env.docker:
3434
@rm -f .env.docker
3535
@touch .env.docker
36-
@echo "CIRCLE_BRANCH=$(CIRCLE_BRANCH)" >> .env.docker
36+
@echo "CI_BRANCH=$(CI_BRANCH)" >> .env.docker
3737
@echo "GITHUB_ACCESS_TOKEN=$(GITHUB_ACCESS_TOKEN)" >> .env.docker
3838
@echo "IMAGE_NAME=$(IMAGE_NAME)" >> .env.docker
3939
@echo "PACKAGECLOUD_REPOSITORY=$(PACKAGECLOUD_REPOSITORY)" >> .env.docker
4040
@echo "PACKAGECLOUD_TOKEN=$(PACKAGECLOUD_TOKEN)" >> .env.docker
4141
@echo "VERSION=$(VERSION)" >> .env.docker
4242

43-
build:
43+
build: prebuild
4444
@$(MAKE) build/darwin/$(NAME)
45-
@$(MAKE) build/linux/$(NAME)
45+
@$(MAKE) build/linux/$(NAME)-amd64
46+
@$(MAKE) build/linux/$(NAME)-armhf
4647
@$(MAKE) build/deb/$(NAME)_$(VERSION)_amd64.deb
48+
@$(MAKE) build/deb/$(NAME)_$(VERSION)_armhf.deb
4749
@$(MAKE) build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm
4850

4951
build-docker-image:
@@ -65,13 +67,19 @@ build/darwin/$(NAME):
6567
-ldflags "-s -w -X main.Version=$(VERSION)" \
6668
-o build/darwin/$(NAME)
6769

68-
build/linux/$(NAME):
70+
build/linux/$(NAME)-amd64:
6971
mkdir -p build/linux
7072
CGO_ENABLED=0 GOOS=linux go build -a -asmflags=-trimpath=/src -gcflags=-trimpath=/src \
7173
-ldflags "-s -w -X main.Version=$(VERSION)" \
72-
-o build/linux/$(NAME)
74+
-o build/linux/$(NAME)-amd64
7375

74-
build/deb/$(NAME)_$(VERSION)_amd64.deb: build/linux/$(NAME)
76+
build/linux/$(NAME)-armhf:
77+
mkdir -p build/linux
78+
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 go build -a -asmflags=-trimpath=/src -gcflags=-trimpath=/src \
79+
-ldflags "-s -w -X main.Version=$(VERSION)" \
80+
-o build/linux/$(NAME)-armhf
81+
82+
build/deb/$(NAME)_$(VERSION)_amd64.deb: build/linux/$(NAME)-amd64
7583
export SOURCE_DATE_EPOCH=$(shell git log -1 --format=%ct) \
7684
&& mkdir -p build/deb \
7785
&& fpm \
@@ -89,12 +97,35 @@ build/deb/$(NAME)_$(VERSION)_amd64.deb: build/linux/$(NAME)
8997
--vendor "" \
9098
--version $(VERSION) \
9199
--verbose \
92-
build/linux/$(NAME)=/usr/bin/$(NAME) \
100+
build/linux/$(NAME)-amd64=/usr/bin/$(NAME) \
93101
install/systemd.service=/etc/systemd/system/$(NAME).service \
94102
install/systemd.target=/etc/systemd/system/$(NAME).target \
95103
LICENSE=/usr/share/doc/$(NAME)/copyright
96104

97-
build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm: build/linux/$(NAME)
105+
build/deb/$(NAME)_$(VERSION)_armhf.deb: build/linux/$(NAME)-armhf
106+
export SOURCE_DATE_EPOCH=$(shell git log -1 --format=%ct) \
107+
&& mkdir -p build/deb \
108+
&& fpm \
109+
--after-install install/postinstall.sh \
110+
--architecture armhf \
111+
--category utils \
112+
--description "$$PACKAGE_DESCRIPTION" \
113+
--input-type dir \
114+
--license 'MIT License' \
115+
--maintainer "$(MAINTAINER_NAME) <$(EMAIL)>" \
116+
--name $(NAME) \
117+
--output-type deb \
118+
--package build/deb/$(NAME)_$(VERSION)_armhf.deb \
119+
--url "https://github.com/$(MAINTAINER)/$(REPOSITORY)" \
120+
--vendor "" \
121+
--version $(VERSION) \
122+
--verbose \
123+
build/linux/$(NAME)-armhf=/usr/bin/$(NAME) \
124+
install/systemd.service=/etc/systemd/system/$(NAME).service \
125+
install/systemd.target=/etc/systemd/system/$(NAME).target \
126+
LICENSE=/usr/share/doc/$(NAME)/copyright
127+
128+
build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm: build/linux/$(NAME)-amd64
98129
export SOURCE_DATE_EPOCH=$(shell git log -1 --format=%ct) \
99130
&& mkdir -p build/rpm \
100131
&& fpm \
@@ -113,15 +144,15 @@ build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm: build/linux/$(NAME)
113144
--vendor "" \
114145
--version $(VERSION) \
115146
--verbose \
116-
build/linux/$(NAME)=/usr/bin/$(NAME) \
147+
build/linux/$(NAME)-amd64=/usr/bin/$(NAME) \
117148
install/systemd.service=/etc/systemd/system/$(NAME).service \
118149
install/systemd.target=/etc/systemd/system/$(NAME).target \
119150
LICENSE=/usr/share/doc/$(NAME)/copyright
120151

121152
clean:
122153
rm -rf build release validation
123154

124-
circleci:
155+
ci-report:
125156
docker version
126157
rm -f ~/.gitconfig
127158

@@ -131,39 +162,50 @@ docker-image:
131162

132163
bin/gh-release:
133164
mkdir -p bin
134-
curl -o bin/gh-release.tgz -sL https://github.com/progrium/gh-release/releases/download/v2.2.1/gh-release_2.2.1_$(SYSTEM_NAME)_$(HARDWARE).tgz
165+
curl -o bin/gh-release.tgz -sL https://github.com/progrium/gh-release/releases/download/v2.3.3/gh-release_2.3.3_$(SYSTEM_NAME)_$(HARDWARE).tgz
135166
tar xf bin/gh-release.tgz -C bin
136167
chmod +x bin/gh-release
137168

138169
release: build bin/gh-release
139170
rm -rf release && mkdir release
140-
tar -zcf release/$(NAME)_$(VERSION)_linux_$(HARDWARE).tgz -C build/linux $(NAME)
171+
tar -zcf release/$(NAME)_$(VERSION)_linux_amd64.tgz -C build/linux $(NAME)-amd64
172+
tar -zcf release/$(NAME)_$(VERSION)_linux_armhf.tgz -C build/linux $(NAME)-armhf
141173
tar -zcf release/$(NAME)_$(VERSION)_darwin_$(HARDWARE).tgz -C build/darwin $(NAME)
142174
cp build/deb/$(NAME)_$(VERSION)_amd64.deb release/$(NAME)_$(VERSION)_amd64.deb
175+
cp build/deb/$(NAME)_$(VERSION)_armhf.deb release/$(NAME)_$(VERSION)_armhf.deb
143176
cp build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm release/$(NAME)-$(VERSION)-1.x86_64.rpm
144177
bin/gh-release create $(MAINTAINER)/$(REPOSITORY) $(VERSION) $(shell git rev-parse --abbrev-ref HEAD)
145178

146179
release-packagecloud:
147180
@$(MAKE) release-packagecloud-deb
148181
@$(MAKE) release-packagecloud-rpm
149182

150-
release-packagecloud-deb: build/deb/$(NAME)_$(VERSION)_amd64.deb
151-
package_cloud push $(PACKAGECLOUD_REPOSITORY)/ubuntu/xenial build/deb/$(NAME)_$(VERSION)_amd64.deb
183+
release-packagecloud-deb: build/deb/$(NAME)_$(VERSION)_amd64.deb build/deb/$(NAME)_$(VERSION)_armhf.deb
152184
package_cloud push $(PACKAGECLOUD_REPOSITORY)/ubuntu/bionic build/deb/$(NAME)_$(VERSION)_amd64.deb
153185
package_cloud push $(PACKAGECLOUD_REPOSITORY)/ubuntu/focal build/deb/$(NAME)_$(VERSION)_amd64.deb
154186
package_cloud push $(PACKAGECLOUD_REPOSITORY)/debian/stretch build/deb/$(NAME)_$(VERSION)_amd64.deb
155187
package_cloud push $(PACKAGECLOUD_REPOSITORY)/debian/buster build/deb/$(NAME)_$(VERSION)_amd64.deb
188+
package_cloud push $(PACKAGECLOUD_REPOSITORY)/debian/bullseye build/deb/$(NAME)_$(VERSION)_amd64.deb
189+
package_cloud push $(PACKAGECLOUD_REPOSITORY)/raspbian/buster build/deb/$(NAME)_$(VERSION)_armhf.deb
156190

157191
release-packagecloud-rpm: build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm
158192
package_cloud push $(PACKAGECLOUD_REPOSITORY)/el/7 build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm
159193

160194
validate:
161195
mkdir -p validation
162196
lintian build/deb/$(NAME)_$(VERSION)_amd64.deb || true
197+
lintian build/deb/$(NAME)_$(VERSION)_armhf.deb || true
163198
dpkg-deb --info build/deb/$(NAME)_$(VERSION)_amd64.deb
199+
dpkg-deb --info build/deb/$(NAME)_$(VERSION)_armhf.deb
164200
dpkg -c build/deb/$(NAME)_$(VERSION)_amd64.deb
201+
dpkg -c build/deb/$(NAME)_$(VERSION)_armhf.deb
165202
cd validation && ar -x ../build/deb/$(NAME)_$(VERSION)_amd64.deb
203+
cd validation && ar -x ../build/deb/$(NAME)_$(VERSION)_armhf.deb
166204
cd validation && rpm2cpio ../build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm > $(NAME)-$(VERSION)-1.x86_64.cpio
167205
ls -lah build/deb build/rpm validation
168206
sha1sum build/deb/$(NAME)_$(VERSION)_amd64.deb
207+
sha1sum build/deb/$(NAME)_$(VERSION)_armhf.deb
169208
sha1sum build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm
209+
210+
prebuild:
211+
true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# dokku-event-listener [![CircleCI](https://circleci.com/gh/dokku/dokku-event-listener.svg?style=svg)](https://circleci.com/gh/dokku/dokku-event-listener)
1+
# dokku-event-listener
22

33
Service that listens to docker events and runs dokku commands.
44

go.mod

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
module github.com/dokku/dokku-event-listener
22

3-
go 1.12
3+
go 1.16
44

55
require (
6-
github.com/containerd/containerd v1.3.3 // indirect
7-
github.com/docker/distribution v2.7.1+incompatible // indirect
8-
github.com/docker/docker v1.13.1
6+
github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795 // indirect
7+
github.com/Microsoft/go-winio v0.5.0 // indirect
8+
github.com/containerd/containerd v1.5.7 // indirect
9+
github.com/docker/docker v20.10.9+incompatible
910
github.com/docker/go-connections v0.4.0 // indirect
10-
github.com/docker/go-units v0.4.0 // indirect
11-
github.com/gogo/protobuf v1.3.1 // indirect
12-
github.com/opencontainers/go-digest v1.0.0-rc1 // indirect
13-
github.com/opencontainers/image-spec v1.0.1 // indirect
14-
github.com/rs/zerolog v1.20.0
15-
github.com/sirupsen/logrus v1.5.0 // indirect
16-
google.golang.org/grpc v1.28.1 // indirect
11+
github.com/gorilla/mux v1.8.0 // indirect
12+
github.com/morikuni/aec v1.0.0 // indirect
13+
github.com/rs/zerolog v1.25.0
14+
golang.org/x/net v0.0.0-20211008194852-3b03d305991f // indirect
15+
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac // indirect
16+
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 // indirect
17+
google.golang.org/genproto v0.0.0-20211008145708-270636b82663 // indirect
18+
google.golang.org/grpc v1.41.0 // indirect
1719
)
1820

1921
replace github.com/docker/docker => github.com/docker/engine v0.0.0-20200309214505-aa6a9891b09c

0 commit comments

Comments
 (0)