Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reboot Cloud9 instead of explicitly resizing the partition #688

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 4 additions & 28 deletions lab/cfn/eks-workshop-ide-cfn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -285,34 +285,6 @@ Resources:
runCommand:
- !Sub |
set -e

STR=$(cat /etc/os-release)
SUB="VERSION_ID=\"2\""

marker_file="/root/resized.mark"

if [[ ! -f "$marker_file" ]]; then
if [ $(readlink -f /dev/xvda) = "/dev/xvda" ]
then
sudo growpart /dev/xvda 1
if [[ "$STR" == *"$SUB"* ]]
then
sudo xfs_growfs -d /
else
sudo resize2fs /dev/xvda1
fi
else
sudo growpart /dev/nvme0n1 1
if [[ "$STR" == *"$SUB"* ]]
then
sudo xfs_growfs -d /
else
sudo resize2fs /dev/nvme0n1p1
fi
fi
fi

touch $marker_file

export AWS_REGION="${AWS::Region}"
export REPOSITORY_OWNER="${RepositoryOwner}"
Expand All @@ -325,6 +297,10 @@ Resources:

sudo -E -H -u ec2-user bash -c "curl -fsSL https://raw.githubusercontent.com/${RepositoryOwner}/${RepositoryName}/${RepositoryRef}/lab/scripts/setup.sh | bash"

echo "Rebooting...."

FILE=$(mktemp) && echo $FILE && echo '#!/bin/bash' > $FILE && echo 'reboot -f --verbose' >> $FILE && at now + 1 minute -f $FILE

EksWorkshopC9InstanceProfile:
Type: AWS::IAM::InstanceProfile
Properties:
Expand Down
Loading