Skip to content

Commit

Permalink
Merge pull request #2 from schubergphilis/v1.1.0
Browse files Browse the repository at this point in the history
Release: v1.1.0
  • Loading branch information
egonbraun authored Jun 17, 2024
2 parents 551af9c + d30cbd4 commit 649d08b
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 27 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build
env:
PROJECT_DOCKER_PLATFORMS: ${{ matrix.platforms }}
run: |
make build
- name: Test
env:
PROJECT_DOCKER_PLATFORMS: ${{ matrix.platforms }}
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@
Icon
Network Trash Folder
Temporary Items

#
# PROJECT
#

tmp/history/.bash_history
24 changes: 14 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ PROJECT_COMMIT ?= $(shell git rev-parse HEAD)
PROJECT_NAME ?= $(error PROJECT_NAME is not set)
PROJECT_VERSION ?= $(strip \
$(if \
$(shell git rev-list --tags --max-count=1), \
$(shell git describe --tags `git rev-list --tags --max-count=1`), \
$(value $CI), \
$(if \
$(shell git rev-list --tags --max-count=1), \
$(shell git describe --tags `git rev-list --tags --max-count=1`), \
$(shell git rev-parse --short HEAD) \
), \
$(shell git rev-parse --short HEAD) \
) \
)
Expand All @@ -33,7 +37,7 @@ PROJECT_VERSION ?= $(strip \
#

PROJECT_DOCKER_BUILDER := builder-$(PROJECT_NAME)
PROJECT_DOCKER_CACHE_BACKEND ?= local
PROJECT_DOCKER_CACHE_BACKEND ?= inline
PROJECT_DOCKER_HOST ?= index.docker.io
PROJECT_DOCKER_ORG ?= $(error PROJECT_DOCKER_ORG is not set)
PROJECT_DOCKER_PLATFORMS ?= linux/arm64,linux/amd64
Expand All @@ -44,7 +48,7 @@ PROJECT_DOCKER_REPOSITORY ?= $(PROJECT_NAME)
#

DEFAULT_LANG ?= C.UTF-8
DEFAULT_USER_PRIMARY_GROUP ?= developers
DEFAULT_USER_PRIMARY_GROUP ?= dev
DEFAULT_USER_SECONDARY_GROUPS ?= sudo,docker
DEFAULT_USER_SHELL ?= /bin/bash
DEFAULT_USER ?= dev
Expand Down Expand Up @@ -156,21 +160,21 @@ reset: clean
|| echo -n ""

.PHONY: test
test:
test: build
@for platform in `echo ${PROJECT_DOCKER_PLATFORMS} | tr ',' ' '`; do \
arch="$$(echo $$platform | cut -d/ -f2)"; \
echo "Testing $(PROJECT_NAME)-test:$$arch"; \
echo "Testing $(PROJECT_NAME)-$(PROJECT_VERSION)-test:$$arch"; \
docker build \
--build-arg PROJECT_NAME="$(PROJECT_NAME)" \
--build-arg PROJECT_VERSION="$(PROJECT_VERSION)-$$arch" \
--cache-from type=gha \
--cache-to type=gha,mode=max \
--cache-from "type=$(PROJECT_DOCKER_CACHE_BACKEND)" \
--cache-to "type=$(PROJECT_DOCKER_CACHE_BACKEND),mode=max" \
--file "$(SOURCE_DIR)/Dockerfile.test" \
--platform "$$platform" \
--tag "$(PROJECT_NAME)-test:$$arch" \
--tag "$(PROJECT_NAME)-test:$(PROJECT_VERSION)-$$arch" \
. \
&& docker run \
--platform "$$platform" \
--rm \
"$(PROJECT_NAME)-test:$$arch"; \
"$(PROJECT_NAME)-test:$(PROJECT_VERSION)-$$arch"; \
done
29 changes: 21 additions & 8 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ARG PROJECT_VERSION
#

ARG DEFAULT_LANG="C.UTF-8"
ARG DEFAULT_USER_PRIMARY_GROUP="developers"
ARG DEFAULT_USER_PRIMARY_GROUP="dev"
ARG DEFAULT_USER_SECONDARY_GROUPS="sudo,docker"
ARG DEFAULT_USER_SHELL="/bin/bash"
ARG DEFAULT_USER="dev"
Expand Down Expand Up @@ -78,11 +78,16 @@ RUN export DEBIAN_FRONTEND="noninteractive" \
libffi-dev \
liblzma-dev \
libncursesw5-dev \
libprocps-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
libxi-dev \
libxi6 \
libxml2-dev \
libxmlsec1-dev \
libxtst-dev \
libxtst6 \
locales \
lsb-release \
make \
Expand Down Expand Up @@ -110,9 +115,9 @@ RUN locale-gen "${DEFAULT_LANG}" \
# INSTALL DOCKER
#

ENV VERSION_DOCKER_CLI="25.0.0-1"
ENV VERSION_DOCKER_BUILDX_PLUGIN="0.12.1-1"
ENV VERSION_DOCKER_COMPOSE_PLUGIN="2.24.1-1"
ENV VERSION_DOCKER_CLI="26.1.4-1"
ENV VERSION_DOCKER_BUILDX_PLUGIN="0.14.1-1"
ENV VERSION_DOCKER_COMPOSE_PLUGIN="2.27.1-1"
ENV FILENAME_DOCKER_SUFFIX="ubuntu.${VERSION_UBUNTU}~${VERSION_UBUNTU_NAME}_${TARGETARCH}.deb"
ENV FILENAME_DOCKER_CLI="docker-ce-cli_${VERSION_DOCKER_CLI}~${FILENAME_DOCKER_SUFFIX}"
ENV FILENAME_DOCKER_BUILDX_PLUGIN="docker-buildx-plugin_${VERSION_DOCKER_BUILDX_PLUGIN}~${FILENAME_DOCKER_SUFFIX}"
Expand Down Expand Up @@ -145,7 +150,7 @@ RUN curl -sSL -o /usr/local/bin/hadolint "${URL_HADOLINT}" \
# INSTALL GIT DELTA
#

ENV VERSION_GIT_DELTA="0.16.5"
ENV VERSION_GIT_DELTA="0.17.0"
ENV FILENAME_GIT_DELTA="git-delta_${VERSION_GIT_DELTA}_${TARGETARCH}.deb"
ENV URL_GIT_DELTA_BASE="https://github.com/dandavison/delta/releases/download/${VERSION_GIT_DELTA}"
ENV URL_GIT_DELTA="${URL_GIT_DELTA_BASE}/${FILENAME_GIT_DELTA}"
Expand Down Expand Up @@ -230,13 +235,21 @@ ENV PATH="${PYENV_ROOT}/bin:$PATH"

RUN curl -fsSL https://pyenv.run | bash

#
# INSTALL RBENV
#

ENV PATH="${HOME}/.rbenv/bin:${PATH}"

RUN curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash

#
# OTHER TOOLS
#

ENV VERSION_CHECKOV="3.2.16"
ENV VERSION_POETRY="1.7.1"
ENV VERSION_PRECOMMIT="3.6.0"
ENV VERSION_CHECKOV="3.2.136"
ENV VERSION_POETRY="1.8.3"
ENV VERSION_PRECOMMIT="3.7.1"

#
# PYTHON
Expand Down
11 changes: 8 additions & 3 deletions tests/unittest.bats
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
[ "$status" -eq 0 ]
}

@test "developers is the primary group of dev user" {
run bash -c "id dev | grep -E 'gid=[0-9]+\(developers\)'"
@test "dev is the primary group of dev user" {
run bash -c "id dev | grep -E 'gid=[0-9]+\(dev\)'"
[ "$status" -eq 0 ]
}

Expand All @@ -48,7 +48,7 @@
#

@test "sudo is configured" {
run ls /etc/sudoers.d/developers
run ls /etc/sudoers.d/dev
[ "$status" -eq 0 ]
}

Expand Down Expand Up @@ -116,6 +116,11 @@
[ "$status" -eq 0 ]
}

@test "rbenv is installed" {
run which rbenv
[ "$status" -eq 0 ]
}

@test "starship is installed" {
run which starship
[ "$status" -eq 0 ]
Expand Down

0 comments on commit 649d08b

Please sign in to comment.