diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 43d7ca7e..6a3f3c5b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,6 +31,8 @@ jobs: env: DO_ACCESS_KEY: ${{ secrets.DO_ACCESS_KEY }} DO_SECRET: ${{ secrets.DO_SECRET }} + EXOSCALE_ACCESS_KEY: ${{ secrets.EXOSCALE_ACCESS_KEY }} + EXOSCALE_SECRET: ${{ secrets.EXOSCALE_SECRET }} LINODE_ACCESS_KEY: ${{ secrets.LINODE_ACCESS_KEY }} LINODE_SECRET: ${{ secrets.LINODE_SECRET }} S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} @@ -58,7 +60,7 @@ jobs: strategy: fail-fast: false matrix: - devices: [BackblazeTest, DOSpacesTest, LinodeTest, LocalTest, S3Test, WasabiTest] + devices: [BackblazeTest, DOSpacesTest, ExoscaleTest, LinodeTest, LocalTest, S3Test, WasabiTest] steps: - name: checkout @@ -67,6 +69,8 @@ jobs: env: DO_ACCESS_KEY: ${{ secrets.DO_ACCESS_KEY }} DO_SECRET: ${{ secrets.DO_SECRET }} + EXOSCALE_ACCESS_KEY: ${{ secrets.EXOSCALE_ACCESS_KEY }} + EXOSCALE_SECRET: ${{ secrets.EXOSCALE_SECRET }} LINODE_ACCESS_KEY: ${{ secrets.LINODE_ACCESS_KEY }} LINODE_SECRET: ${{ secrets.LINODE_SECRET }} S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} diff --git a/src/Storage/Device/Exoscale.php b/src/Storage/Device/Exoscale.php new file mode 100644 index 00000000..068938b4 --- /dev/null +++ b/src/Storage/Device/Exoscale.php @@ -0,0 +1,65 @@ +headers['host'] = $bucket.'.'.$region.'.'.'exo.io'; + } + + /** + * @return string + */ + public function getName(): string + { + return 'Exoscale Storage'; + } + + /** + * @return string + */ + public function getDescription(): string + { + return 'Exoscale Storage'; + } + + /** + * @return string + */ + public function getType(): string + { + return Storage::DEVICE_EXOSCALE; + } +} diff --git a/src/Storage/Storage.php b/src/Storage/Storage.php index cabd18c8..93acc052 100644 --- a/src/Storage/Storage.php +++ b/src/Storage/Storage.php @@ -21,6 +21,8 @@ class Storage const DEVICE_LINODE = 'linode'; + const DEVICE_EXOSCALE = 'exoscale'; + /** * Devices. * diff --git a/tests/Storage/Device/ExoscaleTest.php b/tests/Storage/Device/ExoscaleTest.php new file mode 100644 index 00000000..b69ec0e4 --- /dev/null +++ b/tests/Storage/Device/ExoscaleTest.php @@ -0,0 +1,34 @@ +root = '/root'; + $apiKey = $_SERVER['EXOSCALE_ACCESS_KEY'] ?? ''; + $apiSecret = $_SERVER['EXOSCALE_SECRET'] ?? ''; + $bucket = 'storage-test'; + + $this->object = new Exoscale($this->root, $apiKey, $apiSecret, $bucket, Exoscale::CH_GVA_2, Exoscale::ACL_PRIVATE); + } + + protected function getAdapterName(): string + { + return 'Exoscale Simple Object Storage'; + } + + protected function getAdapterType(): string + { + return $this->object->getType(); + } + + protected function getAdapterDescription(): string + { + return 'Exoscale Simple Object Storage'; + } +}