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

bbender pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
     new a1f10c1  GEODE-6229: Add ubuntu build image to Packer scripts (#425)
a1f10c1 is described below

commit a1f10c1b8d2445e8e044d45f5a2d4d771ccb60cf
Author: Blake Bender <ekalbred...@hotmail.com>
AuthorDate: Thu Dec 20 14:50:52 2018 -0800

    GEODE-6229: Add ubuntu build image to Packer scripts (#425)
    
    * packer files for building base and build images
    * Updated to use systemd
    * Fix buffer overflow error.
    * create home dir for build
    * include Threads in target_link_libraries
    * GEODE-6229: Fix Ubuntu build dependencies
    
    Co-authored-by: Ivan Godwin <igod...@pivotal.io>
    Co-authored-by: Matthew Reddington <mredding...@pivotal.io>
    Co-authored-by: Jacob Barrett <jbarr...@pivotal.io>
    Co-authored-by: Michael Oleske <mole...@pivotal.io>
    Co-authored-by: Ernest Burghardt <eburgha...@pivotal.io>
---
 cppcache/src/TcpConn.cpp                           |  2 +-
 dependencies/benchmark/CMakeLists.txt              |  5 +-
 packer/build-ubuntu.json                           | 88 ++++++++++++++++++++++
 packer/ubuntu-16.04-base.json                      | 48 ++++++++++++
 .../ubuntu/add-user-build.sh                       | 31 ++------
 .../CMakeLists.txt => packer/ubuntu/cleanup.sh     | 30 +-------
 packer/ubuntu/files/etc/init-user.sh               | 51 +++++++++++++
 .../files/etc/systemd/system/update-hosts.service  | 11 +++
 packer/ubuntu/files/usr/local/bin/update-hosts.sh  |  6 ++
 .../ubuntu/install-cmake.sh                        | 31 ++------
 .../ubuntu/install-coverage-tools.sh               | 37 +++------
 .../ubuntu/install-gemfire.sh                      | 33 ++------
 .../ubuntu/install-packages.sh                     | 35 ++-------
 .../CMakeLists.txt => packer/ubuntu/update.sh      | 32 ++------
 .../ubuntu/wait-for-cloud-init.sh                  | 35 +++------
 sqliteimpl/CMakeLists.txt                          |  8 +-
 16 files changed, 267 insertions(+), 216 deletions(-)

diff --git a/cppcache/src/TcpConn.cpp b/cppcache/src/TcpConn.cpp
index b7c08ca..ec88007 100644
--- a/cppcache/src/TcpConn.cpp
+++ b/cppcache/src/TcpConn.cpp
@@ -240,7 +240,7 @@ void TcpConn::connect() {
   }
   int rc = this->m_io->enable(ACE_NONBLOCK);
   if (-1 == rc) {
-    char msg[250];
+    char msg[256];
     int32_t lastError = ACE_OS::last_error();
     std::snprintf(msg, 256, "TcpConn::NONBLOCK: %d: %s", lastError,
                   ACE_OS::strerror(lastError));
diff --git a/dependencies/benchmark/CMakeLists.txt 
b/dependencies/benchmark/CMakeLists.txt
index 4bd80bb..9cffcae 100644
--- a/dependencies/benchmark/CMakeLists.txt
+++ b/dependencies/benchmark/CMakeLists.txt
@@ -35,7 +35,7 @@ ExternalProject_Add( ${${PROJECT_NAME}_EXTERN}
     -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
     -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
     -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-         -DCMAKE_BUILD_TYPE=$<CONFIG>
+    -DCMAKE_BUILD_TYPE=$<CONFIG>
     
-DGTEST_ROOT=$<TARGET_PROPERTY:GTest::GTest,INTERFACE_INCLUDE_DIRECTORIES>/..
     -DBENCHMARK_ENABLE_TESTING=OFF
    DEPENDS ${${PROJECT_NAME}_DEPENDS}
@@ -57,12 +57,15 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
   )
 endif()
 
+find_package(Threads REQUIRED)
+
 add_library(${PROJECT_NAME} INTERFACE)
 target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE
   $<BUILD_INTERFACE:${INSTALL_DIR}/include>
 )
 target_link_libraries(${PROJECT_NAME} INTERFACE
   
${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX}
+  Threads::Threads
 )
 if (WIN32)
 target_link_libraries(${PROJECT_NAME} INTERFACE
diff --git a/packer/build-ubuntu.json b/packer/build-ubuntu.json
new file mode 100644
index 0000000..35c48a1
--- /dev/null
+++ b/packer/build-ubuntu.json
@@ -0,0 +1,88 @@
+{
+  "variables":{
+    "region":"us-west-2",
+    "source_ami":"ami-08718fb38f5f50f34",
+    "source_image_name":"X.vmx",
+    "image_name":"build-ubuntu"
+  },
+  "builders":[
+    {
+      "type":"amazon-ebs",
+      "instance_type":"t2.micro",
+      "ami_name":"native-{{user `version`}}-{{user `image_name`}} 
{{timestamp}}",
+      "access_key":"{{user `aws_access_key`}}",
+      "secret_key":"{{user `aws_secret_key`}}",
+      "region":"{{user `region`}}",
+      "source_ami":"{{user `source_ami`}}",
+      "subnet_id":"{{user `subnet_id`}}",
+      "vpc_id":"{{user `vpc_id`}}",
+      "tags":{
+        "team":"native",
+        "version":"{{user `version`}}",
+        "source_ami":"{{user `source_ami`}}"
+      },
+      "ssh_username":"ubuntu",
+      "ssh_pty":true
+    }
+  ],
+  "provisioners":[
+    {
+      "type":"shell",
+      "script":"ubuntu/wait-for-cloud-init.sh"
+    },
+    {
+      "type":"shell",
+      "execute_command":"{{.Vars}} sudo -E -S bash '{{.Path}}'",
+      "scripts":[
+        "ubuntu/update.sh"
+      ]
+    },
+    {
+      "type":"file",
+      "source":"ubuntu/files",
+      "destination":"/tmp"
+    },
+    {
+      "type":"shell",
+      "execute_command":"{{.Vars}} sudo -E -S bash '{{.Path}}'",
+      "inline":[
+        "cp -rv /tmp/files/* /",
+        "rm -rf /tmp/files",
+        "chmod +x /etc/init-user.sh",
+        "chmod +x /usr/local/bin/update-hosts.sh",
+        "systemctl daemon-reload",
+        "systemctl enable update-hosts.service",
+        "systemctl start update-hosts.service"
+      ]
+    },
+    {
+      "type":"shell",
+      "execute_command":"{{.Vars}} sudo -E -S bash '{{.Path}}'",
+      "scripts":[
+        "ubuntu/add-user-build.sh",
+        "ubuntu/install-packages.sh",
+        "ubuntu/install-coverage-tools.sh",
+        "ubuntu/install-cmake.sh"
+      ]
+    },
+    {
+      "type":"file",
+      "source":"{{user `gemfire_archive`}}",
+      "destination":"gemfire.tar.gz"
+    },
+    {
+      "type":"shell",
+      "execute_command":"{{.Vars}} sudo -E -S bash '{{.Path}}'",
+      "scripts":[
+        "ubuntu/install-gemfire.sh"
+      ]
+    },
+    {
+      "type":"shell",
+      "execute_command":"{{.Vars}} sudo -E -S bash '{{.Path}}'",
+      "scripts":[
+        "ubuntu/cleanup.sh"
+      ]
+    }
+  ]
+}
diff --git a/packer/ubuntu-16.04-base.json b/packer/ubuntu-16.04-base.json
new file mode 100644
index 0000000..abdb064
--- /dev/null
+++ b/packer/ubuntu-16.04-base.json
@@ -0,0 +1,48 @@
+{
+  "variables":{
+    "region":"us-west-2",
+    "source_ami":"ami-0afae182eed9d2b46",
+    "source_image_name":"X.vmx",
+    "image_name":"ubuntu-16.04-base"
+  },
+  "builders":[
+    {
+      "type":"amazon-ebs",
+      "instance_type":"t2.micro",
+      "ami_name":"native-{{user `version`}}-{{user `image_name`}} 
{{timestamp}}",
+      "access_key":"{{user `aws_access_key`}}",
+      "secret_key":"{{user `aws_secret_key`}}",
+      "region":"{{user `region`}}",
+      "source_ami":"{{user `source_ami`}}",
+      "subnet_id":"{{user `subnet_id`}}",
+      "vpc_id":"{{user `vpc_id`}}",
+      "tags":{
+        "team":"native",
+        "version":"{{user `version`}}",
+        "source_ami":"{{user `source_ami`}}"
+      },
+      "ssh_username":"ubuntu",
+      "ssh_pty":true
+    }
+  ],
+  "provisioners":[
+    {
+      "type":"shell",
+      "script":"ubuntu/wait-for-cloud-init.sh"
+    },
+    {
+      "type":"shell",
+      "execute_command":"{{.Vars}} sudo -E -S bash '{{.Path}}'",
+      "scripts":[
+        "ubuntu/update.sh"
+      ]
+    },
+    {
+      "type":"shell",
+      "execute_command":"{{.Vars}} sudo -E -S bash '{{.Path}}'",
+      "scripts":[
+        "ubuntu/cleanup.sh"
+      ]
+    }
+  ]
+}
\ No newline at end of file
diff --git a/sqliteimpl/CMakeLists.txt b/packer/ubuntu/add-user-build.sh
old mode 100644
new mode 100755
similarity index 60%
copy from sqliteimpl/CMakeLists.txt
copy to packer/ubuntu/add-user-build.sh
index ea81bf2..e3ddd21
--- a/sqliteimpl/CMakeLists.txt
+++ b/packer/ubuntu/add-user-build.sh
@@ -1,3 +1,5 @@
+#!/usr/bin/env bash
+
 # 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.
@@ -13,31 +15,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-cmake_minimum_required(VERSION 3.10)
-project(SqLiteImpl LANGUAGES CXX)
-
-add_library(SqLiteImpl SHARED
-  SqLiteHelper.cpp
-  SqLiteHelper.hpp
-  SqLiteImpl.cpp
-  SqLiteImpl.hpp
-)
-
-set_target_properties(SqLiteImpl PROPERTIES
-       FOLDER cpp/test/integration
-)
-
-include(GenerateExportHeader)
-generate_export_header(SqLiteImpl)
+#set -x -e -o pipefail
 
-target_include_directories(SqLiteImpl
-  PUBLIC
-         $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
+useradd -m build
 
-target_link_libraries(SqLiteImpl
-  PUBLIC
-    apache-geode
-    sqlite
-  PRIVATE
-    _WarningsAsError
-)
+(crontab -l -u build ; echo "@reboot /etc/init-user.sh") | sort - | uniq - | 
crontab -u build -
diff --git a/sqliteimpl/CMakeLists.txt b/packer/ubuntu/cleanup.sh
similarity index 60%
copy from sqliteimpl/CMakeLists.txt
copy to packer/ubuntu/cleanup.sh
index ea81bf2..1398249 100644
--- a/sqliteimpl/CMakeLists.txt
+++ b/packer/ubuntu/cleanup.sh
@@ -1,3 +1,5 @@
+#!/usr/bin/env bash
+
 # 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.
@@ -13,31 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-cmake_minimum_required(VERSION 3.10)
-project(SqLiteImpl LANGUAGES CXX)
-
-add_library(SqLiteImpl SHARED
-  SqLiteHelper.cpp
-  SqLiteHelper.hpp
-  SqLiteImpl.cpp
-  SqLiteImpl.hpp
-)
-
-set_target_properties(SqLiteImpl PROPERTIES
-       FOLDER cpp/test/integration
-)
-
-include(GenerateExportHeader)
-generate_export_header(SqLiteImpl)
+set -x -e -o pipefail
 
-target_include_directories(SqLiteImpl
-  PUBLIC
-         $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
+apt-get autoclean
 
-target_link_libraries(SqLiteImpl
-  PUBLIC
-    apache-geode
-    sqlite
-  PRIVATE
-    _WarningsAsError
-)
diff --git a/packer/ubuntu/files/etc/init-user.sh 
b/packer/ubuntu/files/etc/init-user.sh
new file mode 100644
index 0000000..2ceff71
--- /dev/null
+++ b/packer/ubuntu/files/etc/init-user.sh
@@ -0,0 +1,51 @@
+#!/usr/bin/env bash
+
+# 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.
+
+
+ATTEMPTS=5
+FAILED=0
+# Fetch public key using HTTP
+while [ ! -f ~/.ssh/authorized_keys ]; do
+    tmp_keys=`mktemp -p . -t authorized_keys.XXXXX` || exit $?
+    curl -f http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key 
> $tmp_keys 2>/dev/null
+    if [ $? -eq 0 ]; then
+        grep -f $tmp_keys ~/.ssh/authorized_keys 2>/dev/null
+        if [ $? -eq 0 ]; then
+            echo "AWS public key was already in authorized_keys, not adding it 
again"
+        else
+            if [ ! -d ~/.ssh ]; then
+                mkdir ~/.ssh
+                               chmod 700 ~/.ssh
+                               restorecon ~/.ssh
+            fi
+            cat $tmp_keys >> ~/.ssh/authorized_keys
+            chmod 0600 ~/.ssh/authorized_keys
+            restorecon ~/.ssh/authorized_keys
+            echo "Successfully retrieved AWS public key from instance metadata"
+        fi
+    else
+        FAILED=$(($FAILED + 1))
+        if [ $FAILED -ge $ATTEMPTS ]; then
+            echo "Failed to retrieve AWS public key after $FAILED attempts, 
quitting"
+            rm -f
+            break
+        fi
+        echo "Could not retrieve AWS public key (attempt #$FAILED/$ATTEMPTS), 
retrying in 5 seconds..."
+        sleep 5
+    fi
+    rm -f $tmp_keys
+done
diff --git a/packer/ubuntu/files/etc/systemd/system/update-hosts.service 
b/packer/ubuntu/files/etc/systemd/system/update-hosts.service
new file mode 100644
index 0000000..6d0117d
--- /dev/null
+++ b/packer/ubuntu/files/etc/systemd/system/update-hosts.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Ensure an A record exists for local hostname in /etc/hosts
+After=network.target
+After=network-online.target
+Wants=network-online.target
+
+[Service]
+ExecStart=/usr/local/bin/update-hosts.sh
+
+[Install]
+WantedBy=multi-user.target
diff --git a/packer/ubuntu/files/usr/local/bin/update-hosts.sh 
b/packer/ubuntu/files/usr/local/bin/update-hosts.sh
new file mode 100644
index 0000000..7971a92
--- /dev/null
+++ b/packer/ubuntu/files/usr/local/bin/update-hosts.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+# add hostname to /etc/hosts if not set
+if (! getent hosts `hostname` >/dev/null); then
+  echo `hostname -I` `hostname` >> /etc/hosts
+fi
diff --git a/sqliteimpl/CMakeLists.txt b/packer/ubuntu/install-cmake.sh
similarity index 60%
copy from sqliteimpl/CMakeLists.txt
copy to packer/ubuntu/install-cmake.sh
index ea81bf2..552faae 100644
--- a/sqliteimpl/CMakeLists.txt
+++ b/packer/ubuntu/install-cmake.sh
@@ -1,3 +1,5 @@
+#!/usr/bin/env bash
+
 # 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.
@@ -13,31 +15,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-cmake_minimum_required(VERSION 3.10)
-project(SqLiteImpl LANGUAGES CXX)
-
-add_library(SqLiteImpl SHARED
-  SqLiteHelper.cpp
-  SqLiteHelper.hpp
-  SqLiteImpl.cpp
-  SqLiteImpl.hpp
-)
+set -x -e -o pipefail
 
-set_target_properties(SqLiteImpl PROPERTIES
-       FOLDER cpp/test/integration
-)
+tmp=`mktemp`
 
-include(GenerateExportHeader)
-generate_export_header(SqLiteImpl)
+curl -o ${tmp} -v -L https://cmake.org/files/v3.12/cmake-3.12.4-Linux-x86_64.sh
 
-target_include_directories(SqLiteImpl
-  PUBLIC
-         $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
+bash ${tmp} --skip-license --prefix=/usr/local
 
-target_link_libraries(SqLiteImpl
-  PUBLIC
-    apache-geode
-    sqlite
-  PRIVATE
-    _WarningsAsError
-)
+rm -f ${tmp}
diff --git a/sqliteimpl/CMakeLists.txt b/packer/ubuntu/install-coverage-tools.sh
similarity index 59%
copy from sqliteimpl/CMakeLists.txt
copy to packer/ubuntu/install-coverage-tools.sh
index ea81bf2..8d268af 100644
--- a/sqliteimpl/CMakeLists.txt
+++ b/packer/ubuntu/install-coverage-tools.sh
@@ -1,43 +1,24 @@
+#!/usr/bin/env bash
+
 # 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.
 
-cmake_minimum_required(VERSION 3.10)
-project(SqLiteImpl LANGUAGES CXX)
-
-add_library(SqLiteImpl SHARED
-  SqLiteHelper.cpp
-  SqLiteHelper.hpp
-  SqLiteImpl.cpp
-  SqLiteImpl.hpp
-)
-
-set_target_properties(SqLiteImpl PROPERTIES
-       FOLDER cpp/test/integration
-)
-
-include(GenerateExportHeader)
-generate_export_header(SqLiteImpl)
+set -x -e -o pipefail
 
-target_include_directories(SqLiteImpl
-  PUBLIC
-         $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
+# for coveralls.io
+pip install cpp-coveralls
 
-target_link_libraries(SqLiteImpl
-  PUBLIC
-    apache-geode
-    sqlite
-  PRIVATE
-    _WarningsAsError
-)
+# For codecov.ip
+apt-get -y install lcov
\ No newline at end of file
diff --git a/sqliteimpl/CMakeLists.txt b/packer/ubuntu/install-gemfire.sh
similarity index 60%
copy from sqliteimpl/CMakeLists.txt
copy to packer/ubuntu/install-gemfire.sh
index ea81bf2..64382af 100644
--- a/sqliteimpl/CMakeLists.txt
+++ b/packer/ubuntu/install-gemfire.sh
@@ -1,3 +1,5 @@
+#!/usr/bin/env bash
+
 # 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.
@@ -13,31 +15,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-cmake_minimum_required(VERSION 3.10)
-project(SqLiteImpl LANGUAGES CXX)
-
-add_library(SqLiteImpl SHARED
-  SqLiteHelper.cpp
-  SqLiteHelper.hpp
-  SqLiteImpl.cpp
-  SqLiteImpl.hpp
-)
-
-set_target_properties(SqLiteImpl PROPERTIES
-       FOLDER cpp/test/integration
-)
-
-include(GenerateExportHeader)
-generate_export_header(SqLiteImpl)
-
-target_include_directories(SqLiteImpl
-  PUBLIC
-         $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
+set -x -e -o pipefail
 
-target_link_libraries(SqLiteImpl
-  PUBLIC
-    apache-geode
-    sqlite
-  PRIVATE
-    _WarningsAsError
-)
+mkdir /gemfire
+tar -zxf gemfire.tar.gz -C /gemfire
+rm gemfire.tar.gz
diff --git a/sqliteimpl/CMakeLists.txt b/packer/ubuntu/install-packages.sh
similarity index 59%
copy from sqliteimpl/CMakeLists.txt
copy to packer/ubuntu/install-packages.sh
index ea81bf2..6466945 100644
--- a/sqliteimpl/CMakeLists.txt
+++ b/packer/ubuntu/install-packages.sh
@@ -1,43 +1,22 @@
+#!/usr/bin/env bash
+
 # 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.
 
-cmake_minimum_required(VERSION 3.10)
-project(SqLiteImpl LANGUAGES CXX)
-
-add_library(SqLiteImpl SHARED
-  SqLiteHelper.cpp
-  SqLiteHelper.hpp
-  SqLiteImpl.cpp
-  SqLiteImpl.hpp
-)
-
-set_target_properties(SqLiteImpl PROPERTIES
-       FOLDER cpp/test/integration
-)
-
-include(GenerateExportHeader)
-generate_export_header(SqLiteImpl)
+set -x -e -o pipefail
 
-target_include_directories(SqLiteImpl
-  PUBLIC
-         $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
+apt-get -y install libc++-dev libc++abi-dev wget doxygen openjdk-8-jdk 
zlib1g-dev graphviz build-essential python python-pip
 
-target_link_libraries(SqLiteImpl
-  PUBLIC
-    apache-geode
-    sqlite
-  PRIVATE
-    _WarningsAsError
-)
+pip install --upgrade pip
diff --git a/sqliteimpl/CMakeLists.txt b/packer/ubuntu/update.sh
similarity index 60%
copy from sqliteimpl/CMakeLists.txt
copy to packer/ubuntu/update.sh
index ea81bf2..13bc1d1 100644
--- a/sqliteimpl/CMakeLists.txt
+++ b/packer/ubuntu/update.sh
@@ -1,3 +1,5 @@
+#!/usr/bin/env bash
+
 # 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.
@@ -13,31 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-cmake_minimum_required(VERSION 3.10)
-project(SqLiteImpl LANGUAGES CXX)
-
-add_library(SqLiteImpl SHARED
-  SqLiteHelper.cpp
-  SqLiteHelper.hpp
-  SqLiteImpl.cpp
-  SqLiteImpl.hpp
-)
-
-set_target_properties(SqLiteImpl PROPERTIES
-       FOLDER cpp/test/integration
-)
-
-include(GenerateExportHeader)
-generate_export_header(SqLiteImpl)
-
-target_include_directories(SqLiteImpl
-  PUBLIC
-         $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
+set -x -e -o pipefail
 
-target_link_libraries(SqLiteImpl
-  PUBLIC
-    apache-geode
-    sqlite
-  PRIVATE
-    _WarningsAsError
-)
+export DEBIAN_FRONTEND=noninteractive
+apt update && apt -yq full-upgrade && apt-get -y autoremove
diff --git a/sqliteimpl/CMakeLists.txt b/packer/ubuntu/wait-for-cloud-init.sh
similarity index 60%
copy from sqliteimpl/CMakeLists.txt
copy to packer/ubuntu/wait-for-cloud-init.sh
index ea81bf2..86b394c 100644
--- a/sqliteimpl/CMakeLists.txt
+++ b/packer/ubuntu/wait-for-cloud-init.sh
@@ -1,3 +1,5 @@
+#!/usr/bin/env bash
+
 # 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.
@@ -13,31 +15,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-cmake_minimum_required(VERSION 3.10)
-project(SqLiteImpl LANGUAGES CXX)
-
-add_library(SqLiteImpl SHARED
-  SqLiteHelper.cpp
-  SqLiteHelper.hpp
-  SqLiteImpl.cpp
-  SqLiteImpl.hpp
-)
-
-set_target_properties(SqLiteImpl PROPERTIES
-       FOLDER cpp/test/integration
-)
-
-include(GenerateExportHeader)
-generate_export_header(SqLiteImpl)
 
-target_include_directories(SqLiteImpl
-  PUBLIC
-         $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
+#set -x
+set -e
+set -o pipefail
 
-target_link_libraries(SqLiteImpl
-  PUBLIC
-    apache-geode
-    sqlite
-  PRIVATE
-    _WarningsAsError
-)
+# leaves tail running but we should be restarting anyway
+{ tail -n +1 -f /var/log/cloud-init.log /var/log/cloud-init-output.log & } | 
sed \
+               -e '/Cloud-init .* finished/q' \
+               -e '/Failed at merging in cloud config/q1'
diff --git a/sqliteimpl/CMakeLists.txt b/sqliteimpl/CMakeLists.txt
index ea81bf2..4b6e622 100644
--- a/sqliteimpl/CMakeLists.txt
+++ b/sqliteimpl/CMakeLists.txt
@@ -23,8 +23,12 @@ add_library(SqLiteImpl SHARED
   SqLiteImpl.hpp
 )
 
+if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+  set_source_files_properties(SqLiteImpl.cpp PROPERTIES COMPILE_FLAGS 
-Wno-unused-result)
+endif()
+
 set_target_properties(SqLiteImpl PROPERTIES
-       FOLDER cpp/test/integration
+  FOLDER cpp/test/integration
 )
 
 include(GenerateExportHeader)
@@ -32,7 +36,7 @@ generate_export_header(SqLiteImpl)
 
 target_include_directories(SqLiteImpl
   PUBLIC
-         $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
 
 target_link_libraries(SqLiteImpl
   PUBLIC

Reply via email to