Silence command output.
This commit is contained in:
parent
893f8d4f61
commit
2e060ed5ae
|
@ -14,7 +14,7 @@ fi
|
|||
# let's download our base image.
|
||||
if ! lxc image list --format csv --columns l --project default | grep -q "$UBUNTU_BASE_IMAGE_NAME"; then
|
||||
# copy the image down from canonical.
|
||||
lxc image copy "images:$BASE_LXC_IMAGE" "$REMOTE_NAME": --alias "$UBUNTU_BASE_IMAGE_NAME" --public --vm --auto-update --target-project default
|
||||
lxc image copy -q "images:$BASE_LXC_IMAGE" "$REMOTE_NAME": --alias "$UBUNTU_BASE_IMAGE_NAME" --public --vm --auto-update --target-project default
|
||||
fi
|
||||
|
||||
# If the lxc VM does exist, then we will delete it (so we can start fresh)
|
||||
|
@ -28,7 +28,9 @@ else
|
|||
|
||||
if ! lxc list --project default | grep -q "$BASE_IMAGE_VM_NAME"; then
|
||||
# the base image is ubuntu:22.04.
|
||||
lxc init -q --profile="$BASE_IMAGE_VM_NAME" "$UBUNTU_BASE_IMAGE_NAME" "$BASE_IMAGE_VM_NAME" --vm --project default || true
|
||||
# this command needs a pseudo-terminal for some reason, thus the script
|
||||
script -q -c "lxc init -q --profile=$BASE_IMAGE_VM_NAME $UBUNTU_BASE_IMAGE_NAME $BASE_IMAGE_VM_NAME --vm --project default" /dev/null
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
|
||||
|
@ -85,8 +87,8 @@ else
|
|||
|
||||
fi
|
||||
|
||||
echo "INFO: Publishing '$BASE_IMAGE_VM_NAME' as image '$DOCKER_BASE_IMAGE_NAME'. Please wait."
|
||||
lxc publish --public "$BASE_IMAGE_VM_NAME/$UBUNTU_BASE_IMAGE_NAME" --project default --alias="$DOCKER_BASE_IMAGE_NAME" --compression none
|
||||
echo "INFO: Publishing '$BASE_IMAGE_VM_NAME' as image '$DOCKER_BASE_IMAGE_NAME'. Please wait." > /dev/null
|
||||
lxc publish -q --public "$BASE_IMAGE_VM_NAME/$UBUNTU_BASE_IMAGE_NAME" --project default --alias="$DOCKER_BASE_IMAGE_NAME" --compression none > /dev/null
|
||||
|
||||
echo "INFO: Success creating the base image. Deleting artifacts from the build process."
|
||||
lxc delete -f "$BASE_IMAGE_VM_NAME" --project default
|
||||
|
|
|
@ -36,7 +36,7 @@ done
|
|||
|
||||
# generate the custom cloud-init file. Cloud init installs and configures sshd
|
||||
SSH_AUTHORIZED_KEY=$(<"$SSH_PUBKEY_PATH")
|
||||
eval "$(ssh-agent -s)"
|
||||
eval "$(ssh-agent -s)" >> /dev/null
|
||||
ssh-add "$SSH_HOME/id_rsa" >> /dev/null
|
||||
export SSH_AUTHORIZED_KEY="$SSH_AUTHORIZED_KEY"
|
||||
|
||||
|
@ -303,14 +303,14 @@ fi
|
|||
|
||||
if [ "$VIRTUAL_MACHINE" = base ]; then
|
||||
if ! lxc profile list --format csv --project default | grep -q "$LXD_HOSTNAME"; then
|
||||
lxc profile create "$LXD_HOSTNAME" --project default
|
||||
lxc profile create "$LXD_HOSTNAME" --project default >> /dev/null
|
||||
fi
|
||||
|
||||
# configure the profile with our generated cloud-init.yml file.
|
||||
cat "$YAML_PATH" | lxc profile edit "$LXD_HOSTNAME" --project default
|
||||
else
|
||||
if ! lxc profile list --format csv | grep -q "$LXD_HOSTNAME"; then
|
||||
lxc profile create "$LXD_HOSTNAME"
|
||||
lxc profile create "$LXD_HOSTNAME" >> /dev/null
|
||||
fi
|
||||
|
||||
# configure the profile with our generated cloud-init.yml file.
|
||||
|
|
|
@ -103,7 +103,7 @@ if ! lxc image list | grep -q "$UBUNTU_BASE_IMAGE_NAME"; then
|
|||
if [ -d "$IMAGE_PATH" ] && [ -f "$METADATA_FILE" ] && [ -f "$IMAGE_FILE" ]; then
|
||||
lxc image import "$METADATA_FILE" "$IMAGE_FILE" --alias "$UBUNTU_BASE_IMAGE_NAME"
|
||||
else
|
||||
lxc image copy "images:$BASE_LXC_IMAGE" local: --alias "$UBUNTU_BASE_IMAGE_NAME" --vm --auto-update
|
||||
lxc image copy -q "images:$BASE_LXC_IMAGE" local: --alias "$UBUNTU_BASE_IMAGE_NAME" --vm --auto-update
|
||||
mkdir -p "$IMAGE_PATH"
|
||||
lxc image export "$UBUNTU_BASE_IMAGE_NAME" "$IMAGE_PATH" --vm
|
||||
fi
|
||||
|
@ -130,9 +130,9 @@ if ! lxc list --format csv | grep -q ss-mgmt; then
|
|||
# TODO check to see if there's an existing ss-mgmt image to spawn from, otherwise do this.
|
||||
if lxc image list | grep -q ss-mgmt; then
|
||||
FROM_BUILT_IMAGE=true
|
||||
lxc init -q ss-mgmt ss-mgmt --vm -c limits.cpu=4 -c limits.memory=4GiB --profile=default
|
||||
script -q -c "lxc init -q ss-mgmt ss-mgmt --vm -c limits.cpu=4 -c limits.memory=4GiB --profile=default" >> /dev/null
|
||||
else
|
||||
lxc init -q "images:$BASE_LXC_IMAGE" ss-mgmt --vm -c limits.cpu=4 -c limits.memory=4GiB --profile=default
|
||||
script -q -c "lxc init -q images:$BASE_LXC_IMAGE ss-mgmt --vm -c limits.cpu=4 -c limits.memory=4GiB --profile=default" >> /dev/null
|
||||
fi
|
||||
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue