move containers from .containers to containers

This commit is contained in:
kjeld Schouten-Lebbing
2021-05-30 13:02:07 +02:00
parent 15569974a0
commit c447b5b51f
99 changed files with 25 additions and 26 deletions

View File

@@ -1 +0,0 @@

View File

@@ -6,13 +6,13 @@ on:
branches:
- master
paths:
- '.containers/apps/**'
- '.containers/base/**'
- 'containers/apps/**'
- 'containers/base/**'
- ".github/workflows/containers.build.yaml"
pull_request:
paths:
- '.containers/apps/**'
- '.containers/base/**'
- 'containers/apps/**'
- 'containers/base/**'
- ".github/workflows/containers.build.yaml"
env:
@@ -35,8 +35,8 @@ jobs:
list-files: json
filters: |
changed:
- '.containers/apps/**'
- '.containers/base/**'
- 'containers/apps/**'
- 'containers/base/**'
- run: echo '${{ toJson(steps.filter.outputs) }}' > changes.json
- id: reduce
run: |
@@ -75,17 +75,17 @@ jobs:
- name: Prepare
id: prep
run: |
if test -f "./.containers/apps/${{ matrix.container }}/Dockerfile"; then
if test -f "./containers/apps/${{ matrix.container }}/Dockerfile"; then
CATEGORY="apps"
else
CATEGORY="base"
fi
echo ::set-output name=category::${CATEGORY}
VERSION=$(cat ./.containers/${CATEGORY}/${{ matrix.container }}/VERSION)
VERSION=$(cat ./containers/${CATEGORY}/${{ matrix.container }}/VERSION)
echo ::set-output name=version::${VERSION}
PLATFORM="linux/amd64"
echo ::set-output name=platform::${PLATFORM}
if test -f "./.containers/${CATEGORY}/${{ matrix.container }}/goss.yaml"; then
if test -f "./containers/${CATEGORY}/${{ matrix.container }}/goss.yaml"; then
echo ::set-output name=goss::true
else
echo ::set-output name=goss::false
@@ -136,7 +136,7 @@ jobs:
with:
build-args: VERSION=${{ steps.prep.outputs.version }}
context: .
file: ./.containers/${{ steps.prep.outputs.category }}/${{ matrix.container }}/Dockerfile
file: ./containers/${{ steps.prep.outputs.category }}/${{ matrix.container }}/Dockerfile
load: true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ matrix.container }}:test
@@ -147,7 +147,7 @@ jobs:
- name: Run GOSS tests
if: ${{ steps.prep.outputs.goss == 'true' }}
env:
GOSS_FILE: ./.containers/${{ steps.prep.outputs.category }}/${{ matrix.container }}/goss.yaml
GOSS_FILE: ./containers/${{ steps.prep.outputs.category }}/${{ matrix.container }}/goss.yaml
run: |
dgoss run ghcr.io/${{ github.repository_owner }}/${{ matrix.container }}:test
@@ -158,7 +158,7 @@ jobs:
build-args: VERSION=${{ steps.prep.outputs.version }}
context: .
platforms: ${{ steps.prep.outputs.platform }}
file: ./.containers/${{ steps.prep.outputs.category }}/${{ matrix.container }}/Dockerfile
file: ./containers/${{ steps.prep.outputs.category }}/${{ matrix.container }}/Dockerfile
push: ${{ steps.prep.outputs.push }}
tags: |
ghcr.io/${{ github.repository_owner }}/${{ matrix.container }}:latest

View File

@@ -21,19 +21,19 @@ jobs:
fetch-depth: 1
- name: Fetch new application versions
run: |
find ./.containers/apps -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | while read app; do
if test -f "./.containers/apps/${app}/latest-version.sh"; then
version=$(bash "./.containers/apps/${app}/latest-version.sh")
find ./containers/apps -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | while read app; do
if test -f "./containers/apps/${app}/latest-version.sh"; then
version=$(bash "./containers/apps/${app}/latest-version.sh")
if [[ ! -z "${version}" || "${version}" != "null" ]]; then
echo "${version}" | tee "./.containers/apps/${app}/VERSION" > /dev/null
echo "${version}" | tee "./containers/apps/${app}/VERSION" > /dev/null
echo "App: ${app} using version: ${version}"
fi
fi
if test -f "./.containers/apps/${app}/BASE"; then
if test -f "./.containers/apps/${app}/latest-base.sh"; then
base=$(bash "./.containers/apps/${app}/latest-base.sh")
if test -f "./containers/apps/${app}/BASE"; then
if test -f "./containers/apps/${app}/latest-base.sh"; then
base=$(bash "./containers/apps/${app}/latest-base.sh")
if [[ ! -z "${base}" || "${base}" != "null" ]]; then
echo "${base}" | tee ".containers/apps/${app}/BASE" > /dev/null
echo "${base}" | tee "containers/apps/${app}/BASE" > /dev/null
echo "App: ${app} using Base: ${base}"
fi
fi
@@ -41,11 +41,11 @@ jobs:
done
- name: Fetch new base versions
run: |
find ./.containers/base -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | while read app; do
if test -f "./.containers/base/${app}/latest-version.sh"; then
version=$(bash "./.containers/base/${app}/latest-version.sh")
find ./containers/base -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | while read app; do
if test -f "./containers/base/${app}/latest-version.sh"; then
version=$(bash "./containers/base/${app}/latest-version.sh")
if [[ ! -z "${version}" || "${version}" != "null" ]]; then
echo "${version}" | tee "./.containers/base/${app}/VERSION" > /dev/null
echo "${version}" | tee "./containers/base/${app}/VERSION" > /dev/null
echo "${app} ${version}"
fi
fi

View File

@@ -21,7 +21,7 @@ jobs:
with:
token: ${{ secrets.BOT_TOKEN }}
- id: set-dirs # Give it an id to handle to get step outputs in the outputs key above
run: echo "::set-output name=dir::$({ ls -d .containers/apps/*/ & ls -d .containers/base/*/; } | tr '\n' '\0' | xargs -0 -n 1 basename | jq -R -s -c 'split("\n")[:-1]')"
run: echo "::set-output name=dir::$({ ls -d containers/apps/*/ & ls -d containers/base/*/; } | tr '\n' '\0' | xargs -0 -n 1 basename | jq -R -s -c 'split("\n")[:-1]')"
# Define step output named dir base on ls command transformed to JSON thanks to jq

View File