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

Add CI for Docker compose and kustomize #437

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
86 changes: 86 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: CI Docker

on:
push:
branches:
- 'main'
tags:
- 'v[0-9]+'
pull_request:
paths:
- docker-compose/**
- k8s/resources/**/config/**

env:
GRIDSUITE_DATABASES: /tmp/gs_db

jobs:
verify_docker:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docker-compose
steps:
- id: checkout
name: Checkout sources
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
docker-compose
k8s
#- name: Install buildx
# uses: docker/setup-buildx-action@v3
# with:
# version: v0.9.1 # Buildx version
- name: mkdir
run: mkdir -v ./build
- name: Debug version
run: docker version --format '{{json .}}' | jq | tee ./build/docker_version.json
- name: List Docker compose profiles
working-directory: docker-compose/explicit-profiles
run: docker compose config --profiles | tee ../build/docker-compose-profiles.txt
- name: List Docker compose environment
working-directory: docker-compose/explicit-profiles
run: docker compose config --environment | tee ../build/docker-compose-environment.yml
- name: List Docker compose variables
working-directory: docker-compose/explicit-profiles
run: docker compose config --variables | tee ../build/docker-compose-variables.yml
- name: List Docker compose volumes
working-directory: docker-compose/explicit-profiles
run: docker compose config --volumes | tee ../build/docker-compose-volumes.txt
- name: List Docker compose services
working-directory: docker-compose/explicit-profiles
run: docker compose --profile all config --services | tee ../build/docker-compose-services.txt
- name: Build Docker compose for no profile
working-directory: docker-compose/explicit-profiles
run: docker compose config --output ../build/docker-compose.yml
- name: Build Docker compose for each profiles
working-directory: docker-compose/explicit-profiles
run: docker compose config --profiles | xargs -t -L 1 -I{} docker compose --profile {} config --output ../build/docker-compose.{}.yml
#- name: Verify Docker compose images
# working-directory: docker-compose/explicit-profiles
# run: docker compose --profile all config --resolve-image-digests --output ../build/docker-compose_digest.yml
- name: Build old docker-compose dynamic-mapping
working-directory: docker-compose/dynamic-mapping
run: docker compose config --output ../build/dynamic-mapping.yml
- name: Build old docker-compose merging
working-directory: docker-compose/merging
run: docker compose config --output ../build/merging.yml
- name: Build old docker-compose study
working-directory: docker-compose/study
run: docker compose config --output ../build/study.yml
- name: Build old docker-compose suite
working-directory: docker-compose/suite
run: docker compose config --output ../build/suite.yml
- name: Build old docker-compose technical
working-directory: docker-compose/technical
run: docker compose config --output ../build/technical.yml
- id: upload-artifacts
name: Save builds
uses: actions/upload-artifact@v4
with:
name: docker_builds
path: docker-compose/build/*
compression-level: 9
if-no-files-found: error
52 changes: 52 additions & 0 deletions .github/workflows/k8s.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI k8s

on:
push:
branches:
- 'main'
tags:
- 'v[0-9]+'
pull_request:
paths:
- k8s/**

jobs:
verify_k8s:
runs-on: ubuntu-latest
steps:
- id: install
name: Set up kubectl
uses: azure/setup-kubectl@v4
with:
version: latest
- id: checkout
name: Checkout sources
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
k8s
- name: mkdir
run: mkdir -v ./build
- name: Debug version
run: kubectl version --client=true --output=json | tee ./build/kubectl_version.json
- id: bake-local
name: Bake manifest of local
#uses: azure/k8s-bake@v3
run: kubectl kustomize ./k8s/live/local/ -o build/k8s-local.yml
- id: bake-azure-dev
name: Bake manifest of azure-dev
run: kubectl kustomize ./k8s/live/azure-dev/ -o build/k8s-azure-dev.yml
- id: bake-azure-integ
name: Bake manifest of azure-integ
run: kubectl kustomize ./k8s/live/azure-integ/ -o build/k8s-azure-integ.yml
# https://github.com/actions/upload-artifact/issues/3#issuecomment-620722206
# Until k8s not let us download files undividually, we upload all builds in one go
- id: upload-artifacts
name: Save builds
uses: actions/upload-artifact@v4
with:
name: kustomize_builds
path: build/*
compression-level: 9
if-no-files-found: error