-
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.
add docker container & github actions
- Loading branch information
Showing
13 changed files
with
2,437 additions
and
176 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
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,39 @@ | ||
name: Publish Docker image | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
push_to_registry: | ||
name: Push Docker image to Docker Hub | ||
runs-on: [self-hosted] | ||
permissions: | ||
packages: write | ||
contents: read | ||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | ||
with: | ||
images: pnixx/clickhouse-queue | ||
|
||
- name: Build and push Docker image | ||
id: push | ||
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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,47 @@ | ||
name: Testing | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
tests: | ||
name: Testing | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: true | ||
max-parallel: 1 | ||
matrix: | ||
php-version: [ '8.2', '8.3' ] | ||
clickhouse: [ '24.6' ] | ||
|
||
services: | ||
rabbitmq: | ||
image: itzg/rabbitmq-stomp | ||
ports: | ||
- 61614:61613 | ||
clickhouse: | ||
image: clickhouse/clickhouse-server:${{ matrix.clickhouse }} | ||
ports: | ||
- 18123:8123 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up PHP ${{ matrix.php-version }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: sockets,pcntl,event | ||
|
||
- name: Composer install | ||
run: composer install | ||
|
||
- name: Testing | ||
run: php vendor/phpunit/phpunit/phpunit --display-warnings | ||
env: | ||
RABBIT_STOMP_PORT: 61614 | ||
CLICKHOUSE_PORT: 18123 |
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 |
---|---|---|
|
@@ -3,6 +3,5 @@ vendor/ | |
config/secrets.ini | ||
config/test_secrets.ini | ||
log/ | ||
composer.lock | ||
bin/ | ||
tmp/ |
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 @@ | ||
FROM php:8.3-cli | ||
|
||
RUN docker-php-ext-install pcntl sockets bcmath exif | ||
RUN apt-get update && apt-get -y install openssl libcurl4-openssl-dev pkg-config libssl-dev libevent-dev | ||
|
||
RUN pecl channel-update pecl.php.net && pecl install event-3.1.1 && docker-php-ext-enable --ini-name zz-event.ini event | ||
|
||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
|
||
WORKDIR /var/www/clickhouse-queue | ||
COPY . /var/www/clickhouse-queue/ | ||
|
||
RUN composer install | ||
|
||
ENTRYPOINT ["php", "examples/run.php", "start"] |
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 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.