Quellcode durchsuchen

Avoid some warnings in CI/CD (#9661)

Related to Docker and to PostgreSQL password.
Also updated in Makefile for ephemeral password.
Alexandre Alapetite vor 6 Stunden
Ursprung
Commit
f29edf01a8

+ 3 - 3
.github/workflows/tests.yml

@@ -24,17 +24,17 @@ jobs:
       postgres:
       postgres:
         image: postgres:19-alpine@sha256:8b0ff4cdf221f0c53d7fcda681d3b461be725c492cd881c5ec9c0ad25023f188
         image: postgres:19-alpine@sha256:8b0ff4cdf221f0c53d7fcda681d3b461be725c492cd881c5ec9c0ad25023f188
         env:
         env:
-          POSTGRES_HOST_AUTH_METHOD: trust
+          POSTGRES_PASSWORD: postgres
         ports:
         ports:
           - 127.0.0.1:5432:5432
           - 127.0.0.1:5432:5432
         options: >-
         options: >-
-          --health-cmd pg_isready
+          --health-cmd "pg_isready -U postgres"
           --health-interval 5s
           --health-interval 5s
           --health-timeout 5s
           --health-timeout 5s
           --health-retries 10
           --health-retries 10
 
 
     env:
     env:
-      FRESHRSS_TEST_PGSQL_DSN: pgsql:host=127.0.0.1;dbname=postgres;user=postgres
+      FRESHRSS_TEST_PGSQL_DSN: pgsql:host=127.0.0.1;dbname=postgres;user=postgres;password=postgres
 
 
     steps:
     steps:
     - name: Git checkout source code
     - name: Git checkout source code

+ 1 - 0
Docker/Dockerfile

@@ -13,6 +13,7 @@ RUN apt-get update && \
 	php-sqlite3 php-mysql php-pgsql && \
 	php-sqlite3 php-mysql php-pgsql && \
 	rm -rf /var/lib/apt/lists/*
 	rm -rf /var/lib/apt/lists/*
 
 
+# hadolint ignore=DL3059
 RUN mkdir -p /var/www/FreshRSS/ /run/apache2/
 RUN mkdir -p /var/www/FreshRSS/ /run/apache2/
 WORKDIR /var/www/FreshRSS
 WORKDIR /var/www/FreshRSS
 
 

+ 1 - 0
Docker/Dockerfile-Alpine

@@ -10,6 +10,7 @@ RUN apk add --no-cache \
 	php-ctype php-dom php-fileinfo php-iconv php-json php-opcache php-openssl php-phar php-session php-simplexml php-xmlwriter php-xml php-tokenizer php-zlib \
 	php-ctype php-dom php-fileinfo php-iconv php-json php-opcache php-openssl php-phar php-session php-simplexml php-xmlwriter php-xml php-tokenizer php-zlib \
 	php-pdo_sqlite php-pdo_mysql php-pdo_pgsql
 	php-pdo_sqlite php-pdo_mysql php-pdo_pgsql
 
 
+# hadolint ignore=DL3059
 RUN mkdir -p /var/www/FreshRSS /run/apache2/
 RUN mkdir -p /var/www/FreshRSS /run/apache2/
 WORKDIR /var/www/FreshRSS
 WORKDIR /var/www/FreshRSS
 
 

+ 1 - 0
Docker/Dockerfile-Arch

@@ -12,6 +12,7 @@ RUN pacman -Syu --noconfirm && pacman -S --noconfirm \
 	php-sqlite php-pgsql \
 	php-sqlite php-pgsql \
 	&& pacman -Scc --noconfirm
 	&& pacman -Scc --noconfirm
 
 
+# hadolint ignore=DL3059
 RUN mkdir -p /var/www/FreshRSS /run/httpd/
 RUN mkdir -p /var/www/FreshRSS /run/httpd/
 WORKDIR /var/www/FreshRSS
 WORKDIR /var/www/FreshRSS
 
 

+ 1 - 0
Docker/Dockerfile-Newest

@@ -12,6 +12,7 @@ RUN echo 'https://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/reposi
 	php86-ctype php86-dom php86-fileinfo php86-iconv php86-json php86-openssl php86-phar php86-session php86-simplexml php86-xmlwriter php86-xml php86-tokenizer php86-zlib \
 	php86-ctype php86-dom php86-fileinfo php86-iconv php86-json php86-openssl php86-phar php86-session php86-simplexml php86-xmlwriter php86-xml php86-tokenizer php86-zlib \
 	php86-pdo_sqlite php86-pdo_mysql php86-pdo_pgsql
 	php86-pdo_sqlite php86-pdo_mysql php86-pdo_pgsql
 
 
+# hadolint ignore=DL3059
 RUN mkdir -p /var/www/FreshRSS /run/apache2/
 RUN mkdir -p /var/www/FreshRSS /run/apache2/
 WORKDIR /var/www/FreshRSS
 WORKDIR /var/www/FreshRSS
 
 

+ 1 - 0
Docker/Dockerfile-Oldest

@@ -11,6 +11,7 @@ RUN apk add --no-cache \
 	php82-ctype php82-dom php82-fileinfo php82-iconv php82-json php82-opcache php82-openssl php82-phar php82-session php82-simplexml php82-xmlwriter php82-xml php82-tokenizer php82-zlib \
 	php82-ctype php82-dom php82-fileinfo php82-iconv php82-json php82-opcache php82-openssl php82-phar php82-session php82-simplexml php82-xmlwriter php82-xml php82-tokenizer php82-zlib \
 	php82-pdo_sqlite php82-pdo_mysql php82-pdo_pgsql
 	php82-pdo_sqlite php82-pdo_mysql php82-pdo_pgsql
 
 
+# hadolint ignore=DL3059
 RUN mkdir -p /var/www/FreshRSS /run/apache2/
 RUN mkdir -p /var/www/FreshRSS /run/apache2/
 WORKDIR /var/www/FreshRSS
 WORKDIR /var/www/FreshRSS
 
 

+ 4 - 3
Makefile

@@ -178,6 +178,7 @@ test-all: composer-test npm-test typos-test ## Run all tests
 test-all-php-versions: ## Run the test suite with every supported PHP version (Docker)
 test-all-php-versions: ## Run the test suite with every supported PHP version (Docker)
 	@set -eu; \
 	@set -eu; \
 	i=0; \
 	i=0; \
+	pg_password=$$(head -c 16 /dev/urandom | od -An -tx1 | tr -d ' \n'); \
 	$(DOCKER) rm --force freshrss-tests-db >/dev/null 2>&1 || true; \
 	$(DOCKER) rm --force freshrss-tests-db >/dev/null 2>&1 || true; \
 	$(DOCKER) network create freshrss-tests-db-network >/dev/null 2>&1 || true; \
 	$(DOCKER) network create freshrss-tests-db-network >/dev/null 2>&1 || true; \
 	cleanup() { $(DOCKER) rm --force freshrss-tests-db >/dev/null 2>&1 || true; $(DOCKER) network rm freshrss-tests-db-network >/dev/null 2>&1 || true; }; \
 	cleanup() { $(DOCKER) rm --force freshrss-tests-db >/dev/null 2>&1 || true; $(DOCKER) network rm freshrss-tests-db-network >/dev/null 2>&1 || true; }; \
@@ -185,9 +186,9 @@ test-all-php-versions: ## Run the test suite with every supported PHP version (D
 	$(DOCKER) run --detach --rm \
 	$(DOCKER) run --detach --rm \
 		--name freshrss-tests-db \
 		--name freshrss-tests-db \
 		--network freshrss-tests-db-network \
 		--network freshrss-tests-db-network \
-		--env POSTGRES_HOST_AUTH_METHOD=trust \
+		--env POSTGRES_PASSWORD=$$pg_password \
 		$(TESTS_PGSQL_IMAGE) >/dev/null; \
 		$(TESTS_PGSQL_IMAGE) >/dev/null; \
-	until $(DOCKER) exec freshrss-tests-db pg_isready >/dev/null 2>&1; do \
+	until $(DOCKER) exec freshrss-tests-db pg_isready -U postgres >/dev/null 2>&1; do \
 		i=$$((i + 1)); [ $$i -lt 30 ] || { echo 'PostgreSQL database did not become ready in time.' >&2; exit 1; }; \
 		i=$$((i + 1)); [ $$i -lt 30 ] || { echo 'PostgreSQL database did not become ready in time.' >&2; exit 1; }; \
 		sleep 1; \
 		sleep 1; \
 	done; \
 	done; \
@@ -199,7 +200,7 @@ test-all-php-versions: ## Run the test suite with every supported PHP version (D
 			--file Docker/Dockerfile-tests . ; \
 			--file Docker/Dockerfile-tests . ; \
 		$(DOCKER) run --rm \
 		$(DOCKER) run --rm \
 			--network freshrss-tests-db-network \
 			--network freshrss-tests-db-network \
-			--env FRESHRSS_TEST_PGSQL_DSN='pgsql:host=freshrss-tests-db;dbname=postgres;user=postgres' \
+			--env FRESHRSS_TEST_PGSQL_DSN="pgsql:host=freshrss-tests-db;dbname=postgres;user=postgres;password=$$pg_password" \
 			--volume $(shell pwd):/var/www/FreshRSS:z \
 			--volume $(shell pwd):/var/www/FreshRSS:z \
 			--workdir /var/www/FreshRSS \
 			--workdir /var/www/FreshRSS \
 			docker.io/freshrss/tests:php$$v \
 			docker.io/freshrss/tests:php$$v \