Skip to content

Commit

Permalink
Merge pull request #115 from dokku/master
Browse files Browse the repository at this point in the history
Release 0.17.0
  • Loading branch information
josegonzalez authored Aug 6, 2023
2 parents e206572 + 549ae19 commit d219562
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 52 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@ updates:
directory: "/"
schedule:
interval: "weekly"
labels:
- "type: dependencies"
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- "type: dependencies"
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
fail-fast: true

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: extract branch name
shell: bash
run: |
if [[ "$GITHUB_REF" == *"/pull/"* ]]; then
echo "##[set-output name=branch;]${GITHUB_HEAD_REF#refs/heads/}"
echo "branch=${GITHUB_HEAD_REF#refs/heads/}" >> $GITHUB_OUTPUT
else
echo "##[set-output name=branch;]${GITHUB_REF#refs/heads/}"
echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
fi
id: extract_branch

Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
CI_BRANCH: ${{ steps.extract_branch.outputs.branch }}

- name: upload packages
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: build
path: build
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Clone
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Run hadolint
uses: hadolint/hadolint-action@d7b38582334d9ac11c12021c16f21d63015fa250
uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf
# v1.6.0 => d7b38582334d9ac11c12021c16f21d63015fa250

markdown-lint:
name: markdown-lint
runs-on: ubuntu-20.04
steps:
- name: Clone
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Run markdown-lint
uses: avto-dev/markdown-lint@04d43ee9191307b50935a753da3b775ab695eceb
# v1.5.0 => 04d43ee9191307b50935a753da3b775ab695eceb
Expand All @@ -39,9 +39,9 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Clone
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Run shellcheck
uses: ludeeus/action-shellcheck@94e0aab03ca135d11a35e5bfc14e6746dc56e7e9
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38
# 1.1.0 => 94e0aab03ca135d11a35e5bfc14e6746dc56e7e9
env:
SHELLCHECK_OPTS: -e SC2034
Expand All @@ -51,9 +51,9 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Clone
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Run shfmt
uses: luizm/action-sh-checker@7f44869033b40ee4ffe7dc76c87a1bc66e3d025a
uses: luizm/action-sh-checker@76ab0b22e1f194e4a582edc7969df6485c4e9246
# v0.3.0 => 7f44869033b40ee4ffe7dc76c87a1bc66e3d025a
env:
SHFMT_OPTS: -l -bn -ci -i 2 -d
Expand All @@ -65,9 +65,9 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Clone
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Run yamllint
uses: ibiqlik/action-yamllint@ed2b6e911569708ed121c14b87d513860a7e36a7
uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c
# v3.0.4 => ed2b6e911569708ed121c14b87d513860a7e36a7
with:
config_file: '.github/linters/.yamllint.yml'
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM golang:1.18.1-buster
FROM golang:1.20.5-buster

# hadolint ignore=DL3027
RUN apt-get update \
&& apt install apt-transport-https build-essential curl gnupg2 jq lintian rpm rsync rubygems-integration ruby-dev ruby software-properties-common sudo -qy \
&& apt install apt-transport-https build-essential curl gnupg2 jq lintian rsync rubygems-integration ruby-dev ruby software-properties-common sudo -qy \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
37 changes: 3 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MAINTAINER_NAME = Jose Diaz-Gonzalez
REPOSITORY = sshcommand
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 @@ -50,7 +50,6 @@ build: pre-build
@$(MAKE) build/darwin/$(NAME)
@$(MAKE) build/linux/$(NAME)
@$(MAKE) build/deb/$(NAME)_$(VERSION)_all.deb
@$(MAKE) build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm

build-docker-image:
docker build --rm -q -t $(IMAGE_NAME):build .
Expand Down Expand Up @@ -96,28 +95,6 @@ build/deb/$(NAME)_$(VERSION)_all.deb: build/linux/$(NAME)
build/linux/$(NAME)=/usr/bin/$(NAME) \
LICENSE=/usr/share/doc/$(NAME)/copyright

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

clean:
rm -rf build release validation

Expand All @@ -141,37 +118,29 @@ release: bin/gh-release bin/gh-release-body
tar -zcf release/$(NAME)_$(VERSION)_linux_$(HARDWARE).tgz -C build/linux $(NAME)
tar -zcf release/$(NAME)_$(VERSION)_darwin_$(HARDWARE).tgz -C build/darwin $(NAME)
cp build/deb/$(NAME)_$(VERSION)_all.deb release/$(NAME)_$(VERSION)_all.deb
cp build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm release/$(NAME)-$(VERSION)-1.x86_64.rpm
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
@$(MAKE) release-packagecloud-rpm

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

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

validate: test
mkdir -p validation
lintian build/deb/$(NAME)_$(VERSION)_all.deb || true
dpkg-deb --info build/deb/$(NAME)_$(VERSION)_all.deb
dpkg -c build/deb/$(NAME)_$(VERSION)_all.deb
cd validation && ar -x ../build/deb/$(NAME)_$(VERSION)_all.deb
cd validation && rpm2cpio ../build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm > $(NAME)-$(VERSION)-1.x86_64.cpio
ls -lah build/deb build/rpm validation
ls -lah build/deb validation
sha1sum build/deb/$(NAME)_$(VERSION)_all.deb
sha1sum build/rpm/$(NAME)-$(VERSION)-1.x86_64.rpm

test: lint unit-tests

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sshcommand",
"version": "0.16.0",
"version": "0.17.0",
"description": "Turn SSH into a thin client specifically for your app",
"global": "true",
"install": "cp sshcommand /usr/local/bin && chmod +x /usr/local/bin/sshcommand",
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/core.bats
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ check_custom_allowed_keys() {
echo "status: $status"
assert_success

run bash -c "grep -F \"$(< "${TEST_KEY_DIR}/${TEST_KEY_NAME}.pub")\" ~${TEST_USER}/.ssh/authorized_keys | grep user1"
run bash -c "grep -F \"$(<"${TEST_KEY_DIR}/${TEST_KEY_NAME}.pub")\" ~${TEST_USER}/.ssh/authorized_keys | grep user1"
echo "output: $output"
echo "status: $status"
assert_success
Expand All @@ -183,7 +183,7 @@ check_custom_allowed_keys() {
echo "status: $status"
assert_success

run bash -c "grep -F \"$(< "${TEST_KEY_DIR}/${TEST_KEY_NAME}.pub")\" ~${TEST_USER}/.ssh/authorized_keys | grep user1"
run bash -c "grep -F \"$(<"${TEST_KEY_DIR}/${TEST_KEY_NAME}.pub")\" ~${TEST_USER}/.ssh/authorized_keys | grep user1"
echo "output: $output"
echo "status: $status"
assert_failure
Expand Down

0 comments on commit d219562

Please sign in to comment.