Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions azure-pipelines.tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ resources:
type: github
endpoint: keboola
name: keboola/configuration-variables-resolver
- repository: encryption-api-php-client
type: github
endpoint: keboola
name: keboola/encryption-api-php-client
- repository: input-mapping
type: github
endpoint: keboola
Expand Down Expand Up @@ -58,6 +62,10 @@ resources:
type: github
endpoint: keboola
name: keboola/settle
- repository: slicer
type: github
endpoint: keboola
name: keboola/slicer
- repository: staging-provider
type: github
endpoint: keboola
Expand All @@ -66,10 +74,6 @@ resources:
type: github
endpoint: keboola
name: keboola/vault-api-php-client
- repository: slicer
type: github
endpoint: keboola
name: keboola/slicer

variables:
DOCKER_BUILDKIT: 1
Expand Down Expand Up @@ -100,6 +104,14 @@ jobs:
libraryPath: libs/configuration-variables-resolver
tagPrefix: configuration-variables-resolver/

- template: azure-pipelines/jobs/split-library.yml
parameters:
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/encryption-api-client/')
sourceRepo: platform-libraries
targetRepo: encryption-api-php-client
libraryPath: libs/encryption-api-client
tagPrefix: encryption-api-client/

- template: azure-pipelines/jobs/split-library.yml
parameters:
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/input-mapping/')
Expand Down Expand Up @@ -172,6 +184,14 @@ jobs:
libraryPath: libs/settle
tagPrefix: settle/

- template: azure-pipelines/jobs/split-library.yml
parameters:
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/slicer/')
sourceRepo: platform-libraries
targetRepo: slicer
libraryPath: libs/slicer
tagPrefix: slicer/

- template: azure-pipelines/jobs/split-library.yml
parameters:
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/staging-provider/')
Expand All @@ -180,19 +200,10 @@ jobs:
libraryPath: libs/staging-provider
tagPrefix: staging-provider/


- template: azure-pipelines/jobs/split-library.yml
parameters:
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/vault-api-client/')
sourceRepo: platform-libraries
targetRepo: vault-api-php-client
libraryPath: libs/vault-api-client
tagPrefix: vault-api-client/

- template: azure-pipelines/jobs/split-library.yml
parameters:
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/slicer/')
sourceRepo: platform-libraries
targetRepo: slicer
libraryPath: libs/slicer
tagPrefix: slicer/
73 changes: 48 additions & 25 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ resources:
type: github
endpoint: keboola
name: keboola/configuration-variables-resolver
- repository: encryption-api-php-client
type: github
endpoint: keboola
name: keboola/encryption-api-php-client
- repository: input-mapping
type: github
endpoint: keboola
Expand Down Expand Up @@ -58,6 +62,10 @@ resources:
type: github
endpoint: keboola
name: keboola/settle
- repository: slicer
type: github
endpoint: keboola
name: keboola/slicer
- repository: staging-provider
type: github
endpoint: keboola
Expand All @@ -66,10 +74,6 @@ resources:
type: github
endpoint: keboola
name: keboola/vault-api-php-client
- repository: slicer
type: github
endpoint: keboola
name: keboola/slicer

variables:
DOCKER_BUILDKIT: 1
Expand All @@ -88,6 +92,7 @@ stages:
apiBundle:libs/api-bundle \
azureApiClient:libs/azure-api-client \
configurationVariablesResolver:libs/configuration-variables-resolver \
encryptionApiClient:libs/encryption-api-client \
inputMapping:libs/input-mapping \
k8sClient:libs/k8s-client \
loggingBundle:libs/logging-bundle \
Expand All @@ -97,9 +102,9 @@ stages:
sandboxesServiceApiClient:libs/sandboxes-service-api-client \
serviceClient:libs/service-client \
settle:libs/settle \
slicer:libs/slicer \
stagingProvider:libs/staging-provider \
vaultApiClient:libs/vault-api-client \
slicer:libs/slicer
vaultApiClient:libs/vault-api-client
displayName: 'Find changes'
name: findChanges

Expand Down Expand Up @@ -140,6 +145,14 @@ stages:
jobs:
- template: libs/configuration-variables-resolver/azure-pipelines.tests.yml

- stage: tests_encryptionApiClient
displayName: Tests - Encryption API Client
lockBehavior: sequential
dependsOn: build
condition: and(succeeded(), dependencies.build.outputs['checkChanges.findChanges.changedProjects_encryptionApiClient'])
jobs:
- template: libs/encryption-api-client/azure-pipelines.tests.yml

- stage: tests_inputMapping
displayName: Tests - Input Mapping
lockBehavior: sequential
Expand Down Expand Up @@ -212,6 +225,14 @@ stages:
jobs:
- template: libs/settle/azure-pipelines.tests.yml

- stage: tests_slicer
displayName: Tests - Slicer
lockBehavior: sequential
dependsOn: build
condition: and(succeeded(), dependencies.build.outputs['checkChanges.findChanges.changedProjects_slicer'])
jobs:
- template: libs/slicer/azure-pipelines.tests.yml

- stage: tests_stagingProvider
displayName: Tests - Staging Provider
lockBehavior: sequential
Expand All @@ -228,21 +249,14 @@ stages:
jobs:
- template: libs/vault-api-client/azure-pipelines.tests.yml

- stage: tests_slicer
displayName: Tests - Slicer
lockBehavior: sequential
dependsOn: build
condition: and(succeeded(), dependencies.build.outputs['checkChanges.findChanges.changedProjects_slicer'])
jobs:
- template: libs/slicer/azure-pipelines.tests.yml

- stage: testsResults
displayName: Wait for tests results
dependsOn:
- build
- tests_apiBundle
- tests_azureApiClient
- tests_configurationVariablesResolver
- tests_encryptionApiClient
- tests_inputMapping
- tests_k8sClient
- tests_loggingBundle
Expand All @@ -252,14 +266,15 @@ stages:
- tests_sandboxesServiceApiClient
- tests_serviceClient
- tests_settle
- tests_slicer
- tests_stagingProvider
- tests_vaultApiClient
- tests_slicer
condition: |
and(
in(dependencies.tests_apiBundle.result, 'Succeeded', 'Skipped'),
in(dependencies.tests_azureApiClient.result, 'Succeeded', 'Skipped'),
in(dependencies.tests_configurationVariablesResolver.result, 'Succeeded', 'Skipped'),
in(dependencies.tests_encryptionApiClient.result, 'Succeeded', 'Skipped'),
in(dependencies.tests_inputMapping.result, 'Succeeded', 'Skipped'),
in(dependencies.tests_k8sClient.result, 'Succeeded', 'Skipped'),
in(dependencies.tests_loggingBundle.result, 'Succeeded', 'Skipped'),
Expand All @@ -269,9 +284,9 @@ stages:
in(dependencies.tests_sandboxesServiceApiClient.result, 'Succeeded', 'Skipped'),
in(dependencies.tests_serviceClient.result, 'Succeeded', 'Skipped'),
in(dependencies.tests_settle.result, 'Succeeded', 'Skipped'),
in(dependencies.tests_slicer.result, 'Succeeded', 'Skipped'),
in(dependencies.tests_stagingProvider.result, 'Succeeded', 'Skipped'),
in(dependencies.tests_vaultApiClient.result, 'Succeeded', 'Skipped'),
in(dependencies.tests_slicer.result, 'Succeeded', 'Skipped')
in(dependencies.tests_vaultApiClient.result, 'Succeeded', 'Skipped')
)
jobs:
- job:
Expand Down Expand Up @@ -307,6 +322,14 @@ stages:
libraryPath: libs/configuration-variables-resolver
tagPrefix: configuration-variables-resolver/

- template: azure-pipelines/jobs/split-library.yml
parameters:
condition: and(succeeded(), stageDependencies.build.checkChanges.outputs['findChanges.changedProjects_encryptionApiClient'])
sourceRepo: platform-libraries
targetRepo: encryption-api-php-client
libraryPath: libs/encryption-api-client
tagPrefix: encryption-api-client/

- template: azure-pipelines/jobs/split-library.yml
parameters:
condition: and(succeeded(), stageDependencies.build.checkChanges.outputs['findChanges.changedProjects_inputMapping'])
Expand Down Expand Up @@ -379,6 +402,14 @@ stages:
libraryPath: libs/settle
tagPrefix: settle/

- template: azure-pipelines/jobs/split-library.yml
parameters:
condition: and(succeeded(), stageDependencies.build.checkChanges.outputs['findChanges.changedProjects_slicer'])
sourceRepo: platform-libraries
targetRepo: slicer
libraryPath: libs/slicer
tagPrefix: slicer/

- template: azure-pipelines/jobs/split-library.yml
parameters:
condition: and(succeeded(), stageDependencies.build.checkChanges.outputs['findChanges.changedProjects_stagingProvider'])
Expand All @@ -394,11 +425,3 @@ stages:
targetRepo: vault-api-php-client
libraryPath: libs/vault-api-client
tagPrefix: vault-api-client/

- template: azure-pipelines/jobs/split-library.yml
parameters:
condition: and(succeeded(), stageDependencies.build.checkChanges.outputs['findChanges.changedProjects_slicer'])
sourceRepo: platform-libraries
targetRepo: slicer
libraryPath: libs/slicer
tagPrefix: slicer/
23 changes: 14 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ services:
- STORAGE_API_TOKEN_MASTER
- STORAGE_API_URL

dev-encryption-api-client:
<<: *dev
image: keboola/encryption-api-client
working_dir: /code/libs/encryption-api-client

dev-input-mapping:
<<: *dev
image: keboola/input-mapping
Expand All @@ -77,6 +82,10 @@ services:
image: keboola/k8s-client
working_dir: /code/libs/k8s-client

dev-logging-bundle:
<<: *dev
working_dir: /code/libs/logging-bundle

dev-messenger-bundle:
<<: *dev82
working_dir: /code/libs/messenger-bundle
Expand Down Expand Up @@ -117,6 +126,11 @@ services:
image: keboola/settle
working_dir: /code/libs/settle

dev-slicer:
<<: *dev
image: keboola/slicer
working_dir: /code/libs/slicer

dev-staging-provider:
<<: *dev
image: keboola/staging-provider
Expand All @@ -132,12 +146,3 @@ services:
<<: *dev82
image: keboola/vault-api-client
working_dir: /code/libs/vault-api-client

dev-slicer:
<<: *dev
image: keboola/slicer
working_dir: /code/libs/slicer

dev-logging-bundle:
<<: *dev
working_dir: /code/libs/logging-bundle
1 change: 1 addition & 0 deletions libs/encryption-api-client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor/
21 changes: 21 additions & 0 deletions libs/encryption-api-client/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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:

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.
28 changes: 28 additions & 0 deletions libs/encryption-api-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Encryption API Client

## Installation
```bash
composer require keboola/encryption-api-php-client
```

## Usage

```php
use Keboola\EncryptionApiClient\Migrations;

$migrations = new Migrations(getenv('STORAGE_API_TOKEN'));

$resultMessage = $migrations->migrateConfiguration(
sourceStorageApiToken: '...',
destinationStack: 'connection.europe-west3.gcp.keboola.com',
destinationStorageApiToken: '...',
componentId: 'keboola.data-apps',
configId: '123456',
branchId: '102',
dryRun: true,
);
```

## License

MIT licensed, see [LICENSE](./LICENSE) file.
21 changes: 21 additions & 0 deletions libs/encryption-api-client/azure-pipelines.tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
jobs:
- template: ../../azure-pipelines/jobs/run-tests.yml
parameters:
displayName: Tests (PHP 7.4)
serviceName: dev74
testCommand: |
bash -c '\
echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/xdebug.ini
cd libs/encryption-api-client && \
composer update --prefer-lowest && \
composer ci'

- template: ../../azure-pipelines/jobs/run-tests.yml
parameters:
displayName: Tests (PHP 8.2)
serviceName: dev82
testCommand: |
bash -c '\
cd libs/encryption-api-client && \
composer update && \
composer ci'
Loading