|
| 1 | +#!/bin/bash |
| 2 | +##===----------------------------------------------------------------------===## |
| 3 | +## |
| 4 | +## This source file is part of the SwiftAWSLambdaRuntime open source project |
| 5 | +## |
| 6 | +## Copyright (c) 2025 Apple Inc. and the SwiftAWSLambdaRuntime project authors |
| 7 | +## Licensed under Apache License v2.0 |
| 8 | +## |
| 9 | +## See LICENSE.txt for license information |
| 10 | +## See CONTRIBUTORS.txt for the list of SwiftAWSLambdaRuntime project authors |
| 11 | +## |
| 12 | +## SPDX-License-Identifier: Apache-2.0 |
| 13 | +## |
| 14 | +##===----------------------------------------------------------------------===## |
| 15 | + |
| 16 | +sudo apt update && sudo apt -y upgrade |
| 17 | + |
| 18 | +# Install Swift 6.0.3 |
| 19 | +sudo apt-get -y install \ |
| 20 | + binutils \ |
| 21 | + git \ |
| 22 | + gnupg2 \ |
| 23 | + libc6-dev \ |
| 24 | + libcurl4-openssl-dev \ |
| 25 | + libedit2 \ |
| 26 | + libgcc-13-dev \ |
| 27 | + libncurses-dev \ |
| 28 | + libpython3-dev \ |
| 29 | + libsqlite3-0 \ |
| 30 | + libstdc++-13-dev \ |
| 31 | + libxml2-dev \ |
| 32 | + libz3-dev \ |
| 33 | + pkg-config \ |
| 34 | + tzdata \ |
| 35 | + unzip \ |
| 36 | + zip \ |
| 37 | + zlib1g-dev |
| 38 | + |
| 39 | +wget https://download.swift.org/swift-6.0.3-release/ubuntu2404-aarch64/swift-6.0.3-RELEASE/swift-6.0.3-RELEASE-ubuntu24.04-aarch64.tar.gz |
| 40 | + |
| 41 | +tar xfvz swift-6.0.3-RELEASE-ubuntu24.04-aarch64.tar.gz |
| 42 | + |
| 43 | +export PATH=/home/ubuntu/swift-6.0.3-RELEASE-ubuntu24.04-aarch64/usr/bin:"${PATH}" |
| 44 | + |
| 45 | +swift --version |
| 46 | + |
| 47 | +# Install Docker |
| 48 | +sudo apt-get update |
| 49 | +sudo apt-get install -y ca-certificates curl |
| 50 | +sudo install -m 0755 -d /etc/apt/keyrings |
| 51 | +sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc |
| 52 | +sudo chmod a+r /etc/apt/keyrings/docker.asc |
| 53 | + |
| 54 | +# Add the repository to Apt sources: |
| 55 | +echo \ |
| 56 | + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ |
| 57 | + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ |
| 58 | + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null |
| 59 | +sudo apt-get update |
| 60 | + |
| 61 | +sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin |
| 62 | + |
| 63 | +# Add the current user to the docker group |
| 64 | +sudo usermod -aG docker $USER |
| 65 | + |
| 66 | +# LOGOUT and LOGIN to apply the changes |
| 67 | +exit |
| 68 | + |
| 69 | +# reconnect with ssh |
| 70 | + |
| 71 | +export PATH=/home/ubuntu/swift-6.0.3-RELEASE-ubuntu24.04-aarch64/usr/bin:"${PATH}" |
| 72 | + |
| 73 | +# clone a project |
| 74 | +git clone https://github.com/swift-server/swift-aws-lambda-runtime.git |
| 75 | + |
| 76 | +# build the project |
| 77 | +cd swift-aws-lambda-runtime/Examples/ResourcesPackaging/ |
| 78 | +LAMBDA_USE_LOCAL_DEPS=../.. swift package archive --allow-network-connections docker |
0 commit comments