Skip to content
This repository has been archived by the owner on Dec 29, 2024. It is now read-only.

.github/workflows/cicd.yml #172

.github/workflows/cicd.yml

.github/workflows/cicd.yml #172

Workflow file for this run

env:
DOCKER_BUILDKIT: "1"
COMPOSE_DOCKER_CLI_BUILD: "1"
BUILDKIT_PROGRESS: "plain"
NO_SQUASH: ""
NO_SILENT: "1"
NONINTERACTIVE: "1"
FORCE_ONLINE: "1"
NBPARALLEL: "2"
RELEASABLE_REPOS: "^corpusops/"
RELEASABLE_BRANCHES: "^(refs/heads/)?(master|2.0|workflows)$"
COPS_URL: "https://github.com/corpusops/corpusops.bootstrap"
COPS_ROOT: "${{github.workspace}}/local/corpusops.bootstrap"
silent: "$COPS_ROOT/bin/cops_shell_common output_in_error silent_vv"
DOCKER_RELEASER: "${{ secrets.DOCKER_HUB_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}"
jobs:
r:
runs-on: ubuntu-24.04
env: {IMAGES: "${{matrix.IMAGES}}"}
steps:
- name: Set vars
run: |-
if ( echo "$GITHUB_REF" | grep -E -q "${RELEASABLE_BRANCHES}" ) \
&& ( echo "$GITHUB_REPOSITORY" | grep -E -q "${RELEASABLE_REPOS}" )
then releasable=true;else releasable=false;fi
echo "releasable=$releasable" >> $GITHUB_OUTPUT
echo "silent=$(echo $silent)" >> $GITHUB_OUTPUT
id: v
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Activate docker experimental
run: |-
sudo bash -exc "if [ ! -e /etc/docker/daemon.json ];then mkdir /etc/docker||true;echo '{}' > /etc/docker/daemon.json;fi;service docker stop;python -c \
\"d='/etc/docker/daemon.json';\
import json;c=json.load(open(d));c['experimental']=True;\
open(d, 'w').write(json.dumps(c))\"
systemctl restart docker"
- uses: actions/checkout@v3
- name: Cache multiple paths
uses: actions/cache@v3
with:
path: |
~/.cache
local
key: 6-${{ runner.os }}-${{ github.ref }}-${{ github.repository }}-venvstatics
- name: setup
run: set -e;i=$(whoami);sudo sh -c "chown -Rf $i .";
sudo sh -c 'sed -i -re 's/azure.//' /etc/apt/sources.list && apt-get update -qq' && ./main.sh refresh_corpusops;
sudo sh -c 'apt-get update -qq && apt-get install -qqy --force-yes parallel'
- name: refresh images
#rm -f */*/*/Dockerfile&&${{steps.v.outputs.silent}} ./refresh_images.sh;
run: set -e;if (echo $IMAGES|grep -q zleftover);then
rm -f */*/*/Dockerfile&&./refresh_images.sh;
fi
- name: build & release
run: set -e;
if [ "x${{steps.v.outputs.releasable}}" = "xtrue" ];then export DO_RELEASE=1;fi;
./build.sh $IMAGES
# ${{steps.v.outputs.silent}} ./build.sh $IMAGES
strategy:
max-parallel: 5
fail-fast: false
matrix:
IMAGES:
- "corpusops/postgres/16 corpusops/postgres/latest corpusops/postgis/16 corpusops/postgis/16-3 corpusops/postgis/latest"
- "corpusops/elasticsearch/5 corpusops/elasticsearch/5.6 corpusops/elasticsearch/6.8.23 corpusops/elasticsearch/7.14.2 corpusops/elasticsearch/7.17.24 corpusops/elasticsearch/8.15.1"
- "corpusops/mariadb/10 corpusops/mariadb/10.2 corpusops/mariadb/10.3 corpusops/mariadb/10.4 corpusops/mariadb/10.5 corpusops/mariadb/10.6 corpusops/mariadb/10.7 corpusops/mariadb/10.8 corpusops/mariadb/10.9"
- "corpusops/mariadb/11 corpusops/mariadb/11.0 corpusops/mariadb/11.1 corpusops/mariadb/11.2 corpusops/mariadb/11.3 corpusops/mariadb/11.4 corpusops/mariadb/11.5 corpusops/mariadb/latest corpusops/mariadb/lts"
- "corpusops/mongo/4 corpusops/mongo/5"
- "corpusops/mongo/6 corpusops/mongo/7"
- "corpusops/mongo/4"
- "corpusops/mysql/latest corpusops/mysql/oracle corpusops/mysql/debian corpusops/mysql/lts"
- "corpusops/mysql/9-oracle corpusops/mysql/9"
- "corpusops/mysql/8-debian corpusops/mysql/8-oracle corpusops/mysql/8"
- "corpusops/mysql/5-debian corpusops/mysql/5-debian"
- "corpusops/opensearch/1 corpusops/opensearch/1.0.0 corpusops/opensearch/1.0.1 corpusops/opensearch/1.1.0 corpusops/opensearch/1.2.0 corpusops/opensearch/1.2.1 corpusops/opensearch/1.2.2 corpusops/opensearch/1.2.3 corpusops/opensearch/1.2.4 corpusops/opensearch/2 corpusops/opensearch/2.4.0 corpusops/opensearch/2.15.0 corpusops/opensearch/latest"
- "corpusops/pgrouting/12 corpusops/pgrouting/12-2.5-2.6 corpusops/pgrouting/12-3 corpusops/pgrouting/12-3-3.0 corpusops/pgrouting/12-3-3.1 corpusops/pgrouting/13 corpusops/pgrouting/13-3 corpusops/pgrouting/13-3-3.0 corpusops/pgrouting/13-3-3.1 corpusops/pgrouting/13-3-3.4 corpusops/pgrouting/14-3 corpusops/pgrouting/14-3-3.4"
- "corpusops/pgrouting/15-3 corpusops/pgrouting/15-3-3.4 corpusops/pgrouting/15-3-3.5 corpusops/pgrouting/15-3-3.6"
- "corpusops/pgrouting/16-3 corpusops/pgrouting/16-3-3.4 corpusops/pgrouting/16-3-3.5 corpusops/pgrouting/16-3-3.6 corpusops/pgrouting/latest"
- "corpusops/postgis/12 corpusops/postgis/12-2.5 corpusops/postgis/12-3 corpusops/postgis/13 corpusops/postgis/13-2.5 corpusops/postgis/13-3 corpusops/postgis/14 corpusops/postgis/14-3 corpusops/postgis/15 corpusops/postgis/15-3"
- "corpusops/postgres/12 corpusops/postgres/13 corpusops/postgres/14 corpusops/postgres/15"
- "corpusops/postgres/16.0 corpusops/postgres/16.1 corpusops/postgres/16.2 corpusops/postgres/16.3 corpusops/postgres/16.4"
- "corpusops/slapd/18.04 corpusops/slapd/20.04 corpusops/slapd/22.04 corpusops/slapd/24.04 corpusops/slapd/latest"
- "corpusops/solr/5 corpusops/solr/5-alpine corpusops/solr/5-slim corpusops/solr/5.5 corpusops/solr/5.5-alpine corpusops/solr/5.5-slim corpusops/solr/6 corpusops/solr/6-alpine corpusops/solr/6-slim corpusops/solr/6.6 corpusops/solr/6.6-alpine corpusops/solr/6.6-slim corpusops/solr/7"
- "corpusops/solr/7-alpine corpusops/solr/7-slim corpusops/solr/7.7 corpusops/solr/7.7-alpine corpusops/solr/7.7-slim corpusops/solr/8 corpusops/solr/8-alpine corpusops/solr/8-slim corpusops/solr/8.9 corpusops/solr/8.9-slim corpusops/solr/alpine corpusops/solr/latest corpusops/solr/slim"
#- "corpusops/test/a corpusops/test/b corpusops/test/c"
# all images that werent explicitly told to be built would be built in the next batches
# we span them onto N jobs
- "zleftover:1/8"
- "zleftover:2/8"
- "zleftover:3/8"
- "zleftover:4/8"
- "zleftover:5/8"
- "zleftover:6/8"
- "zleftover:7/8"
- "zleftover:8/8"
on:
push:
workflow_dispatch:
schedule: [{cron: '1 0 1,3,5,15,17,19 * *'}]