From 3a613085a2abfc8548df4dc97468c5f445defe8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB?= Date: Mon, 24 May 2021 15:23:09 +0300 Subject: [PATCH] test build --- .github/workflows/php-with-supercronic.yml | 50 ++++++++++++++++++++++ LICENSE | 21 +++++++++ php-with-supercronic/Dockerfile_7.3 | 36 ++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 .github/workflows/php-with-supercronic.yml create mode 100644 LICENSE create mode 100644 php-with-supercronic/Dockerfile_7.3 diff --git a/.github/workflows/php-with-supercronic.yml b/.github/workflows/php-with-supercronic.yml new file mode 100644 index 0000000..0ee8b66 --- /dev/null +++ b/.github/workflows/php-with-supercronic.yml @@ -0,0 +1,50 @@ +name: PHP With Supercronic + +on: + push: + branches: + - $default-branch + tags: + - v* + pull_request: + +env: + IMAGE_NAME: php-with-supercronic + +jobs: + test_7_3: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: docker build . --file php-with-supercronic/Dockerfile_7.3 + push_7_3: + needs: test_7_3 + runs-on: ubuntu-latest + if: github.event_name == 'push' + permissions: + contents: read + packages: write + env: + VERSION: 7.3 + steps: + - uses: actions/checkout@v2 + - name: Build image + run: docker build php-with-supercronic --file php-with-supercronic/Dockerfile_7.3 --tag $IMAGE_NAME + - name: Log into registry + run: | + DOCKER_LOGIN=$(echo "${{ github.actor }}" | tr '[A-Z]' '[a-z]') + echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u $DOCKER_LOGIN --password-stdin + - name: Push image + run: | + IMAGE_ID=${{ github.repository_owner }}/$IMAGE_NAME + # Transform to lowercase + IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') + # Strip git ref prefix from version + BRANCH=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') + # Use Docker `latest` tag convention + [ "$BRANCH" == "$default-branch" ] && VERSION=latest + echo IMAGE_ID=$IMAGE_ID + echo VERSION=$VERSION + docker tag $IMAGE_NAME $IMAGE_ID:$VERSION + docker push $IMAGE_ID:$VERSION diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3515ae3 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Neur0toxine + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/php-with-supercronic/Dockerfile_7.3 b/php-with-supercronic/Dockerfile_7.3 new file mode 100644 index 0000000..8de9220 --- /dev/null +++ b/php-with-supercronic/Dockerfile_7.3 @@ -0,0 +1,36 @@ +FROM php:7.3-fpm-alpine + +LABEL MAINTAINER = 'Neur0toxine (pashok9825@gmail.com)' + +RUN apk --update add \ + autoconf \ + shadow \ + gcc \ + libc-dev \ + make \ + wget \ + postgresql-dev \ + libxml2-dev \ + libzip-dev \ + libpng-dev \ + libxslt-dev \ + && pecl channel-update pecl.php.net \ + && pecl install redis-5.3.1 \ + && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ + && docker-php-ext-configure pgsql -with-pgsql=/usr/include/postgresql/ \ + && docker-php-ext-configure zip --with-libzip=/usr/include \ + && docker-php-ext-configure intl \ + && docker-php-ext-install -j$(nproc) pgsql pdo_pgsql intl pcntl soap imap \ + && docker-php-ext-enable opcache redis \ + && rm -rf /var/cache/apk/* && rm -rf /etc/apk/cache \ + && curl -L https://getcomposer.org/composer-stable.phar -o /usr/bin/composer && chmod a+x /usr/bin/composer + +ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-amd64 \ + SUPERCRONIC=supercronic-linux-amd64 \ + SUPERCRONIC_SHA1SUM=048b95b48b708983effb2e5c935a1ef8483d9e3e + +RUN curl -fsSLO "$SUPERCRONIC_URL" \ + && echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic