mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-02-24 01:38:15 +00:00
refactor(ci): ♻️ refactor makefile and modify its usage on CI
This commit is contained in:
parent
1591fd7968
commit
39f822dd8b
10
.github/workflows/test.yml
vendored
10
.github/workflows/test.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
docker_image: [alpine, debian]
|
base_docker_image: [alpine, debian]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -27,7 +27,11 @@ jobs:
|
|||||||
working-directory: test/requirements
|
working-directory: test/requirements
|
||||||
|
|
||||||
- name: Build Docker web server image
|
- name: Build Docker web server image
|
||||||
run: make update-dependencies
|
run: make build-webserver
|
||||||
|
|
||||||
|
- name: Build Docker nginx proxy test image
|
||||||
|
run: make build-nginx-proxy-test-${{ matrix.base_docker_image }}
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: make test-${{ matrix.docker_image }}
|
run: pytest
|
||||||
|
working-directory: test
|
14
Makefile
14
Makefile
@ -2,15 +2,19 @@
|
|||||||
.PHONY : test-debian test-alpine test
|
.PHONY : test-debian test-alpine test
|
||||||
|
|
||||||
|
|
||||||
update-dependencies:
|
build-webserver:
|
||||||
test/requirements/build.sh
|
docker build -t web test/requirements/web
|
||||||
|
|
||||||
test-debian: update-dependencies
|
build-nginx-proxy-test-debian:
|
||||||
docker build -t nginxproxy/nginx-proxy:test .
|
docker build -t nginxproxy/nginx-proxy:test .
|
||||||
|
|
||||||
|
build-nginx-proxy-test-alpine:
|
||||||
|
docker build -f Dockerfile.alpine -t nginxproxy/nginx-proxy:test .
|
||||||
|
|
||||||
|
test-debian: build-webserver build-nginx-proxy-test-debian
|
||||||
test/pytest.sh
|
test/pytest.sh
|
||||||
|
|
||||||
test-alpine: update-dependencies
|
test-alpine: build-webserver build-nginx-proxy-test-alpine
|
||||||
docker build -f Dockerfile.alpine -t nginxproxy/nginx-proxy:test .
|
|
||||||
test/pytest.sh
|
test/pytest.sh
|
||||||
|
|
||||||
test: test-debian test-alpine
|
test: test-debian test-alpine
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
||||||
|
|
||||||
docker build -t web $DIR/web
|
|
Loading…
x
Reference in New Issue
Block a user