mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-23 11:00:25 +00:00
Remove bash-isms in cloud build scripts
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
parent
59dd4f2f1d
commit
4b8ea4d403
@ -3,7 +3,6 @@ FROM alpine
|
|||||||
RUN apk add --update \
|
RUN apk add --update \
|
||||||
python \
|
python \
|
||||||
py-pip \
|
py-pip \
|
||||||
bash \
|
|
||||||
curl \
|
curl \
|
||||||
e2fsprogs \
|
e2fsprogs \
|
||||||
jq \
|
jq \
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
FROM golang:alpine
|
FROM golang:alpine
|
||||||
|
|
||||||
RUN apk add --update \
|
RUN apk add --update \
|
||||||
bash \
|
|
||||||
curl \
|
curl \
|
||||||
e2fsprogs \
|
e2fsprogs \
|
||||||
syslinux \
|
syslinux \
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
# Usage: ./aws/approve-account.sh [ACCOUNT_ID] [AMI_FILE]
|
# Usage: ./aws/approve-account.sh [ACCOUNT_ID] [AMI_FILE]
|
||||||
#
|
#
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
# Script to automate creation and snapshotting of a Moby AMI. Currently, it's
|
# 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
|
# intended to be invoked from an instance running in the same region as the
|
||||||
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
declare -xr PROVIDER="aws"
|
PROVIDER="aws"
|
||||||
|
|
||||||
source "./build-common.sh"
|
source "./build-common.sh"
|
||||||
source "${MOBY_SRC_ROOT}/cloud/aws/common.sh"
|
source "${MOBY_SRC_ROOT}/cloud/aws/common.sh"
|
||||||
@ -84,7 +84,7 @@ clean_tagged_resources()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
VOLUME_ID=$(aws ec2 describe-volumes --filters "Name=tag-key,Values=$1" | jq -r .Volumes[0].VolumeId)
|
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
|
then
|
||||||
arrowecho "No volume found, skipping"
|
arrowecho "No volume found, skipping"
|
||||||
else
|
else
|
||||||
@ -96,7 +96,7 @@ clean_tagged_resources()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
IMAGE_ID=$(aws ec2 describe-images --filters "Name=tag-key,Values=$1" | jq -r .Images[0].ImageId)
|
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
|
then
|
||||||
arrowecho "No image found, skipping"
|
arrowecho "No image found, skipping"
|
||||||
else
|
else
|
||||||
@ -110,7 +110,7 @@ clean_tagged_resources()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
SNAPSHOT_ID=$(aws ec2 describe-snapshots --filters "Name=tag-key,Values=$1" | jq -r .Snapshots[0].SnapshotId)
|
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
|
then
|
||||||
arrowecho "No snapshot found, skipping"
|
arrowecho "No snapshot found, skipping"
|
||||||
else
|
else
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
# Usage: ./cloud/aws/copy-amis.sh
|
# Usage: ./cloud/aws/copy-amis.sh
|
||||||
# Assumptions:
|
# Assumptions:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
# Quick script to boot an instance from generated AMI. Intended to be invoked
|
# Quick script to boot an instance from generated AMI. Intended to be invoked
|
||||||
# from "alpine" directory.
|
# from "alpine" directory.
|
||||||
@ -18,7 +18,7 @@ manager_sg_id()
|
|||||||
attach_security_group()
|
attach_security_group()
|
||||||
{
|
{
|
||||||
MANAGER_SG_ID=$(manager_sg_id)
|
MANAGER_SG_ID=$(manager_sg_id)
|
||||||
if [ ${MANAGER_SG_ID} == "null" ]
|
if [ ${MANAGER_SG_ID} = "null" ]
|
||||||
then
|
then
|
||||||
CUR_INSTANCE_MAC=$(wget -qO- ${METADATA}/network/interfaces/macs)
|
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)
|
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"
|
echo "Waiting for instance boot log to become available"
|
||||||
|
|
||||||
INSTANCE_BOOT_LOG="null"
|
INSTANCE_BOOT_LOG="null"
|
||||||
while [ ${INSTANCE_BOOT_LOG} == "null" ]
|
while [ ${INSTANCE_BOOT_LOG} = "null" ]
|
||||||
do
|
do
|
||||||
INSTANCE_BOOT_LOG=$(aws ec2 get-console-output --instance-id "$1" | jq -r .Output)
|
INSTANCE_BOOT_LOG=$(aws ec2 get-console-output --instance-id "$1" | jq -r .Output)
|
||||||
sleep 5
|
sleep 5
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
# Script to automate the creation of a VHD for Moby in Azure, and upload it to
|
# 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
|
# an Azure storage account (needed in order to launch it on Azure, or upload it
|
||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
declare -xr PROVIDER="azure"
|
PROVIDER="azure"
|
||||||
|
|
||||||
source "build-common.sh"
|
source "build-common.sh"
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ format_on_device()
|
|||||||
# TODO (nathanleclaire): Any more readable or more elegant solution to
|
# TODO (nathanleclaire): Any more readable or more elegant solution to
|
||||||
# account for this minor (specify 1st partition as bootable) difference
|
# account for this minor (specify 1st partition as bootable) difference
|
||||||
# between cloud builds?
|
# between cloud builds?
|
||||||
if [ "${PROVIDER}" == "aws" ]
|
if [ "${PROVIDER}" = "aws" ]
|
||||||
then
|
then
|
||||||
# This heredoc might be confusing at first glance, so here is a detailed
|
# This heredoc might be confusing at first glance, so here is a detailed
|
||||||
# summary of what each line does:
|
# summary of what each line does:
|
||||||
@ -49,7 +49,7 @@ a
|
|||||||
1
|
1
|
||||||
w
|
w
|
||||||
EOF
|
EOF
|
||||||
elif [ ${PROVIDER} == "azure" ]
|
elif [ ${PROVIDER} = "azure" ]
|
||||||
then
|
then
|
||||||
fdisk "$1" << EOF
|
fdisk "$1" << EOF
|
||||||
n
|
n
|
||||||
|
Loading…
Reference in New Issue
Block a user