From bb64442e2249c4fc42079811b1bfa144b27e8a04 Mon Sep 17 00:00:00 2001 From: disa6302 Date: Wed, 14 Oct 2020 18:42:15 -0700 Subject: [PATCH] Replace shell script with make --- .../Makefile | 12 ++++++++++++ .../run-consumer.sh | 7 ------- .../CMake/Dependencies/libcppsdk-CMakeLists.txt | 1 + .../Dependencies/libkvsProducerC-CMakeLists.txt | 2 +- .../canary/KvsProducerSampleCloudwatch.cpp | 2 +- .../producer-cloudwatch-integ/jobs/runner.groovy | 14 ++++++-------- 6 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 consumer-java/aws-kinesis-video-producer-sdk-canary-consumer/Makefile delete mode 100755 consumer-java/aws-kinesis-video-producer-sdk-canary-consumer/run-consumer.sh diff --git a/consumer-java/aws-kinesis-video-producer-sdk-canary-consumer/Makefile b/consumer-java/aws-kinesis-video-producer-sdk-canary-consumer/Makefile new file mode 100644 index 000000000..6837d9f16 --- /dev/null +++ b/consumer-java/aws-kinesis-video-producer-sdk-canary-consumer/Makefile @@ -0,0 +1,12 @@ +consumer: build + +install-system-dependencies: + @echo "Installing system dependencies" + +build: install-system-dependencies + @echo "Build java parser based consumer" + mvn package + # Create a temporary filename in /tmp directory + touch tmp_jar + # Create classpath string of dependencies from the local repository to a file + mvn -Dmdep.outputFile=tmp_jar dependency:build-classpath \ No newline at end of file diff --git a/consumer-java/aws-kinesis-video-producer-sdk-canary-consumer/run-consumer.sh b/consumer-java/aws-kinesis-video-producer-sdk-canary-consumer/run-consumer.sh deleted file mode 100755 index aa2bcdd4b..000000000 --- a/consumer-java/aws-kinesis-video-producer-sdk-canary-consumer/run-consumer.sh +++ /dev/null @@ -1,7 +0,0 @@ -mvn package -# Create a temporary filename in /tmp directory -touch tmp_jar -# Create classpath string of dependencies from the local repository to a file -mvn -Dmdep.outputFile=tmp_jar dependency:build-classpath -# Start the consumer -java -classpath target/aws-kinesisvideo-producer-sdk-canary-consumer-1.0-SNAPSHOT.jar:$(cat tmp_jar) -Daws.accessKeyId=${AWS_ACCESS_KEY_ID} -Daws.secretKey=${AWS_SECRET_ACCESS_KEY} com.amazon.kinesis.video.canary.consumer.ProducerSdkCanaryConsumer \ No newline at end of file diff --git a/producer-c/producer-cloudwatch-integ/CMake/Dependencies/libcppsdk-CMakeLists.txt b/producer-c/producer-cloudwatch-integ/CMake/Dependencies/libcppsdk-CMakeLists.txt index 9e1517dde..747b90b9c 100644 --- a/producer-c/producer-cloudwatch-integ/CMake/Dependencies/libcppsdk-CMakeLists.txt +++ b/producer-c/producer-cloudwatch-integ/CMake/Dependencies/libcppsdk-CMakeLists.txt @@ -11,6 +11,7 @@ ExternalProject_Add(libawscpp-download -DBUILD_DEPS=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_ONLY=monitoring|logs + -DCMAKE_INSTALL_PREFIX=${OPEN_SRC_INSTALL_PREFIX} BUILD_ALWAYS TRUE TEST_COMMAND "" ) \ No newline at end of file diff --git a/producer-c/producer-cloudwatch-integ/CMake/Dependencies/libkvsProducerC-CMakeLists.txt b/producer-c/producer-cloudwatch-integ/CMake/Dependencies/libkvsProducerC-CMakeLists.txt index 58f68048b..70d43ec58 100644 --- a/producer-c/producer-cloudwatch-integ/CMake/Dependencies/libkvsProducerC-CMakeLists.txt +++ b/producer-c/producer-cloudwatch-integ/CMake/Dependencies/libkvsProducerC-CMakeLists.txt @@ -6,7 +6,7 @@ include(ExternalProject) ExternalProject_Add(libkvsProducerC-download GIT_REPOSITORY https://github.com/awslabs/amazon-kinesis-video-streams-producer-c.git - GIT_TAG origin/master + GIT_TAG 22edebfd87f5a38ab8af58da9a42f3d8dc7aebe7 PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${OPEN_SRC_INSTALL_PREFIX} -DBUILD_COMMON_LWS=ON -DBUILD_COMMON_CURL=ON -DBUILD_DEPENDENCIES=TRUE -DOPEN_SRC_INSTALL_PREFIX=${OPEN_SRC_INSTALL_PREFIX} BUILD_ALWAYS TRUE diff --git a/producer-c/producer-cloudwatch-integ/canary/KvsProducerSampleCloudwatch.cpp b/producer-c/producer-cloudwatch-integ/canary/KvsProducerSampleCloudwatch.cpp index e9cd598c3..8a386e4f0 100644 --- a/producer-c/producer-cloudwatch-integ/canary/KvsProducerSampleCloudwatch.cpp +++ b/producer-c/producer-cloudwatch-integ/canary/KvsProducerSampleCloudwatch.cpp @@ -374,6 +374,6 @@ INT32 main(INT32 argc, CHAR* argv[]) RESET_INSTRUMENTED_ALLOCATORS(); DLOGI("CleanUp Done"); } - DLOGD("Exiting application with status code: 0x%08x", retStatus); + DLOGI("Exiting application with status code: 0x%08x", retStatus); return STATUS_FAILED(retStatus) ? EXIT_FAILURE : EXIT_SUCCESS; } diff --git a/producer-c/producer-cloudwatch-integ/jobs/runner.groovy b/producer-c/producer-cloudwatch-integ/jobs/runner.groovy index 1dcf2a1b3..026b13be5 100644 --- a/producer-c/producer-cloudwatch-integ/jobs/runner.groovy +++ b/producer-c/producer-cloudwatch-integ/jobs/runner.groovy @@ -20,21 +20,19 @@ def buildProducer() { cd $WORKSPACE/producer-c/producer-cloudwatch-integ && mkdir -p build cd build && - sudo cmake .. && - sudo make + cmake .. && + make """ } def buildConsumer(envs) { withEnv(envs) { - sh ''' + sh ''' PATH="$JAVA_HOME/bin:$PATH" export PATH="$M2_HOME/bin:$PATH" cd $WORKSPACE/consumer-java/aws-kinesis-video-producer-sdk-canary-consumer - mvn package - touch tmp_jar - mvn -Dmdep.outputFile=tmp_jar dependency:build-classpath - ''' + make + ''' } } @@ -74,7 +72,7 @@ def runClient(isProducer, params) { // TODO: Move to deletDir(). deleteDir() causes an exception right now sh """ cd $WORKSPACE - sudo rm -rf * + rm -rf * """ }