Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add a flag to skip .so file strip. #2

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

Merged
tobilg merged 1 commit into tobilg:master from blimmer:add-flag-to-strip-so-strip
May 27, 2020
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Usage: build.sh [-p PYTHON_VER] [-n NAME] [-r] [-h] [-v]
-n NAME : Name of the layer
-r : Raw mode, don't zip layer contents
-d : Don't install Python dependencies
-s : Don't strip .so files
-h : Help
-v : Display build.sh version
```
Expand Down
6 changes: 4 additions & 2 deletions _make.sh
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ rm -rf pip*
find . -type d -name "tests" -exec rm -rf {} +
find . -type d -name "test" -exec rm -rf {} +
find . -type d -name "__pycache__" -exec rm -rf {} +
find -name "*.so" -not -path "*/PIL/*" | xargs strip
find -name "*.so.*" -not -path "*/PIL/*" | xargs strip
if [[ "$STRIP" == true ]]; then
find -name "*.so" -not -path "*/PIL/*" | xargs strip
find -name "*.so.*" -not -path "*/PIL/*" | xargs strip
fi
find . -name '*.pyc' -delete
if [[ -f "/temp/build/_clean.sh" ]]; then
echo "Running custom cleaning script"
Expand Down
9 changes: 6 additions & 3 deletions build.sh
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,19 @@ usage() {
echo -e " -n NAME\t: Name of the layer"
echo -e " -r\t\t: Raw mode, don't zip layer contents"
echo -e " -d\t\t: Don't install Python dependencies"
echo -e " -s\t\t: Don't strip .so files"
echo -e " -h\t\t: Help"
echo -e " -v\t\t: Display ${scriptname} version"
}

# Handle configuration
while getopts ":p:n:drhv" arg; do
while getopts ":p:n:dsrhv" arg; do
case "${arg}" in
p) PYTHON_VER=${OPTARG};;
n) NAME=${OPTARG};;
r) RAW_MODE=true;;
d) NO_DEPS=true;;
s) STRIP=false;;
h) usage; exit;;
v) displayVer; exit;;
\?) echo -e "Error - Invalid option: $OPTARG"; usage; exit;;
Expand All @@ -59,6 +61,7 @@ BASE_DIR=$(basename $CURRENT_DIR)
PARENT_DIR=${CURRENT_DIR%"${BASE_DIR}"}
RAW_MODE="${RAW_MODE:-false}"
NO_DEPS="${NO_DEPS:-false}"
STRIP="${STRIP:-true}"

# Find location of requirements.txt
if [[ -f "${CURRENT_DIR}/requirements.txt" ]]; then
Expand Down Expand Up @@ -93,12 +96,12 @@ fi

if [[ "$RAW_MODE" = true ]]; then
echo "Using RAW mode"
else
else
echo "Using ZIP mode"
fi

# Run build
docker run --rm -e PYTHON_VER="$PYTHON_VER" -e NAME="$NAME" -e RAW_MODE="$RAW_MODE" -e NO_DEPS="$NO_DEPS" -e PARENT_DIR="${PARENT_DIR}" -e SUBDIR_MODE="$SUBDIR_MODE" -v "$CURRENT_DIR":/var/task -v "$REQ_PATH":/temp/build/requirements.txt -v "$CLEAN_PATH":/temp/build/_clean.sh "lambci/lambda:build-python${PYTHON_VER}" bash /var/task/_make.sh
docker run --rm -e PYTHON_VER="$PYTHON_VER" -e NAME="$NAME" -e RAW_MODE="$RAW_MODE" -e NO_DEPS="$NO_DEPS" -e STRIP="$STRIP" -e PARENT_DIR="${PARENT_DIR}" -e SUBDIR_MODE="$SUBDIR_MODE" -v "$CURRENT_DIR":/var/task -v "$REQ_PATH":/temp/build/requirements.txt -v "$CLEAN_PATH":/temp/build/_clean.sh "lambci/lambda:build-python${PYTHON_VER}" bash /var/task/_make.sh

# Move ZIP to parent dir if SUBDIR_MODE set
if [[ "$SUBDIR_MODE" ]]; then
Expand Down

AltStyle によって変換されたページ (->オリジナル) /