1
0
mirror of https://github.com/b4tman/docker-squid.git synced 2024-11-22 11:16:55 +00:00

use builded image for test

This commit is contained in:
Dmitry Belyaev 2023-03-01 15:34:59 +03:00
parent 0db0d2b19d
commit f8b9da006c
Signed by: b4tman
GPG Key ID: 41A00BF15EA7E5F3
2 changed files with 12 additions and 8 deletions

View File

@ -15,6 +15,9 @@ on:
branches: branches:
- "master" - "master"
env:
TEST_TAG: b4tman/squid:test
jobs: jobs:
test: test:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
@ -47,10 +50,10 @@ jobs:
with: with:
context: . context: .
push: false push: false
tags: b4tman/squid tags: ${{ env.TEST_TAG }}
cache-from: type=local,src=/tmp/.buildx-cache cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
outputs: type=image,name=b4tman/squid,push=false outputs: type=image,name=${{ env.TEST_TAG }},push=false
# Temp fix # Temp fix
# https://github.com/docker/build-push-action/issues/252 # https://github.com/docker/build-push-action/issues/252
@ -61,7 +64,10 @@ jobs:
mv /tmp/.buildx-cache-new /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Test image - name: Test image
run: docker-compose -f docker-compose.test.yml up sut run: docker compose -f docker-compose.test.yml up sut
- name: set base image for ssl-bump
run: sed -i "s%FROM b4tman/squid%FROM $TEST_TAG%" ssl-bump/Dockerfile
- name: Build 'ssl-bump' image - name: Build 'ssl-bump' image
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4

View File

@ -1,10 +1,7 @@
version: '2.3' version: '2.3'
services: services:
proxy: proxy:
image: squidproxy image: "${TEST_TAG}"
build:
context: .
dockerfile: Dockerfile
healthcheck: healthcheck:
test: ["CMD", "sh", "-exc", "squidclient -T 3 mgr:info 2> /dev/null | grep -qF '200 OK'"] test: ["CMD", "sh", "-exc", "squidclient -T 3 mgr:info 2> /dev/null | grep -qF '200 OK'"]
interval: 5s interval: 5s
@ -12,9 +9,10 @@ services:
retries: 5 retries: 5
start_period: 1s start_period: 1s
sut: sut:
image: squidproxy image: "${TEST_TAG}"
links: links:
- proxy - proxy
depends_on: depends_on:
- proxy - proxy
command: sh -exc "sleep 10 && squidclient -h proxy -T 3 'https://postman-echo.com/get?squidtest=ok' 2> /dev/null | grep -qF '200 OK'" command: sh -exc "sleep 10 && squidclient -h proxy -T 3 'https://postman-echo.com/get?squidtest=ok' 2> /dev/null | grep -qF '200 OK'"