You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2022/11/24 13:48:13 UTC

[camel-kamelets] branch azure-storage-blob-source created (now 22f11d6b)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch azure-storage-blob-source
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


      at 22f11d6b Added an Azure Storage Blob Source It Test to Makefile

This branch includes the following new commits:

     new aab19673 Added an Azure Storage Blob Source It Test
     new 22f11d6b Added an Azure Storage Blob Source It Test to Makefile

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[camel-kamelets] 02/02: Added an Azure Storage Blob Source It Test to Makefile

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch azure-storage-blob-source
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 22f11d6b001d89b39b642cf598a77bd10cdc7e23
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Nov 24 14:47:47 2022 +0100

    Added an Azure Storage Blob Source It Test to Makefile
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 it-tests/Makefile                                              | 10 +++++++++-
 ...orage-blob-it-test.sh => azure-storage-blob-log-it-test.sh} |  0
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/it-tests/Makefile b/it-tests/Makefile
index 6b7485ef..9fbb1e05 100644
--- a/it-tests/Makefile
+++ b/it-tests/Makefile
@@ -39,6 +39,8 @@ all:
 	./timer-sftp-it-test.sh $(camel-version)
 	cd misc/scp/sink/ && \
 	./timer-scp-it-test.sh $(camel-version)
+	cd azure/azure-storage-blob/source/ && \
+	./azure-storage-blob-log-it-test.sh $(camel-version)
 	./scripts/results.sh
 	rm -rf tests	
 aws:
@@ -63,6 +65,12 @@ aws:
 	./timer-aws-kinesis-firehose-it-test.sh $(camel-version)
 	./scripts/results.sh
 	rm -rf tests
+azure:
+	mkdir -p tests
+	cd azure/azure-storage-blob/source/ && \
+	./azure-storage-blob-log-it-test.sh $(camel-version)
+	./scripts/results.sh
+	rm -rf tests	
 misc:
 	mkdir -p tests
 	cd misc/sftp/source/ && \
@@ -81,4 +89,4 @@ cdc:
 	./scripts/results.sh
 	rm -rf tests
 	
-.PHONY: all aws misc cdc clean
+.PHONY: all aws azure misc cdc clean
diff --git a/it-tests/azure/azure-storage-blob/source/azure-storage-blob-it-test.sh b/it-tests/azure/azure-storage-blob/source/azure-storage-blob-log-it-test.sh
similarity index 100%
rename from it-tests/azure/azure-storage-blob/source/azure-storage-blob-it-test.sh
rename to it-tests/azure/azure-storage-blob/source/azure-storage-blob-log-it-test.sh


[camel-kamelets] 01/02: Added an Azure Storage Blob Source It Test

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch azure-storage-blob-source
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit aab1967320d09f6c646539954a1e5d0e8de5b519
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Nov 24 14:40:33 2022 +0100

    Added an Azure Storage Blob Source It Test
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../source/azure-storage-blob-it-test.sh           | 51 +++++++++++++++++++++
 .../source/azure-storage-blob-log.yaml             | 29 ++++++++++++
 .../azure-storage-blob/source/example-file.txt     |  1 +
 .../azure-storage-blob/source/terraform/main.tf    | 52 ++++++++++++++++++++++
 4 files changed, 133 insertions(+)

diff --git a/it-tests/azure/azure-storage-blob/source/azure-storage-blob-it-test.sh b/it-tests/azure/azure-storage-blob/source/azure-storage-blob-it-test.sh
new file mode 100755
index 00000000..b86a845e
--- /dev/null
+++ b/it-tests/azure/azure-storage-blob/source/azure-storage-blob-it-test.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+if [ $# -ne 1 ]; then
+    echo $0: usage: azure-storage-blob-log-it-test.sh camel-version
+    exit 1
+fi
+
+camel_version=$1
+
+cd terraform/
+terraform init
+terraform apply -auto-approve
+cd ../
+
+accountKey=`az storage account keys list -n kameletsaccount | jq -r ' .[0] | .value'`
+echo $accountKey
+az storage account keys list -n kameletsaccount | echo "camel.kamelet.azure-storage-blob-source.accessKey = $accountKey" > azure-keys.properties
+
+jbang run --fresh -Dcamel.jbang.version=$camel_version camel@apache/camel run --properties=azure-keys.properties azure-storage-blob-log.yaml &
+
+sleep 5
+
+az storage blob upload --account-name kameletsaccount --container-name kamelets --name example-file-uploaded1.txt --file example-file.txt --account-key $accountKey
+az storage blob upload --account-name kameletsaccount --container-name kamelets --name example-file-uploaded2.txt --file example-file.txt --account-key $accountKey
+az storage blob upload --account-name kameletsaccount --container-name kamelets --name example-file-uploaded3.txt --file example-file.txt --account-key $accountKey
+az storage blob upload --account-name kameletsaccount --container-name kamelets --name example-file-uploaded4.txt --file example-file.txt --account-key $accountKey
+az storage blob upload --account-name kameletsaccount --container-name kamelets --name example-file-uploaded5.txt --file example-file.txt --account-key $accountKey
+
+sleep 5
+
+variable=`jbang run -Dcamel.jbang.version=$camel_version camel@apache/camel get | tail -n +2` 
+success=`echo $variable | cut -d' ' -f11`
+fail=`echo $variable | cut -d' ' -f12`
+if [[ $success == 5 && $fail == 0 ]] 
+then 
+    mkdir -p ../../../tests/
+    echo "Test Successful" > ../../../tests/azure-storage-blob-log-it-test.result;
+else
+    mkdir -p ../../../tests/
+    echo "Test failed" > ../../../tests/azure-storage-blob-log-it-test.result;
+fi
+
+jbang run -Dcamel.jbang.version=$camel_version camel@apache/camel stop azure-storage-blob-log
+
+cd terraform/
+terraform destroy -auto-approve
+cd ../
+
+rm -rf azure-keys.properties
+
+cat ../../../tests/azure-storage-blob-log-it-test.result
diff --git a/it-tests/azure/azure-storage-blob/source/azure-storage-blob-log.yaml b/it-tests/azure/azure-storage-blob/source/azure-storage-blob-log.yaml
new file mode 100644
index 00000000..af7b1b7e
--- /dev/null
+++ b/it-tests/azure/azure-storage-blob/source/azure-storage-blob-log.yaml
@@ -0,0 +1,29 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+- route:
+    from:
+      uri: "kamelet:azure-storage-blob-source"
+      parameters:
+        accountName: "kameletsaccount"
+        containerName: "kamelets"
+        delay: 15000
+      steps:
+      - to: 
+          uri: "kamelet:log-sink"
+          parameters:
+            showStreams: true     
diff --git a/it-tests/azure/azure-storage-blob/source/example-file.txt b/it-tests/azure/azure-storage-blob/source/example-file.txt
new file mode 100644
index 00000000..9daeafb9
--- /dev/null
+++ b/it-tests/azure/azure-storage-blob/source/example-file.txt
@@ -0,0 +1 @@
+test
diff --git a/it-tests/azure/azure-storage-blob/source/terraform/main.tf b/it-tests/azure/azure-storage-blob/source/terraform/main.tf
new file mode 100644
index 00000000..319b107a
--- /dev/null
+++ b/it-tests/azure/azure-storage-blob/source/terraform/main.tf
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+# We strongly recommend using the required_providers block to set the
+# Azure Provider source and version being used
+terraform {
+  required_providers {
+    azurerm = {
+      source  = "hashicorp/azurerm"
+      version = "=3.0.0"
+    }
+  }
+}
+
+# Configure the Microsoft Azure Provider
+provider "azurerm" {
+  features {}
+}
+
+resource "azurerm_resource_group" "kamelets" {
+  name     = "kamelets-resources"
+  location = "West Europe"
+}
+
+resource "azurerm_storage_account" "kamelets" {
+  name                     = "kameletsaccount"
+  resource_group_name      = azurerm_resource_group.kamelets.name
+  location                 = azurerm_resource_group.kamelets.location
+  account_tier             = "Standard"
+  account_replication_type = "LRS"
+}
+
+resource "azurerm_storage_container" "camelkamelets" {
+  name                  = "kamelets"
+  storage_account_name  = azurerm_storage_account.kamelets.name
+  container_access_type = "private"
+}
+