-
Notifications
You must be signed in to change notification settings - Fork 113
examples deployment scripts refresh #133
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
Conversation
motivation: make sure examples are up tp date changes: * use swift:5.2 images instead of nighlies * compute dependencies to make zipfile as small as possible * make scripts more consistent
cp -Pv /usr/lib/swift/linux/lib*so* "$target" | ||
#cp -Pv /usr/lib/swift/linux/lib*so* "$target" | ||
# add the target deps based on ldd | ||
ldd ".build/release/$executable" | grep swift | awk '{print $3}' | xargs cp -Pv -t "$target" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀 this is the most interesting part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, but could we copy the libicu libs directly (and not just the symlinks), if we specify xargs cp -Lv -t "$target"
From the man cp
-L If the -R option is specified, all symbolic links are followed.
-P If the -R option is specified, no symbolic links are followed. This is the default.
cc @drexin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, this looks much cleaner! Some questions inline...
echo "-------------------------------------------------------------------------" | ||
echo "building \"$executable\" lambda" | ||
echo "-------------------------------------------------------------------------" | ||
docker run --rm -v "$workspace":/workspace -w /workspace/Examples/LambdaFunctions builder bash -cl "swift build --product $executable -c release -Xswiftc -g" | ||
docker run --rm -v "$workspace":/workspace -w /workspace/Examples/LambdaFunctions builder \ | ||
bash -cl "swift build --product $executable -c release" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to fill a knowledge gap on my site: What's the benefit of using bash -cl "cmd"
vs. just cmd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
old habit to make sure we get login shell: https://www.gnu.org/software/bash/manual/html_node/Invoking-Bash.html
@@ -17,42 +17,25 @@ set -eu | |||
|
|||
# Lambda Function name (must exist in AWS Lambda) | |||
lambda_name=SwiftSample | |||
|
|||
# S3 bucket name to upload zip file (must exist in AWS S3) | |||
s3_bucket=swift-lambda-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in some issue, we should make this bucket configurable since bucket names must be unique worldwide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should prompt the user for the name of the bucket and lambda. is this what you are suggesting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. maybe store it between runs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a prompt. wdyt?
cp -Pv /usr/lib/swift/linux/lib*so* "$target" | ||
#cp -Pv /usr/lib/swift/linux/lib*so* "$target" | ||
# add the target deps based on ldd | ||
ldd ".build/release/$executable" | grep swift | awk '{print $3}' | xargs cp -Pv -t "$target" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, but could we copy the libicu libs directly (and not just the symlinks), if we specify xargs cp -Lv -t "$target"
From the man cp
-L If the -R option is specified, all symbolic links are followed.
-P If the -R option is specified, no symbolic links are followed. This is the default.
cc @drexin
@fabianfett updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
motivation: make sure examples are up tp date
changes: