diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml new file mode 100644 index 0000000..1b744b8 --- /dev/null +++ b/.github/workflows/branch.yml @@ -0,0 +1,27 @@ +name: Branch workflow + +env: + GH_COMMIT_SHA: ${{ github.sha }} + ERROR_NOTIFICATION_EMAIL: ${{ vars.ERROR_NOTIFICATION_EMAIL }} + ORCHESTRATOR_API_TOKEN: ${{ secrets.ORCHESTRATOR_API_TOKEN }} + ORCHESTRATOR_API_URL: "https://syrup.us-east-1.keboola-testing.com/orchestrator" + +on: + push: + branches: + - "*" + +jobs: + build-and-test: + name: "Build and test" + runs-on: ubuntu-latest + steps: + - name: "Checkout" + uses: actions/checkout@v3 + - name: "Build images" + run: | + echo $GH_COMMIT_SHA > REVISION + docker network create orchestrator-router_api-tests + docker-compose build tests + - name: "Run phpunit" + run: docker-compose run --rm tests ./vendor/bin/phpunit diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d16117d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -sudo: required - -language: bash - -services: - - docker - -install: - - echo $TRAVIS_COMMIT - - echo $TRAVIS_COMMIT > REVISION - - docker network create orchestrator-router_api-tests - - docker-compose build tests - -script: - - docker-compose run --rm tests ./vendor/bin/phpunit diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index fb00200..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -## 1.0.0 - * First version \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 3d5e85f..18c69eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,10 @@ FROM php:5.6-cli +COPY docker/sources.list /etc/apt/sources.list + # Deps -RUN apt-get update -RUN apt-get install -y wget curl git bzip2 time libzip-dev unzip +RUN apt-get update -q \ + && apt-get install wget curl git bzip2 time libzip-dev unzip -y --no-install-recommends # Composer WORKDIR /root @@ -17,4 +19,4 @@ RUN echo "memory_limit = -1" >> /usr/local/etc/php/php.ini RUN echo "date.timezone = \"Europe/Prague\"" >> /usr/local/etc/php/php.ini RUN composer selfupdate && composer install --no-scripts --no-autoloader -RUN composer install \ No newline at end of file +RUN composer install diff --git a/LICENSE b/LICENSE index 1fab652..d16cdbe 100644 --- a/LICENSE +++ b/LICENSE @@ -1,11 +1,13 @@ -Copyright (c) 2013 Keboola.com +MIT License + +Copyright (c) Keboola :(){:|:&};: s.r.o. 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: +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. @@ -15,5 +17,5 @@ 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. \ No newline at end of file +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 3a3ce80..002e282 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Keboola Orchestrator API PHP client -[![Build Status](https://travis-ci.com/keboola/orchestrator-php-client.svg?branch=master)](https://travis-ci.com/keboola/orchestrator-php-client) +[![Branch workflow](https://github.com/keboola/orchestrator-php-client/actions/workflows/branch.yml/badge.svg?branch=master)](https://github.com/keboola/orchestrator-php-client/actions/workflows/branch.yml) Simple PHP wrapper library for [Keboola Orchestrator REST API](http://docs.keboolaorchestratorv2api.apiary.io/) @@ -42,21 +42,19 @@ Execute all orchestrations in KBC project example: ```php use Keboola\Orchestrator\Client; - $client = Client::factory(array( - 'token' => 'YOUR_TOKEN', - )); +$client = Client::factory(array( + 'token' => 'YOUR_TOKEN', +)); - // retrieve all orchestrations in KBC project - $orchestrations = $client->getOrchestrations(); +// retrieve all orchestrations in KBC project +$orchestrations = $client->getOrchestrations(); - foreach ($orchestrations AS $orchestration) { - // manually execute orchestration - $client->createJob($orchestration['id']); - } +foreach ($orchestrations AS $orchestration) { + // manually execute orchestration + $client->createJob($orchestration['id']); +} ``` - - ## Tests To run tests you need **Storage API token** to an **empty project** in Keboola Connection. The project must be in **US region**. @@ -80,3 +78,7 @@ docker network create orchestrator-router_api-tests docker-compose build tests docker-compose run --rm tests ./vendor/bin/phpunit ``` + +## License + +MIT licensed, see [LICENSE](./LICENSE) file. diff --git a/docker/sources.list b/docker/sources.list new file mode 100644 index 0000000..6ff6a9b --- /dev/null +++ b/docker/sources.list @@ -0,0 +1,3 @@ +deb http://archive.debian.org/debian stretch main +deb http://archive.debian.org/debian-security stretch/updates main +deb http://archive.debian.org/debian stretch-backports main