From 8c71ec36567743dc4eb1d9b9b9b4eaba5865b360 Mon Sep 17 00:00:00 2001 From: Edie Lemoine Date: Thu, 19 Sep 2024 12:32:04 +0200 Subject: [PATCH] style: reformat files with prettier --- .act/event.json | 2 +- .github/actions/check-artifact/action.yml | 2 +- .github/dependabot.yml | 6 +-- .github/workflows/build-elasticsearch.yml | 34 ++++++------- .github/workflows/build-php-xd.yml | 6 +-- .github/workflows/build-prestashop.yml | 6 +-- .github/workflows/build-shopware.yml | 4 +- .github/workflows/build-wordpress.yml | 2 +- .github/workflows/schedule-trigger.yml | 2 +- images/elasticsearch/config/elasticsearch.yml | 2 +- images/elasticsearch/docker-compose.yml | 48 ++++++++++++------- 11 files changed, 63 insertions(+), 51 deletions(-) diff --git a/.act/event.json b/.act/event.json index 43c2f0e..176cfa8 100644 --- a/.act/event.json +++ b/.act/event.json @@ -1,3 +1,3 @@ { - "act": true + "act": true } diff --git a/.github/actions/check-artifact/action.yml b/.github/actions/check-artifact/action.yml index 7a0e9c1..a04f09a 100644 --- a/.github/actions/check-artifact/action.yml +++ b/.github/actions/check-artifact/action.yml @@ -22,7 +22,7 @@ runs: #language=bash run: | file=$(gh api "repos/$REPO/actions/artifacts" | jq ".artifacts[] | select(.name == \"$ARTIFACT_NAME\")") - + if [ -n "$file" ]; then echo "exists=true" >> $GITHUB_OUTPUT else diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5ace460..b18fd29 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,6 +1,6 @@ version: 2 updates: - - package-ecosystem: "github-actions" - directory: "/" + - package-ecosystem: 'github-actions' + directory: '/' schedule: - interval: "weekly" + interval: 'weekly' diff --git a/.github/workflows/build-elasticsearch.yml b/.github/workflows/build-elasticsearch.yml index 0fcc24b..f6cd9cc 100644 --- a/.github/workflows/build-elasticsearch.yml +++ b/.github/workflows/build-elasticsearch.yml @@ -14,12 +14,12 @@ permissions: packages: write env: - DOCKER_BUILD_PLATFORMS: 'linux/amd64,linux/arm64' - DOCKER_CACHE_MODE: 'max' - DOCKER_CACHE_SOURCE: 'scope=build-' # Will be suffixed with matrix.es-version - DOCKER_CACHE_TARGET: 'scope=build-' # Will be suffixed with matrix.es-version - DOCKER_CACHE_TYPE: 'gha' - IMAGE: 'myparcel/elasticsearch' + DOCKER_BUILD_PLATFORMS: 'linux/amd64,linux/arm64' + DOCKER_CACHE_MODE: 'max' + DOCKER_CACHE_SOURCE: 'scope=build-' # Will be suffixed with matrix.es-version + DOCKER_CACHE_TARGET: 'scope=build-' # Will be suffixed with matrix.es-version + DOCKER_CACHE_TYPE: 'gha' + IMAGE: 'myparcel/elasticsearch' UBUNTU_DISTRIB_CODENAME: 'focal' #language=json ES_MATRIX: |- @@ -41,7 +41,7 @@ env: jobs: set-matrix: runs-on: ubuntu-22.04 - outputs: { matrix: '${{ steps.set-matrix.outputs.matrix }}' } + outputs: {matrix: '${{ steps.set-matrix.outputs.matrix }}'} steps: - id: set-matrix #language=bash @@ -59,20 +59,20 @@ jobs: # Login to the Docker Hub - uses: docker/login-action@v2 - if: ${{ !env.ACT }} # Don't run when using `act`. + if: ${{ !env.ACT }} # Don't run when using `act`. with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} # Setup QEMU for cross-architecture builds - uses: docker/setup-qemu-action@v2 - if: ${{ !env.ACT }} # Don't run when using `act`. + if: ${{ !env.ACT }} # Don't run when using `act`. - uses: docker/setup-buildx-action@v2 - uses: docker/metadata-action@v3 id: meta - if: ${{ !env.ACT }} # Don't run when using `act`. + if: ${{ !env.ACT }} # Don't run when using `act`. with: images: ${{ env.IMAGE }} tags: | @@ -81,7 +81,7 @@ jobs: type=raw,value=${{ matrix.es-major }},enable=${{ github.ref == 'refs/heads/main' && matrix.es-major != '' }} type=raw,value=${{ matrix.es-minor }},enable=${{ github.ref == 'refs/heads/main' && matrix.es-minor != '' }} type=raw,value=${{ matrix.es-version }},enable=${{ github.ref == 'refs/heads/main' }} - + # Tags for branches, tags and pull requests type=ref,event=branch,suffix=-${{ matrix.es-version }},enable=${{ github.ref != 'refs/heads/main' }} type=ref,event=tag,suffix=-${{ matrix.es-version }} @@ -89,16 +89,16 @@ jobs: - uses: docker/build-push-action@v3 with: - context: images/elasticsearch + context: images/elasticsearch build-args: | ES_VERSION=${{ matrix.es-version }} UBUNTU_DISTRIB_CODENAME=${{ env.UBUNTU_DISTRIB_CODENAME }} - tags: ${{ steps.meta.outputs.tags }} - push: ${{ env.ACT != 'true' }} # Don't push when using `act`, - load: ${{ env.ACT == 'true' }} # instead load the image into the Docker daemon. - platforms: ${{ env.DOCKER_BUILD_PLATFORMS }} + tags: ${{ steps.meta.outputs.tags }} + push: ${{ env.ACT != 'true' }} # Don't push when using `act`, + load: ${{ env.ACT == 'true' }} # instead load the image into the Docker daemon. + platforms: ${{ env.DOCKER_BUILD_PLATFORMS }} cache-from: type=${{ env.DOCKER_CACHE_TYPE }},${{ env.DOCKER_CACHE_SOURCE }}${{ matrix.es-version }} - cache-to: type=${{ env.DOCKER_CACHE_TYPE }},${{ env.DOCKER_CACHE_TARGET }}${{ matrix.es-version }},mode=${{ env.DOCKER_CACHE_MODE }} + cache-to: type=${{ env.DOCKER_CACHE_TYPE }},${{ env.DOCKER_CACHE_TARGET }}${{ matrix.es-version }},mode=${{ env.DOCKER_CACHE_MODE }} notify-on-failure: needs: diff --git a/.github/workflows/build-php-xd.yml b/.github/workflows/build-php-xd.yml index 55b45da..039faef 100644 --- a/.github/workflows/build-php-xd.yml +++ b/.github/workflows/build-php-xd.yml @@ -27,9 +27,9 @@ jobs: strategy: fail-fast: false matrix: - php: [ '8.2', '8.1', '8.0', '7.4', '7.3', '7.2', '7.1' ] - alpine: [ '3.12', '3.13', '3.14', '3.15', '3.16', '3.17', '3.18', '' ] - type: [ '-fpm', '-cli', '' ] + php: ['8.2', '8.1', '8.0', '7.4', '7.3', '7.2', '7.1'] + alpine: ['3.12', '3.13', '3.14', '3.15', '3.16', '3.17', '3.18', ''] + type: ['-fpm', '-cli', ''] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/build-prestashop.yml b/.github/workflows/build-prestashop.yml index fb9e0b1..e637ec7 100644 --- a/.github/workflows/build-prestashop.yml +++ b/.github/workflows/build-prestashop.yml @@ -27,7 +27,7 @@ jobs: ps7_versions=$(echo "$versions" | jq -c 'map(select(. | startswith("1.7")))') ps8_versions=$(echo "$versions" | jq -c 'map(select(. | startswith("8")))') - + echo "ps7-matrix=$ps7_versions" >> $GITHUB_OUTPUT echo "ps8-matrix=$ps8_versions" >> $GITHUB_OUTPUT @@ -37,7 +37,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ '7.4', '7.1' ] + php: ['7.4', '7.1'] ps: ${{ fromJson(needs.prepare.outputs.ps7-matrix) }} steps: - uses: actions/checkout@v3 @@ -63,7 +63,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ '8.2', '8.1' ] + php: ['8.2', '8.1'] ps: ${{ fromJson(needs.prepare.outputs.ps8-matrix) }} steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/build-shopware.yml b/.github/workflows/build-shopware.yml index f6d308f..811721c 100644 --- a/.github/workflows/build-shopware.yml +++ b/.github/workflows/build-shopware.yml @@ -24,8 +24,8 @@ jobs: strategy: fail-fast: false matrix: - php: [ '8.1', '8.2' ] - sw: [ '6.5.0.0' ] + php: ['8.1', '8.2'] + sw: ['6.5.0.0'] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/build-wordpress.yml b/.github/workflows/build-wordpress.yml index 6a8b9df..2ac0831 100644 --- a/.github/workflows/build-wordpress.yml +++ b/.github/workflows/build-wordpress.yml @@ -36,7 +36,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ '8.2', '7.4' ] + php: ['8.2', '7.4'] wp: ${{ fromJSON(needs.prepare-wp.outputs.matrix) }} steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/schedule-trigger.yml b/.github/workflows/schedule-trigger.yml index 4acdbab..853a14a 100644 --- a/.github/workflows/schedule-trigger.yml +++ b/.github/workflows/schedule-trigger.yml @@ -54,7 +54,7 @@ jobs: #language=bash run: | gh workflow run "build-$IMAGE.yml" - + echo "Job 'build-$IMAGE' dispatched." - name: 'Release the lock' diff --git a/images/elasticsearch/config/elasticsearch.yml b/images/elasticsearch/config/elasticsearch.yml index 50b1547..df44550 100644 --- a/images/elasticsearch/config/elasticsearch.yml +++ b/images/elasticsearch/config/elasticsearch.yml @@ -1,2 +1,2 @@ -cluster.name: "docker-cluster" +cluster.name: 'docker-cluster' network.host: 0.0.0.0 diff --git a/images/elasticsearch/docker-compose.yml b/images/elasticsearch/docker-compose.yml index a38b19f..f4e1a80 100644 --- a/images/elasticsearch/docker-compose.yml +++ b/images/elasticsearch/docker-compose.yml @@ -1,32 +1,44 @@ services: elasticsearch: - image: "myparcel/elasticsearch:${DOCKER_TAG:?6.8.23}" + image: 'myparcel/elasticsearch:${DOCKER_TAG:?6.8.23}' build: - context: ./ - args: { ES_VERSION: "${ES_VERSION:?6.8.23}" } - platforms: [ linux/amd64, linux/arm64 ] + context: ./ + args: {ES_VERSION: '${ES_VERSION:?6.8.23}'} + platforms: [linux/amd64, linux/arm64] x-bake: - platforms: [ linux/amd64, linux/arm64 ] + platforms: [linux/amd64, linux/arm64] environment: - ES_HEAP_SIZE: "1024m" - ES_JAVA_OPTS: "-Xms1024m -Xmx1024m -Dlog4j2.formatMsgNoLookups=true" + ES_HEAP_SIZE: '1024m' + ES_JAVA_OPTS: '-Xms1024m -Xmx1024m -Dlog4j2.formatMsgNoLookups=true' bootstrap.memory_lock: 'true' - discovery.type: "single-node" - path.repo: &repo-path "/usr/share/elasticsearch/repo" + discovery.type: 'single-node' + path.repo: &repo-path '/usr/share/elasticsearch/repo' healthcheck: - test: ['CMD-SHELL', 'curl -s -f http://localhost:9200/_cluster/health?wait_for_status=green || exit 1'] + test: + [ + 'CMD-SHELL', + 'curl -s -f http://localhost:9200/_cluster/health?wait_for_status=green || exit 1', + ] interval: 30s - timeout: 5s + timeout: 5s start_period: 30s - retries: 3 + retries: 3 ulimits: - memlock: { soft: -1, hard: -1 } - nofile: { soft: 65536, hard: 65536 } - nproc: 65535 + memlock: {soft: -1, hard: -1} + nofile: {soft: 65536, hard: 65536} + nproc: 65535 volumes: - - { type: volume, source: elasticsearch-data, target: /usr/share/elasticsearch/data } - - { type: volume, source: elasticsearch-repo, target: *repo-path } - - { type: bind, source: ./logs, target: /usr/share/elasticsearch/logs:cached } + - { + type: volume, + source: elasticsearch-data, + target: /usr/share/elasticsearch/data, + } + - {type: volume, source: elasticsearch-repo, target: *repo-path} + - { + type: bind, + source: ./logs, + target: /usr/share/elasticsearch/logs:cached, + } volumes: elasticsearch-data: