Skip to content

Commit

Permalink
Merge pull request #76 from dokku/master
Browse files Browse the repository at this point in the history
Release 0.2.0
  • Loading branch information
josegonzalez authored Feb 8, 2024
2 parents e2008dd + 8e86ee3 commit 5ba442c
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 92 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ on:
jobs:
build:
name: build
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: make version
run: |
make version .env.docker
Expand All @@ -29,7 +29,7 @@ jobs:
- run: make build-in-docker
- run: make validate-in-docker
- name: upload packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build
path: build/**/*
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
22 changes: 11 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ on:
jobs:
hadolint:
name: hadolint
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run hadolint
uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf
# v1.5.0 => c27bd9edc1e95eed30474db8f295ff5807ebca14

markdown-lint:
name: markdown-lint
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run markdown-lint
uses: avto-dev/markdown-lint@04d43ee9191307b50935a753da3b775ab695eceb
# v1.5.0 => 04d43ee9191307b50935a753da3b775ab695eceb
Expand All @@ -36,23 +36,23 @@ jobs:

shellcheck:
name: shellcheck
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run shellcheck
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38
# 1.1.0 => 94e0aab03ca135d11a35e5bfc14e6746dc56e7e9
env:
SHELLCHECK_OPTS: -s bash
shfmt:
name: shfmt
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run shfmt
uses: luizm/action-sh-checker@76ab0b22e1f194e4a582edc7969df6485c4e9246
uses: luizm/action-sh-checker@c6edb3de93e904488b413636d96c6a56e3ad671a
# v0.3.0 => 7f44869033b40ee4ffe7dc76c87a1bc66e3d025a
env:
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
Expand All @@ -63,10 +63,10 @@ jobs:

yamllint:
name: yamllint
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run yamllint
uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c
# v3.0.2 => c19bd0523a9011c3a3960fe6640a0882b59af15d
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20.7-bullseye
FROM golang:1.22.0-bookworm

# hadolint ignore=DL3027
RUN apt-get update \
Expand Down
45 changes: 2 additions & 43 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MAINTAINER_NAME = Jose Diaz-Gonzalez
REPOSITORY = docker-run-export
HARDWARE = $(shell uname -m)
SYSTEM_NAME = $(shell uname -s | tr '[:upper:]' '[:lower:]')
BASE_VERSION ?= 0.1.0
BASE_VERSION ?= 0.2.0
IMAGE_NAME ?= $(MAINTAINER)/$(REPOSITORY)
PACKAGECLOUD_REPOSITORY ?= dokku/dokku-betafish

Expand Down Expand Up @@ -46,10 +46,8 @@ build: prebuild
@$(MAKE) build/darwin/$(NAME)-arm64
@$(MAKE) build/linux/$(NAME)-amd64
@$(MAKE) build/linux/$(NAME)-arm64
@$(MAKE) build/linux/$(NAME)-armhf
@$(MAKE) build/deb/$(NAME)_$(VERSION)_amd64.deb
@$(MAKE) build/deb/$(NAME)_$(VERSION)_arm64.deb
@$(MAKE) build/deb/$(NAME)_$(VERSION)_armhf.deb

build-docker-image:
docker build --rm -q -f Dockerfile -t $(IMAGE_NAME):build .
Expand Down Expand Up @@ -88,12 +86,6 @@ build/linux/$(NAME)-arm64:
-ldflags "-s -w -X main.Version=$(VERSION)" \
-o build/linux/$(NAME)-arm64

build/linux/$(NAME)-armhf:
mkdir -p build/linux
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 go build -a -asmflags=-trimpath=/src -gcflags=-trimpath=/src \
-ldflags "-s -w -X main.Version=$(VERSION)" \
-o build/linux/$(NAME)-armhf

build/deb/$(NAME)_$(VERSION)_amd64.deb: build/linux/$(NAME)-amd64
export SOURCE_DATE_EPOCH=$(shell git log -1 --format=%ct) \
&& mkdir -p build/deb \
Expand Down Expand Up @@ -134,26 +126,6 @@ build/deb/$(NAME)_$(VERSION)_arm64.deb: build/linux/$(NAME)-arm64
build/linux/$(NAME)-arm64=/usr/bin/$(NAME) \
LICENSE=/usr/share/doc/$(NAME)/copyright

build/deb/$(NAME)_$(VERSION)_armhf.deb: build/linux/$(NAME)-armhf
export SOURCE_DATE_EPOCH=$(shell git log -1 --format=%ct) \
&& mkdir -p build/deb \
&& fpm \
--architecture armhf \
--category utils \
--description "$$PACKAGE_DESCRIPTION" \
--input-type dir \
--license 'MIT License' \
--maintainer "$(MAINTAINER_NAME) <$(EMAIL)>" \
--name $(NAME) \
--output-type deb \
--package build/deb/$(NAME)_$(VERSION)_armhf.deb \
--url "https://github.com/$(MAINTAINER)/$(REPOSITORY)" \
--vendor "" \
--version $(VERSION) \
--verbose \
build/linux/$(NAME)-armhf=/usr/bin/$(NAME) \
LICENSE=/usr/share/doc/$(NAME)/copyright

clean:
rm -rf build release validation

Expand All @@ -179,52 +151,39 @@ release: build bin/gh-release bin/gh-release-body
rm -rf release && mkdir release
tar -zcf release/$(NAME)_$(VERSION)_linux_amd64.tgz -C build/linux $(NAME)-amd64
tar -zcf release/$(NAME)_$(VERSION)_linux_arm64.tgz -C build/linux $(NAME)-arm64
tar -zcf release/$(NAME)_$(VERSION)_linux_armhf.tgz -C build/linux $(NAME)-armhf
tar -zcf release/$(NAME)_$(VERSION)_darwin_amd64.tgz -C build/darwin $(NAME)-amd64
tar -zcf release/$(NAME)_$(VERSION)_darwin_arm64.tgz -C build/darwin $(NAME)-arm64
cp build/deb/$(NAME)_$(VERSION)_amd64.deb release/$(NAME)_$(VERSION)_amd64.deb
cp build/deb/$(NAME)_$(VERSION)_arm64.deb release/$(NAME)_$(VERSION)_arm64.deb
cp build/deb/$(NAME)_$(VERSION)_armhf.deb release/$(NAME)_$(VERSION)_armhf.deb
bin/gh-release create $(MAINTAINER)/$(REPOSITORY) $(VERSION) $(shell git rev-parse --abbrev-ref HEAD)
bin/gh-release-body $(MAINTAINER)/$(REPOSITORY) v$(VERSION)

release-packagecloud:
@$(MAKE) release-packagecloud-deb

release-packagecloud-deb: build/deb/$(NAME)_$(VERSION)_amd64.deb build/deb/$(NAME)_$(VERSION)_arm64.deb build/deb/$(NAME)_$(VERSION)_armhf.deb
package_cloud push $(PACKAGECLOUD_REPOSITORY)/ubuntu/bionic build/deb/$(NAME)_$(VERSION)_amd64.deb
release-packagecloud-deb: build/deb/$(NAME)_$(VERSION)_amd64.deb build/deb/$(NAME)_$(VERSION)_arm64.deb
package_cloud push $(PACKAGECLOUD_REPOSITORY)/ubuntu/focal build/deb/$(NAME)_$(VERSION)_amd64.deb
package_cloud push $(PACKAGECLOUD_REPOSITORY)/ubuntu/jammy build/deb/$(NAME)_$(VERSION)_amd64.deb
package_cloud push $(PACKAGECLOUD_REPOSITORY)/debian/buster build/deb/$(NAME)_$(VERSION)_amd64.deb
package_cloud push $(PACKAGECLOUD_REPOSITORY)/debian/bullseye build/deb/$(NAME)_$(VERSION)_amd64.deb
package_cloud push $(PACKAGECLOUD_REPOSITORY)/debian/bookworm build/deb/$(NAME)_$(VERSION)_amd64.deb
package_cloud push $(PACKAGECLOUD_REPOSITORY)/ubuntu/focal build/deb/$(NAME)_$(VERSION)_arm64.deb
package_cloud push $(PACKAGECLOUD_REPOSITORY)/ubuntu/jammy build/deb/$(NAME)_$(VERSION)_arm64.deb
package_cloud push $(PACKAGECLOUD_REPOSITORY)/debian/bullseye build/deb/$(NAME)_$(VERSION)_arm64.deb
package_cloud push $(PACKAGECLOUD_REPOSITORY)/debian/bookworm build/deb/$(NAME)_$(VERSION)_arm64.deb
package_cloud push $(PACKAGECLOUD_REPOSITORY)/ubuntu/focal build/deb/$(NAME)_$(VERSION)_armhf.deb
package_cloud push $(PACKAGECLOUD_REPOSITORY)/ubuntu/jammy build/deb/$(NAME)_$(VERSION)_armhf.deb
package_cloud push $(PACKAGECLOUD_REPOSITORY)/raspbian/buster build/deb/$(NAME)_$(VERSION)_armhf.deb
package_cloud push $(PACKAGECLOUD_REPOSITORY)/raspbian/bullseye build/deb/$(NAME)_$(VERSION)_armhf.deb

validate:
mkdir -p validation
lintian build/deb/$(NAME)_$(VERSION)_amd64.deb || true
lintian build/deb/$(NAME)_$(VERSION)_arm64.deb || true
lintian build/deb/$(NAME)_$(VERSION)_armhf.deb || true
dpkg-deb --info build/deb/$(NAME)_$(VERSION)_amd64.deb
dpkg-deb --info build/deb/$(NAME)_$(VERSION)_arm64.deb
dpkg-deb --info build/deb/$(NAME)_$(VERSION)_armhf.deb
dpkg -c build/deb/$(NAME)_$(VERSION)_amd64.deb
dpkg -c build/deb/$(NAME)_$(VERSION)_arm64.deb
dpkg -c build/deb/$(NAME)_$(VERSION)_armhf.deb
cd validation && ar -x ../build/deb/$(NAME)_$(VERSION)_amd64.deb
cd validation && ar -x ../build/deb/$(NAME)_$(VERSION)_arm64.deb
cd validation && ar -x ../build/deb/$(NAME)_$(VERSION)_armhf.deb
ls -lah build/deb validation
sha1sum build/deb/$(NAME)_$(VERSION)_amd64.deb
sha1sum build/deb/$(NAME)_$(VERSION)_arm64.deb
sha1sum build/deb/$(NAME)_$(VERSION)_armhf.deb
bats test.bats

prebuild:
Expand Down
17 changes: 9 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module docker-run-export
go 1.19

require (
github.com/compose-spec/compose-go v1.17.0
github.com/compose-spec/compose-go v1.20.2
github.com/docker/go-units v0.5.0
github.com/hashicorp/go-multierror v1.1.1
github.com/josegonzalez/cli-skeleton v0.9.0
github.com/josegonzalez/cli-skeleton v0.15.0
github.com/mattn/go-shellwords v1.0.12
github.com/mitchellh/cli v1.1.5
github.com/posener/complete v1.2.3
Expand All @@ -20,29 +20,30 @@ require (
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/distribution/distribution/v3 v3.0.0-20230214150026-36d8c594d7aa // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rs/zerolog v1.29.1 // indirect
github.com/rs/zerolog v1.32.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/term v0.16.0 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 5ba442c

Please sign in to comment.