Files
runner-images-temp/images/linux/scripts/installers/swift.sh
T

28 lines
1.1 KiB
Bash
Raw Normal View History

2020-10-07 13:49:40 +05:00
#!/bin/bash -e
2020-03-24 09:27:15 +03:00
################################################################################
## File: swift.sh
## Desc: Installs Swift
################################################################################
2021-03-30 15:23:57 +03:00
# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh
2020-12-29 10:02:46 +03:00
2020-03-27 13:55:47 +03:00
# Install
2020-03-24 09:27:15 +03:00
image_label="$(lsb_release -rs)"
2020-10-07 13:49:40 +05:00
swift_version=$(curl -s -L -N https://swift.org/download|awk -F"[ <]" '/id="swift-/ {print $4; exit}')
2020-03-24 15:56:42 +03:00
2021-03-30 15:23:57 +03:00
swift_tar_name="swift-$swift_version-RELEASE-ubuntu$image_label.tar.gz"
swift_tar_url="https://swift.org/builds/swift-$swift_version-release/ubuntu${image_label//./}/swift-$swift_version-RELEASE/$swift_tar_name"
download_with_retries $swift_tar_url "/tmp" "$swift_tar_name"
2020-10-07 13:49:40 +05:00
2021-03-30 15:23:57 +03:00
tar xzf /tmp/$swift_tar_name
2020-03-24 16:28:01 +03:00
mv swift-$swift_version-RELEASE-ubuntu$image_label /usr/share/swift
2020-03-24 15:56:42 +03:00
SWIFT_PATH="/usr/share/swift/usr/bin"
2020-03-25 09:26:22 +03:00
SWIFT_BIN="$SWIFT_PATH/swift"
2020-10-20 11:45:08 +03:00
SWIFTC_BIN="$SWIFT_PATH/swiftc"
2020-03-24 16:28:01 +03:00
ln -s "$SWIFT_BIN" /usr/local/bin/swift
2020-10-20 11:45:08 +03:00
ln -s "$SWIFTC_BIN" /usr/local/bin/swiftc
2020-03-24 16:28:01 +03:00
echo "SWIFT_PATH=$SWIFT_PATH" | tee -a /etc/environment
2020-03-24 09:27:15 +03:00
2020-12-29 10:02:46 +03:00
invoke_tests "Common" "Swift"