Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.17.0 #122

Merged
merged 35 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6fc8881
chore(deps): bump golang from 1.20.7-bullseye to 1.21.0-bullseye
dependabot[bot] Aug 9, 2023
d306e65
Merge pull request #105 from dokku/dependabot/docker/golang-1.21.0-bu…
josegonzalez Aug 9, 2023
57dc106
chore(deps): bump actions/checkout from 3 to 4
dependabot[bot] Sep 5, 2023
6cb80b9
Merge pull request #106 from dokku/dependabot/github_actions/actions/…
josegonzalez Sep 7, 2023
e8a1674
chore(deps): bump golang from 1.21.0-bullseye to 1.21.1-bullseye
dependabot[bot] Sep 7, 2023
a486c97
Merge pull request #107 from dokku/dependabot/docker/golang-1.21.1-bu…
josegonzalez Sep 7, 2023
1f7e6f0
chore(deps): bump golang from 1.21.1-bullseye to 1.21.2-bullseye
dependabot[bot] Oct 6, 2023
c4abc56
Merge pull request #110 from dokku/dependabot/docker/golang-1.21.2-bu…
josegonzalez Oct 7, 2023
9b27b56
chore(deps): bump golang from 1.21.2-bullseye to 1.21.3-bullseye
dependabot[bot] Oct 11, 2023
df607bb
Merge pull request #111 from dokku/dependabot/docker/golang-1.21.3-bu…
josegonzalez Oct 14, 2023
e3b6cdb
chore: remove support for armhf, Ubuntu Bionic, and Debian Buster
josegonzalez Oct 14, 2023
aca7c34
Merge pull request #112 from dokku/remove-unsupported-platforms
josegonzalez Oct 14, 2023
f035ff6
chore(deps): bump luizm/action-sh-checker from 0.7.0 to 0.8.0
dependabot[bot] Oct 25, 2023
791d957
Merge pull request #113 from dokku/dependabot/github_actions/luizm/ac…
josegonzalez Oct 28, 2023
41fc2cc
chore(deps): bump golang from 1.21.3-bookworm to 1.21.5-bookworm
dependabot[bot] Dec 6, 2023
ab3763f
Merge pull request #115 from dokku/dependabot/docker/golang-1.21.5-bo…
josegonzalez Dec 9, 2023
0de712e
chore(deps): bump github/codeql-action from 2 to 3
dependabot[bot] Dec 14, 2023
0882b6d
chore(deps): bump actions/upload-artifact from 3 to 4
dependabot[bot] Dec 15, 2023
7f113f8
Merge pull request #117 from dokku/dependabot/github_actions/actions/…
josegonzalez Dec 19, 2023
f5a5a51
Merge pull request #116 from dokku/dependabot/github_actions/github/c…
josegonzalez Dec 19, 2023
9fe9c03
chore(deps): bump golang from 1.21.5-bookworm to 1.21.6-bookworm
dependabot[bot] Jan 10, 2024
3e76def
Merge pull request #118 from dokku/dependabot/docker/golang-1.21.6-bo…
josegonzalez Jan 29, 2024
051e4e4
chore(deps): bump golang from 1.21.6-bookworm to 1.22.0-bookworm
dependabot[bot] Feb 7, 2024
17e0b7a
Merge pull request #119 from dokku/dependabot/docker/golang-1.22.0-bo…
josegonzalez Feb 7, 2024
719db5e
refactor: use cli-skeleton for commands
josegonzalez Aug 9, 2022
11295f1
fix: move shorthand to second place
josegonzalez Aug 9, 2022
290aed2
chore: update packages
josegonzalez Feb 9, 2024
db3fd0c
fix: handle all errors
josegonzalez Feb 9, 2024
78368ea
tests: update tests for output checking
josegonzalez Feb 9, 2024
be01a15
Merge pull request #72 from dokku/cli-skeleton
josegonzalez Feb 9, 2024
6b3bdcf
feat: add support for // as comments
josegonzalez Feb 9, 2024
133c819
Merge pull request #120 from dokku/109-backslash-comments
josegonzalez Feb 9, 2024
86106c0
docs: update comment note in procfile format
josegonzalez Feb 9, 2024
81f619d
Merge pull request #121 from dokku/josegonzalez-patch-1
josegonzalez Feb 9, 2024
0642f05
Release 0.17.0
josegonzalez Feb 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ on:
jobs:
build:
name: build
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: true
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 @@ -31,7 +31,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 = procfile-util
HARDWARE = $(shell uname -m)
SYSTEM_NAME = $(shell uname -s | tr '[:upper:]' '[:lower:]')
BASE_VERSION ?= 0.16.0
BASE_VERSION ?= 0.17.0
IMAGE_NAME ?= $(MAINTAINER)/$(REPOSITORY)
PACKAGECLOUD_REPOSITORY ?= dokku/dokku-betafish

Expand Down Expand Up @@ -47,10 +47,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 @@ -89,12 +87,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 @@ -135,26 +127,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 @@ -180,52 +152,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
4 changes: 2 additions & 2 deletions PROCFILE_FORMAT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ A Procfile is a file that was [promoted by Heroku](https://blog.heroku.com/the_n

The `procfile-util` tool expects a Procfile to be defined as one or more lines containing one of:

- a comment (preceeded by a `#` symbol)
- a comment (preceeded by a `#` symbol or two `//` characters)
- a process-type/command combination (with optional trailing whitespace or trailing comment)
- when there is a trailing comment, the `#` symbol _must_ be preceeded by one or more `whitespace` characters.
- when there is a trailing comment, the `#` symbol/`//` characters _must_ be preceeded by one or more `whitespace` characters.
- a blank line (with optional trailing whitespace)

Comments and blank lines are ignored, while process-type/command combinations look like the following:
Expand Down
100 changes: 100 additions & 0 deletions commands/check.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package commands

import (
"fmt"
"os"
"strings"

"github.com/josegonzalez/cli-skeleton/command"
"github.com/posener/complete"
flag "github.com/spf13/pflag"
)

type CheckCommand struct {
command.Meta
GlobalFlagCommand
}

func (c *CheckCommand) Name() string {
return "check"
}

func (c *CheckCommand) Synopsis() string {
return "Eats one or more lollipops"
}

func (c *CheckCommand) Help() string {
return command.CommandHelp(c)
}

func (c *CheckCommand) Examples() map[string]string {
appName := os.Getenv("CLI_APP_NAME")
return map[string]string{
"Check if the procfile is valid": fmt.Sprintf("%s %s", appName, c.Name()),
}
}

func (c *CheckCommand) Arguments() []command.Argument {
args := []command.Argument{}
return args
}

func (c *CheckCommand) AutocompleteArgs() complete.Predictor {
return complete.PredictNothing
}

func (c *CheckCommand) ParsedArguments(args []string) (map[string]command.Argument, error) {
return command.ParseArguments(args, c.Arguments())
}

func (c *CheckCommand) FlagSet() *flag.FlagSet {
f := c.Meta.FlagSet(c.Name(), command.FlagSetClient)
c.GlobalFlags(f)
return f
}

func (c *CheckCommand) AutocompleteFlags() complete.Flags {
return command.MergeAutocompleteFlags(
c.Meta.AutocompleteFlags(command.FlagSetClient),
c.AutocompleteGlobalFlags(),
complete.Flags{},
)
}

func (c *CheckCommand) Run(args []string) int {
flags := c.FlagSet()
flags.Usage = func() { c.Ui.Output(c.Help()) }
if err := flags.Parse(args); err != nil {
c.Ui.Error(err.Error())
c.Ui.Error(command.CommandErrorText(c))
return 1
}

_, err := c.ParsedArguments(flags.Args())
if err != nil {
c.Ui.Error(err.Error())
c.Ui.Error(command.CommandErrorText(c))
return 1
}

entries, err := parseProcfile(c.procfile, c.delimiter, c.strict)
if err != nil {
c.Ui.Error(err.Error())
return 1
}

if len(entries) == 0 {
c.Ui.Error("No processes defined")
return 1
}

names := []string{}
for _, entry := range entries {
names = append(names, entry.Name)
}

processNames := strings.Join(names[:], ", ")
c.Ui.Output(fmt.Sprintf("valid procfile detected %v", processNames))

return 0
}
26 changes: 0 additions & 26 deletions commands/check_command.go

This file was deleted.

Loading
Loading