Remove bash-isms in cloud build scripts

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
Nathan LeClaire 2016-07-20 13:47:07 -07:00
parent 59dd4f2f1d
commit 4b8ea4d403
9 changed files with 16 additions and 18 deletions

View File

@ -3,7 +3,6 @@ FROM alpine
RUN apk add --update \
python \
py-pip \
bash \
curl \
e2fsprogs \
jq \

View File

@ -1,7 +1,6 @@
FROM golang:alpine
RUN apk add --update \
bash \
curl \
e2fsprogs \
syslinux \

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# Usage: ./aws/approve-account.sh [ACCOUNT_ID] [AMI_FILE]
#

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# Script to automate creation and snapshotting of a Moby AMI. Currently, it's
# intended to be invoked from an instance running in the same region as the
@ -7,7 +7,7 @@
set -e
declare -xr PROVIDER="aws"
PROVIDER="aws"
source "./build-common.sh"
source "${MOBY_SRC_ROOT}/cloud/aws/common.sh"
@ -84,7 +84,7 @@ clean_tagged_resources()
fi
VOLUME_ID=$(aws ec2 describe-volumes --filters "Name=tag-key,Values=$1" | jq -r .Volumes[0].VolumeId)
if [ ${VOLUME_ID} == "null" ]
if [ ${VOLUME_ID} = "null" ]
then
arrowecho "No volume found, skipping"
else
@ -96,7 +96,7 @@ clean_tagged_resources()
fi
IMAGE_ID=$(aws ec2 describe-images --filters "Name=tag-key,Values=$1" | jq -r .Images[0].ImageId)
if [ ${IMAGE_ID} == "null" ]
if [ ${IMAGE_ID} = "null" ]
then
arrowecho "No image found, skipping"
else
@ -110,7 +110,7 @@ clean_tagged_resources()
fi
SNAPSHOT_ID=$(aws ec2 describe-snapshots --filters "Name=tag-key,Values=$1" | jq -r .Snapshots[0].SnapshotId)
if [ ${SNAPSHOT_ID} == "null" ]
if [ ${SNAPSHOT_ID} = "null" ]
then
arrowecho "No snapshot found, skipping"
else

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# Usage: ./cloud/aws/copy-amis.sh
# Assumptions:

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# Quick script to boot an instance from generated AMI. Intended to be invoked
# from "alpine" directory.
@ -18,7 +18,7 @@ manager_sg_id()
attach_security_group()
{
MANAGER_SG_ID=$(manager_sg_id)
if [ ${MANAGER_SG_ID} == "null" ]
if [ ${MANAGER_SG_ID} = "null" ]
then
CUR_INSTANCE_MAC=$(wget -qO- ${METADATA}/network/interfaces/macs)
CUR_INSTANCE_VPC_CIDR=$(wget -qO- ${METADATA}/network/interfaces/macs/${CUR_INSTANCE_MAC}vpc-ipv4-cidr-block)
@ -56,7 +56,7 @@ poll_instance_log()
echo "Waiting for instance boot log to become available"
INSTANCE_BOOT_LOG="null"
while [ ${INSTANCE_BOOT_LOG} == "null" ]
while [ ${INSTANCE_BOOT_LOG} = "null" ]
do
INSTANCE_BOOT_LOG=$(aws ec2 get-console-output --instance-id "$1" | jq -r .Output)
sleep 5

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# Script to automate the creation of a VHD for Moby in Azure, and upload it to
# an Azure storage account (needed in order to launch it on Azure, or upload it
@ -22,7 +22,7 @@
set -e
declare -xr PROVIDER="azure"
PROVIDER="azure"
source "build-common.sh"

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -e
@ -26,7 +26,7 @@ format_on_device()
# TODO (nathanleclaire): Any more readable or more elegant solution to
# account for this minor (specify 1st partition as bootable) difference
# between cloud builds?
if [ "${PROVIDER}" == "aws" ]
if [ "${PROVIDER}" = "aws" ]
then
# This heredoc might be confusing at first glance, so here is a detailed
# summary of what each line does:
@ -49,7 +49,7 @@ a
1
w
EOF
elif [ ${PROVIDER} == "azure" ]
elif [ ${PROVIDER} = "azure" ]
then
fdisk "$1" << EOF
n