forked from volkszaehler/volkszaehler.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'volkszaehler:master' into patch-1
- Loading branch information
Showing
116 changed files
with
1,032 additions
and
726 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: composer | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
time: "04:00" | ||
open-pull-requests-limit: 10 | ||
ignore: | ||
- dependency-name: webpatser/laravel-uuid | ||
versions: | ||
- "4.0" | ||
- dependency-name: symfony/console | ||
versions: | ||
- 5.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: "Build" | ||
|
||
# original source: https://github.com/php-pm/php-pm/blob/master/.github/workflows/continuous-integration.yml | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
build: | ||
name: "Build" | ||
runs-on: "ubuntu-22.04" | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: | ||
- "7.4" | ||
- "8.0" | ||
- "8.1" | ||
- "8.2" | ||
deps: | ||
- "normal" | ||
include: | ||
- deps: "low" | ||
php-version: "7.4" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v3" | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
extensions: "pcntl" | ||
tools: "cs2pr" | ||
# this is needed in order to remove the pcntl_ restrictions on the php-cgi SAPI | ||
ini-values: "disable_functions=" | ||
|
||
- name: "Cache dependencies installed with composer" | ||
uses: "actions/cache@v3" | ||
with: | ||
path: "~/.composer/cache" | ||
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-composer-locked-" | ||
|
||
- name: "Install dependencies with composer" | ||
run: "composer update --no-interaction --no-progress --no-suggest --prefer-dist" | ||
if: "${{ matrix.deps == 'normal' }}" | ||
|
||
- name: "Install lowest possible dependencies with composer" | ||
run: "composer update --no-interaction --no-progress --no-suggest --prefer-dist --prefer-lowest" | ||
if: "${{ matrix.deps == 'low' }}" | ||
|
||
# # Ignore CS for PHP8 until https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/4702 is merged | ||
# - name: "Run git-phpcs (for pull request)" | ||
# if: "${{ github.event_name == 'pull_request' && matrix.php-version != '8.0' }}" | ||
# run: | | ||
# CHANGED_PHP_FILES=$(git diff origin/$GITHUB_BASE_REF --name-only --diff-filter=ACMRTUXB | grep -E "\.php$" || [[ $? == 1 ]]) | ||
# php vendor/bin/php-cs-fixer fix --config=.php_cs.php --dry-run --diff -v -- $CHANGED_PHP_FILES | ||
|
||
# - name: "Run git-phpcs (for push)" | ||
# if: "${{ github.event_name != 'pull_request' && matrix.php-version != '8.0' }}" | ||
# run: | | ||
# CHANGED_PHP_FILES=$(git diff --name-only --diff-filter=ACMRTUXB HEAD~..HEAD | grep -E "\.php$" || [[ $? == 1 ]]) | ||
# php vendor/bin/php-cs-fixer fix --config=.php_cs.php --dry-run --diff -v -- $CHANGED_PHP_FILES | ||
|
||
# - name: "Run a static analysis with phpstan/phpstan" | ||
# run: "php vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr" | ||
|
||
# - name: "Run PHPUnit" | ||
# run: "vendor/bin/phpunit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: volkszaehler/volkszaehler | ||
tags: | | ||
type=sha | ||
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }} | ||
- name: Build for test | ||
uses: docker/build-push-action@v3 | ||
with: | ||
load: true | ||
tags: volkszaehler/volkszaehler | ||
cache-from: type=gha | ||
|
||
- name: Test image | ||
run: ./misc/dockertest/test-docker.sh | ||
|
||
- name: Push image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ node_modules/ | |
vendor/ | ||
lib/Model/Proxy | ||
dbcopy.yaml | ||
linux-*.Dockerfile | ||
manifest.json |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,33 @@ | ||
# Copyright (c) 2019 Andreas Goetz <[email protected]> | ||
|
||
FROM jorge07/alpine-php:7.3-dev AS builder | ||
ARG PHP_IMAGE_TAG=8.1-alpine | ||
|
||
FROM php:$PHP_IMAGE_TAG AS builder | ||
|
||
WORKDIR /vz | ||
|
||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer | ||
COPY composer.json /vz | ||
|
||
RUN composer install --no-ansi --no-scripts --no-dev --no-interaction --no-progress --optimize-autoloader | ||
RUN composer install --ignore-platform-reqs --no-ansi --no-scripts --no-dev --no-interaction --no-progress --optimize-autoloader | ||
|
||
COPY . /vz | ||
|
||
|
||
FROM jorge07/alpine-php:7.3 | ||
FROM php:$PHP_IMAGE_TAG | ||
|
||
EXPOSE 8080 | ||
EXPOSE 8082 | ||
EXPOSE 5582 | ||
|
||
RUN apk add --no-cache postgresql-libs postgresql-dev \ | ||
&& docker-php-ext-install pcntl pdo_mysql pdo_pgsql mysqli \ | ||
&& apk del postgresql-dev | ||
|
||
COPY --from=builder /vz /vz | ||
COPY --from=builder /vz/etc/config.dist.yaml /vz/etc/config.yaml | ||
|
||
# modify options.js | ||
RUN sed -i "s/url: 'api'/url: '',/" /vz/htdocs/js/options.js | ||
|
||
CMD /vz/vendor/bin/ppm start -c /vz/etc/middleware.json --static-directory /vz/htdocs --cgi-path=/usr/bin/php | ||
CMD /vz/vendor/bin/ppm start -c /vz/etc/middleware.json --static-directory /vz/htdocs --cgi-path=/usr/local/bin/php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.