This is an automated email from the ASF dual-hosted git repository.
jbarrett 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 10eb064 Switch Linux from 'build' to 'ec2-user' account for building,
and eliminate creation of 'build' user on Linux.
10eb064 is described below
commit 10eb064fccbc80505811b1bbb687b5e629ab0003
Author: Blake Bender <[email protected]>
AuthorDate: Thu Jul 12 16:20:06 2018 -0700
Switch Linux from 'build' to 'ec2-user' account for building, and eliminate
creation of 'build' user on Linux.
Co-authored-by: Jacob Barret <[email protected]>
---
packer/build-linux.json | 15 -----------
packer/rhel/add-user-build.sh | 22 ---------------
packer/rhel/files/etc/init-user.sh | 51 -----------------------------------
packer/rhel/install-scl-devtoolset.sh | 2 +-
packer/rhel/install-scl-python27.sh | 2 +-
5 files changed, 2 insertions(+), 90 deletions(-)
diff --git a/packer/build-linux.json b/packer/build-linux.json
index 4adbae0..aa69695 100644
--- a/packer/build-linux.json
+++ b/packer/build-linux.json
@@ -39,20 +39,6 @@
},
{
"type":"file",
- "source":"rhel/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"
- ]
- },
- {
- "type":"file",
"source":"rhel/init-hosts.rc.local",
"destination":"/tmp/init-hosts.rc.local"
},
@@ -68,7 +54,6 @@
"execute_command":"{{.Vars}} sudo -E -S bash '{{.Path}}'",
"scripts":[
"rhel/disable-selinux.sh",
- "rhel/add-user-build.sh",
"rhel/install-repos.sh",
"rhel/install-scl-devtoolset.sh",
"rhel/install-scl-python27.sh",
diff --git a/packer/rhel/add-user-build.sh b/packer/rhel/add-user-build.sh
deleted file mode 100755
index fce6cbb..0000000
--- a/packer/rhel/add-user-build.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/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.
-
-#set -x -e -o pipefail
-
-useradd build
-
-(crontab -l -u build ; echo "@reboot /etc/init-user.sh") | sort - | uniq - |
crontab -u build -
diff --git a/packer/rhel/files/etc/init-user.sh
b/packer/rhel/files/etc/init-user.sh
deleted file mode 100644
index 2ceff71..0000000
--- a/packer/rhel/files/etc/init-user.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/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/rhel/install-scl-devtoolset.sh
b/packer/rhel/install-scl-devtoolset.sh
index f165e44..f128096 100644
--- a/packer/rhel/install-scl-devtoolset.sh
+++ b/packer/rhel/install-scl-devtoolset.sh
@@ -20,4 +20,4 @@ set -x -e -o pipefail
yum-config-manager --enable rhui-REGION-rhel-server-rhscl
yum -y install devtoolset-4-gcc-c++
-echo "source scl_source enable devtoolset-4" >> ~build/.bashrc
+echo "source scl_source enable devtoolset-4" >> ~/.bashrc
diff --git a/packer/rhel/install-scl-python27.sh
b/packer/rhel/install-scl-python27.sh
index 666a3e9..cfac63d 100644
--- a/packer/rhel/install-scl-python27.sh
+++ b/packer/rhel/install-scl-python27.sh
@@ -21,4 +21,4 @@ yum-config-manager --enable rhui-REGION-rhel-server-rhscl
yum -y install python27-python-pip
scl enable python27 'pip install --upgrade pip'
-echo "source scl_source enable python27" >> ~build/.bashrc
+echo "source scl_source enable python27" >> ~/.bashrc