Skip to content

Bump github.com/docker/docker from 26.0.0+incompatible to 26.1.3+incompatible #1689

Bump github.com/docker/docker from 26.0.0+incompatible to 26.1.3+incompatible

Bump github.com/docker/docker from 26.0.0+incompatible to 26.1.3+incompatible #1689

Workflow file for this run

name: pygmy
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
release:
types:
- created
schedule:
- cron: "0 0 * * *"
jobs:
basic:
runs-on: ubuntu-22.04
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Install
run: go mod download
env:
GO111MODULE: on
- name: Diff
run: diff -u <(echo -n) <(gofmt -d $(find . -not -path "./vendor/*" -name "*.go"));
- name: Vet
run: go vet $(go list ./...);
- name: Lint
run: docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.51.1 golangci-lint run -v --timeout 3m
- name: Build
run: make build
- name: Test
run: go test -v ./...
# windows:
# runs-on: windows-2019
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-go@v4
# with:
# stable: 'false'
# go-version: '1.16'
# - name: Switch Docker daemon mode to Linux
# run: Start-Process $Env:ProgramFiles\Docker\Docker\DockerCli.exe -ArgumentList "-SwitchLinuxEngine"
# - name: Build
# run: docker build -t pygmy.
# - name: Run status command
# run: builds/${PYGMY_PATH} --config examples/pygmy.basic.yml status;
# - name: Run version command
# run: builds/${PYGMY_PATH} --config examples/pygmy.basic.yml version;
full:
runs-on: ubuntu-22.04
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
stable: 'false'
go-version: '1.21'
# Establish some SSH keys.
- name: Setup SSH
run: |
eval $(ssh-agent);
ssh-keygen -t rsa -q -f "$HOME/.ssh/id_rsa" -N "";
ssh-keygen -t ed25519 -q -f "$HOME/.ssh/id_pwd" -N "passphrase";
ssh-add;
ssh-add -l;
- name: Setup git
run: git config --global url."https://github.com/".insteadOf "git@github.com:";
- name: Install
run: go mod download
env:
GO111MODULE: on
- name: Install Lando
run: |
wget https://files.devwithlando.io/lando-stable.deb;
sudo dpkg -i --ignore-depends=docker-ce lando-stable.deb;
- name: Install expect and dockerize via brew
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)";
brew install expect;
brew install dockerize;
echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH;
- name: Compile
run: |
go build -o pygmy-linux-amd64;
./pygmy-linux-amd64 version;
- name: Switch pygmy configs from vanilla to basic
run: |
./pygmy-linux-amd64 status;
./pygmy-linux-amd64 clean;
./pygmy-linux-amd64 --config examples/pygmy.basic.yml pull;
./pygmy-linux-amd64 --config examples/pygmy.basic.yml up;
sleep 10;
./pygmy-linux-amd64 --config examples/pygmy.basic.yml status;
- name: Show pygmy image versions
run: |
docker ps -a --filter "label=pygmy.name"
- name: Export configuration
run: |
./pygmy-linux-amd64 --config examples/pygmy.basic.yml export -o ./exported-config.yml
cat ./exported-config.yml
- name: Resolv file test
run: |
stat /usr/lib/systemd/resolved.conf.d/docker.amazee.io.conf;
grep "127.0.0.1" /usr/lib/systemd/resolved.conf.d/docker.amazee.io.conf;
grep "docker.amazee.io" /usr/lib/systemd/resolved.conf.d/docker.amazee.io.conf;
- name: Test JSON output
run: |
./pygmy-linux-amd64 --config examples/pygmy.basic.yml status --json > pygmy.json
cat pygmy.json | jq '.service_status["amazeeio-dnsmasq"].running' | grep 'true'
cat pygmy.json | jq '.service_status["amazeeio-dnsmasq"].image' | grep 'pygmystack/dnsmasq'
cat pygmy.json | jq '.service_status["amazeeio-haproxy"].running' | grep 'true'
cat pygmy.json | jq '.service_status["amazeeio-haproxy"].image' | grep 'ygmystack/haproxy'
cat pygmy.json | jq '.service_status["amazeeio-mailhog"].running' | grep 'true'
cat pygmy.json | jq '.service_status["amazeeio-mailhog"].image' | grep 'pygmystack/mailhog'
cat pygmy.json | jq '.service_status["amazeeio-ssh-agent"].running' | grep 'true'
cat pygmy.json | jq '.service_status["amazeeio-ssh-agent"].image' | grep 'pygmystack/ssh-agent'
- name: haproxy test
run: |
curl http://docker.amazee.io/stats | grep 'class=px' | grep 'mailhog.docker.amazee.io';
curl http://docker.amazee.io/stats | grep 'HAProxy version';
- name: dnsmasq version
run: |
docker exec amazeeio-dnsmasq sh -c 'dnsmasq -v' | grep 'Dnsmasq version'
- name: ssh version
run: |
docker exec amazeeio-ssh-agent sh -c 'ssh -V'
- name: Test the amazeeio-network for expected results
run: |
docker network inspect amazeeio-network | jq '.[].Name' | grep "amazeeio-network";
docker network inspect amazeeio-network | jq '.[].Containers' | jq '.[].Name' | grep "amazeeio-haproxy";
docker network inspect amazeeio-network | jq '.[].Containers' | jq '.[].Name' | grep "amazeeio-mailhog";
docker network inspect amazeeio-network | jq '.[].Containers' | jq '.[].Name' | grep "amazeeio-portainer";
docker network inspect amazeeio-network | jq '.[].Containers' | jq '.[].IPv4Address';
docker network inspect amazeeio-network | jq '.[].Containers' | jq '.[].IPv4Address' | grep "10.99.99.";
- name: Test for configured container tags.
run: |
docker inspect amazeeio-dnsmasq | jq '.[].Config.Labels["pygmy.hocuspocus"]' | grep "42";
docker inspect amazeeio-dnsmasq | jq '.[].Config.Labels["pygmy.abracadabra"]' | grep "1";
docker inspect amazeeio-dnsmasq | jq '.[].Config.Labels["pygmy.opensesame"]' | grep "correct";
docker inspect amazeeio-haproxy | jq '.[].Config.Labels["pygmy.hocuspocus"]' | grep "42";
docker inspect amazeeio-haproxy | jq '.[].Config.Labels["pygmy.abracadabra"]' | grep "1";
docker inspect amazeeio-haproxy | jq '.[].Config.Labels["pygmy.opensesame"]' | grep "correct";
docker inspect amazeeio-portainer | jq '.[].Config.Labels["pygmy.hocuspocus"]' | grep "42";
docker inspect amazeeio-portainer | jq '.[].Config.Labels["pygmy.abracadabra"]' | grep "1";
docker inspect amazeeio-portainer | jq '.[].Config.Labels["pygmy.opensesame"]' | grep "correct";
docker inspect amazeeio-ssh-agent | jq '.[].Config.Labels["pygmy.hocuspocus"]' | grep "42";
docker inspect amazeeio-ssh-agent | jq '.[].Config.Labels["pygmy.abracadabra"]' | grep "1";
docker inspect amazeeio-ssh-agent | jq '.[].Config.Labels["pygmy.opensesame"]' | grep "correct";
docker inspect amazeeio-mailhog | jq '.[].Config.Labels["pygmy.hocuspocus"]' | grep "42";
docker inspect amazeeio-mailhog | jq '.[].Config.Labels["pygmy.abracadabra"]' | grep "1";
docker inspect amazeeio-mailhog | jq '.[].Config.Labels["pygmy.opensesame"]' | grep "correct";
- name: Switch pygmy configs from basic to overrides
run: |
./pygmy-linux-amd64 --config examples/pygmy.basic.yml status;
./pygmy-linux-amd64 --config examples/pygmy.basic.yml clean;
./pygmy-linux-amd64 --config examples/pygmy.overrides.yml pull;
./pygmy-linux-amd64 --config examples/pygmy.overrides.yml up;
sleep 10;
./pygmy-linux-amd64 --config examples/pygmy.overrides.yml status;
- name: Test the container image overrides configuration
run: |
echo "Checking image references in started containers...";
docker container inspect amazeeio-dnsmasq | jq '.[].Config.Image' | grep "ghcr.io/pygmystack/dnsmasq:main";
docker container inspect amazeeio-haproxy | jq '.[].Config.Image' | grep 'ghcr.io/pygmystack/haproxy:main';
docker container inspect amazeeio-mailhog | jq '.[].Config.Image' | grep "ghcr.io/pygmystack/mailhog:main";
docker container inspect amazeeio-ssh-agent | jq '.[].Config.Image' | grep "ghcr.io/pygmystack/ssh-agent:main";
- name: Switch pygmy configs from overrides to vanilla
run: |
./pygmy-linux-amd64 --config examples/pygmy.overrides.yml status;
./pygmy-linux-amd64 --config examples/pygmy.overrides.yml clean;
./pygmy-linux-amd64 pull;
./pygmy-linux-amd64 up;
sleep 10;
./pygmy-linux-amd64 status;
- name: SSH Key test
id: ssh-key-test
run: |
./pygmy-linux-amd64 addkey /home/runner/.ssh/id_rsa;
sleep 10
./pygmy-linux-amd64 status;
./pygmy-linux-amd64 status | grep 'RSA';
docker run --rm -i --volumes-from amazeeio-ssh-agent ghcr.io/pygmystack/ssh-agent:latest /usr/bin/ssh-add -l | grep 'RSA';
continue-on-error: true
# - name: SSH encrypted Key test
# id: ssh-enc-key-test
# run: |
# expect -f .github/workflows/expect.exp;
# sleep 10
# ./pygmy-linux-amd64 status;
# ./pygmy-linux-amd64 status | grep 'ED25519';
# docker run --rm -i --volumes-from amazeeio-ssh-agent ghcr.io/pygmystack/ssh-agent:latest /usr/bin/ssh-add -l | grep 'ED25519';
# continue-on-error: true
# - name: Check & dump on SSH failures
# if: steps.ssh-key-test.outcome != 'success' || steps.ssh-enc-key-test.outcome != 'success'
# run: |
# docker logs amazeeio-ssh-agent
# ./pygmy-linux-amd64 export -o ./exported-config-err.yml
# cat ./exported-config-err.yml
# exit 1
- name: Clone the official examples
run: |
git clone --recurse-submodules https://github.com/uselagoon/lagoon-examples.git
- name: "[Example] Drupal Base"
run: |
cd lagoon-examples/drupal-base;
docker-compose -p drupal-base up -d;
docker-compose -p drupal-base exec -T cli composer install;
dockerize -wait http://drupal-base.docker.amazee.io:80 -timeout 10s;
curl --HEAD http://drupal-base.docker.amazee.io;
curl --HEAD http://drupal-base.docker.amazee.io | grep -i "x-lagoon";
../../pygmy-linux-amd64 status | grep '\- http://drupal-base.docker.amazee.io';
docker-compose -p drupal-base down;
docker-compose -p drupal-base rm;
cd ../../;
# - name: "[Example] Drupal Postgres"
# run: |
# cd lagoon-examples/drupal9-postgres;
# docker-compose -p drupal-postgres up -d;
# docker-compose -p drupal-postgres exec -T cli composer install;
# dockerize -wait http://drupal9-postgres.docker.amazee.io:80 -timeout 10s;
# curl --HEAD http://drupal9-postgres.docker.amazee.io;
# curl --HEAD http://drupal9-postgres.docker.amazee.io | grep -i "x-lagoon";
# ../../pygmy-linux-amd64 status | grep '\- http://drupal9-postgres.docker.amazee.io';
# docker-compose -p drupal-postgres down;
# docker-compose -p drupal-postgres rm;
# cd ../../;
# - name: Node
# run: |
# cd lagoon-examples/node-example;
# npm install;
# docker-compose -p node up -d;
# curl --HEAD http://node.docker.amazee.io;
# curl --HEAD http://node.docker.amazee.io | grep -i "x-lagoon";
# ../../pygmy-linux-amd64 --config ../../examples/pygmy.basic.yml status | grep '\- http://node.docker.amazee.io';
# docker-compose -p node down;
# docker-compose -p node rm;
# cd ../../;
- name: Lando test - running Pygmy along-side Lando
run: |
cd lagoon-examples/drupal-base;
lando start || true;
dockerize -wait http://drupal-base.lndo.site:8000 -timeout 10s;
curl --HEAD http://drupal-base.lndo.site:8000;
curl --HEAD http://drupal-base.lndo.site:8000 | grep -i "x-lagoon";
lando destroy -y;
cd ../../;
- name: Test the stop command
run: |
./pygmy-linux-amd64 down | grep 'Successfully removed amazeeio';
./pygmy-linux-amd64 status | grep '\[ \] amazeeio-' | grep 'is not running';
./pygmy-linux-amd64 status | grep 'Running as container amazeeio-' && false || true;
./pygmy-linux-amd64 --config examples/pygmy.basic.yml up;
./pygmy-linux-amd64 --config examples/pygmy.basic.yml status | grep 'Running as container amazeeio-' && true || false;
- name: Test the down command
run: |
./pygmy-linux-amd64 --config examples/pygmy.basic.yml stop | grep 'Successfully stopped amazeeio';
./pygmy-linux-amd64 --config examples/pygmy.basic.yml status | grep '\[ \] amazeeio-' | grep 'is not running';
./pygmy-linux-amd64 --config examples/pygmy.basic.yml status | grep 'Running as container amazeeio-' && false || true;
./pygmy-linux-amd64 --config examples/pygmy.basic.yml up;
./pygmy-linux-amd64 --config examples/pygmy.basic.yml status | grep 'Running as container amazeeio-' && true || false;
- name: Cowsay test
run: ./pygmy-linux-amd64 --config examples/pygmy.basic.yml up | grep 'holy ship' || true;
- name: Cleanup pygmy
run: ./pygmy-linux-amd64 --config examples/pygmy.basic.yml clean;
- name: Cleanup after tests.
run: |
docker system prune --all --force
docker volume prune --force