Fix lint
This commit is contained in:
parent
30c040caf8
commit
58b5603639
8 changed files with 14 additions and 18 deletions
.github/workflows
php/nginx
swarm-connectivity-tester
10
.github/workflows/swarm-connectivity-tester.yml
vendored
10
.github/workflows/swarm-connectivity-tester.yml
vendored
|
@ -82,11 +82,6 @@ jobs:
|
|||
platforms: ${{ !env.ACT && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
|
||||
pull: true
|
||||
push: true
|
||||
build-args: |
|
||||
GIT_SHA=${{ github.sha }}
|
||||
GIT_BUILD_ID=${{ github.ref_name }}
|
||||
BUILD_DATE=${{ steps.date.outputs.container_build_datetime }}
|
||||
GIT_COMMIT_MESSAGE=${{ github.event.head_commit.message }}
|
||||
tags: |
|
||||
${{ !env.ACT && 'benzine/swarm-connectivity-tester:target' || '' }}
|
||||
${{ !env.ACT && 'ghcr.io/benzine-framework/swarm-connectivity-tester:target' || 'ghcr.io/benzine-framework/swarm-connectivity-tester:target-devel' }}
|
||||
|
@ -104,11 +99,6 @@ jobs:
|
|||
platforms: ${{ !env.ACT && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
|
||||
pull: true
|
||||
push: true
|
||||
build-args: |
|
||||
GIT_SHA=${{ github.sha }}
|
||||
GIT_BUILD_ID=${{ github.ref_name }}
|
||||
BUILD_DATE=${{ steps.date.outputs.container_build_datetime }}
|
||||
GIT_COMMIT_MESSAGE=${{ github.event.head_commit.message }}
|
||||
tags: |
|
||||
${{ !env.ACT && 'benzine/swarm-connectivity-tester:reporter' || '' }}
|
||||
${{ !env.ACT && 'ghcr.io/benzine-framework/swarm-connectivity-tester:reporter' || 'ghcr.io/benzine-framework/swarm-connectivity-tester:reporter-devel' }}
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC1083
|
||||
tail -f /var/log/php{{PHP}}-fpm.log
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC1083,SC2312
|
||||
|
||||
# Create the log file to be able to run tail without errors
|
||||
touch /var/log/php{{PHP}}-fpm.log
|
||||
|
||||
# Load envs into PHP-fpm's env.conf.
|
||||
# shellcheck disable=SC1083,SC2312
|
||||
env | sed "s/\(.*\)=\(.*\)/env[\1]='\2'/" >/etc/php/{{PHP}}/fpm/conf.d/env.conf
|
||||
|
||||
if [[ ${DEBUG_MODE,,} == "on" ]]; then
|
||||
|
|
|
@ -3,9 +3,10 @@ FROM php:nginx as connect-target
|
|||
LABEL maintainer="Matthew Baggett <matthew@baggett.me>" \
|
||||
org.label-schema.vcs-url="https://github.com/benzine-framework/docker" \
|
||||
org.opencontainers.image.source="https://github.com/benzine-framework/docker"
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
RUN echo -e "#!/bin/bash\n\ntail -f /var/log/php8.2-fpm.log" > /etc/service/logs-phpfpm-error/run && \
|
||||
chmod +x /etc/service/logs-phpfpm-error/run
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
WORKDIR /app
|
||||
HEALTHCHECK --interval=30s --timeout=3s \
|
||||
CMD curl -f http://localhost/ping.php || exit 1
|
||||
|
@ -16,9 +17,9 @@ FROM php:nginx as connect-reporter
|
|||
LABEL maintainer="Matthew Baggett <matthew@baggett.me>" \
|
||||
org.label-schema.vcs-url="https://github.com/benzine-framework/docker" \
|
||||
org.opencontainers.image.source="https://github.com/benzine-framework/docker"
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
RUN echo -e "#!/bin/bash\n\ntail -f /var/log/php8.2-fpm.log" > /etc/service/logs-phpfpm-error/run && \
|
||||
chmod +x /etc/service/logs-phpfpm-error/run
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
WORKDIR /app
|
||||
HEALTHCHECK --interval=30s --timeout=3s \
|
||||
CMD curl -f http://localhost/ping.php || exit 1
|
||||
|
|
|
@ -12,7 +12,7 @@ $targets = explode(",", $_ENV['TARGETS']);
|
|||
$targets = array_map('trim', $targets);
|
||||
|
||||
# For each $target, resolve the target to IP addresses
|
||||
foreach($targets as $target){
|
||||
foreach($targets as $target) {
|
||||
$targetIps[$target] = gethostbynamel($target) ?: [];
|
||||
$targetIps[$target] = array_values($targetIps[$target]);
|
||||
}
|
||||
|
@ -27,21 +27,21 @@ foreach ($targets as $target) {
|
|||
$responses = Utils::settle($promises)->wait();
|
||||
$rollup = true;
|
||||
$json = [];
|
||||
foreach($responses as $target => $response){
|
||||
foreach($responses as $target => $response) {
|
||||
if(!isset($response['value']) || $response['value']->getStatusCode() != 200) {
|
||||
$rollup = false;
|
||||
if ($response['reason'] instanceof \Exception) {
|
||||
$json[$target] = ['Status' => 'ERROR', 'Reason' => $response['reason']->getMessage()];
|
||||
}else {
|
||||
} else {
|
||||
$json[$target] = ['Status' => "ERROR", 'Reason' => 'Unknown'];
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
$json[$target] = json_decode($response['value']->getBody()->getContents(), true);
|
||||
}
|
||||
$json[$target]['IP'] = $targetIps[$target];
|
||||
|
||||
}
|
||||
if(!$rollup){
|
||||
if(!$rollup) {
|
||||
header("HTTP/1.0 500 Internal Server Error");
|
||||
}
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
<?php
|
||||
|
||||
echo json_encode(['Pong',]);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode([
|
||||
'Status' => 'OK',
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
<?php
|
||||
|
||||
echo json_encode(['Pong',]);
|
||||
|
|
Loading…
Reference in a new issue