Skip to content

Commit

Permalink
Merge pull request #190 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 6.2.1
  • Loading branch information
andyone authored Jul 6, 2024
2 parents 94a883c + bb3be41 commit 0e62e40
Show file tree
Hide file tree
Showing 14 changed files with 167 additions and 179 deletions.
7 changes: 3 additions & 4 deletions .docker/micro.docker
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ ARG REGISTRY="docker.io"

## BUILDER #####################################################################

FROM golang:alpine3.17 as builder
FROM ${REGISTRY}/essentialkaos/golang:alpine3.18 as builder

WORKDIR /go/src/github.com/essentialkaos/perfecto

COPY . .

# hadolint ignore=DL3018
RUN apk add --no-cache git make && make deps && make all
RUN make deps && make all

## FINAL IMAGE #################################################################

FROM ${REGISTRY}/essentialkaos/alpine:3.17
FROM ${REGISTRY}/essentialkaos/alpine:3.18

LABEL org.opencontainers.image.title="perfecto" \
org.opencontainers.image.description="Tool for checking perfectly written RPM specs" \
Expand Down
49 changes: 0 additions & 49 deletions .docker/ol7.docker

This file was deleted.

7 changes: 2 additions & 5 deletions .docker/ol8.docker
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG REGISTRY="docker.io"

## BUILDER #####################################################################

FROM ${REGISTRY}/essentialkaos/oraclelinux:8 as builder
FROM ${REGISTRY}/essentialkaos/golang:ol8 as builder

RUN mkdir -p "/go/src" && chmod -R 777 "/go"

Expand All @@ -14,10 +14,7 @@ WORKDIR /go/src/github.com/essentialkaos/perfecto

COPY . .

# hadolint ignore=DL3031,DL3041
RUN dnf -y -q install https://yum.kaos.st/kaos-repo-latest.el8.noarch.rpm && \
dnf -y -q install make golang git && \
dnf clean all && make deps && make all
RUN make deps && make all

## FINAL IMAGE #################################################################

Expand Down
7 changes: 2 additions & 5 deletions .docker/ol9.docker
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG REGISTRY="docker.io"

## BUILDER #####################################################################

FROM ${REGISTRY}/essentialkaos/oraclelinux:9 as builder
FROM ${REGISTRY}/essentialkaos/golang:ol9 as builder

RUN mkdir -p "/go/src" && chmod -R 777 "/go"

Expand All @@ -14,10 +14,7 @@ WORKDIR /go/src/github.com/essentialkaos/perfecto

COPY . .

# hadolint ignore=DL3031,DL3041
RUN dnf -y -q install https://yum.kaos.st/kaos-repo-latest.el9.noarch.rpm && \
dnf -y -q install make golang git && \
dnf clean all && make deps && make all
RUN make deps && make all

## FINAL IMAGE #################################################################

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Docker Push"
name: "CD (Release)"

on:
release:
Expand All @@ -19,16 +19,16 @@ permissions:

env:
IMAGE_NAME: ${{ github.repository }}
LATEST_IMAGE: micro
LATEST_IMAGE: ol8

jobs:
Docker:
name: Docker Build & Publish
BuildImage:
name: Image Build & Publish
runs-on: ubuntu-latest

strategy:
matrix:
image: [ 'micro', 'ol7', 'ol8', 'ol9' ]
image: [ 'micro', 'ol8', 'ol9' ]

steps:
- name: Checkout
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
git checkout "$tag"
- name: Prepare metadata for build
- name: Prepare metadata for the build
id: metadata
run: |
rev=$(git rev-list --tags --max-count=1)
Expand Down Expand Up @@ -106,13 +106,13 @@ jobs:
- name: Check if build/rebuild is required
id: build_check
run: |
if [[ "${{github.event_name}}" == "release" ]] ; then
if [[ "$GITHUB_EVENT_NAME" == "release" ]] ; then
echo "build=true" >> $GITHUB_OUTPUT
exit 0
fi
if [[ "${{ github.event.inputs.force_rebuild }}" == "true" ]] ; then
echo "::warning::Rebuild ${{matrix.image}} (reason: forced rebuild)"
echo "::warning::Rebuild ${{matrix.version}} (reason: forced rebuild)"
echo "build=true" >> $GITHUB_OUTPUT
exit 0
fi
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI (PR)

on:
pull_request:
branches: [master]
workflow_dispatch:
inputs:
force_run:
description: 'Force workflow run'
required: true
type: choice
options: [yes, no]

permissions:
actions: read
contents: read
statuses: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
CI:
uses: ./.github/workflows/ci.yml
secrets: inherit

ImageBuild:
name: Container Image Build Check
runs-on: ubuntu-latest

needs: CI

env:
REGISTRY: ghcr.io

strategy:
matrix:
image: [ 'micro', 'ol8', 'ol9' ]

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

- name: Login to DockerHub
uses: docker/login-action@v3
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
if: ${{ env.DOCKERHUB_USERNAME != '' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Docker image
run: |
docker build --build-arg REGISTRY=${REGISTRY} -f .docker/${{matrix.image}}.docker -t ${{matrix.image}} .
- name: Show info about built Docker image
uses: essentialkaos/docker-info-action@v1
with:
image: ${{matrix.image}}
show-labels: true
27 changes: 27 additions & 0 deletions .github/workflows/ci-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI (Push)

on:
push:
branches: [master, develop]
workflow_call:
workflow_dispatch:
inputs:
force_run:
description: 'Force workflow run'
required: true
type: choice
options: [yes, no]

permissions:
actions: read
contents: read
statuses: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
CI:
uses: ./.github/workflows/ci.yml
secrets: inherit
Loading

0 comments on commit 0e62e40

Please sign in to comment.