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
Use latest nancy #9
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
a11a2f7
add nancyVersion input and pass as env var to docker
bhamail 70757a2
debug info
bhamail c395e69
input syntax
bhamail b09e439
input syntax with INPUT_ prefix
bhamail 711ab1f
extract install stuff to script
bhamail 19f1000
debug info
bhamail 38c2483
try removing shebang from install script
bhamail d4b95c6
add alpine shebang for ash
bhamail d1fbb05
add alpine shebang for ash
bhamail 8dcf85e
add full bash
bhamail ce1f48d
guard against missing desired version
bhamail 005dee4
try passing desired version to script
bhamail bc6b753
move nancy install logic to entrypoint.sh
bhamail 66d9163
debug info
bhamail 3df7026
debug info
bhamail d1a5362
fix path to script
bhamail 889730e
fun with version prefix
bhamail bc8c847
detect malformed version string
bhamail 0a08113
remove bash update
bhamail 7c465c6
use validation of version string that works under alpine
bhamail d30889e
cleanup
bhamail c932533
quieter install
bhamail 72baabb
decrease apk output
bhamail e803b70
decrease apk add progress output
bhamail 3c51a0e
newer alpine image
bhamail 2c57b6e
try something
bhamail 3d59cda
no change, revert
bhamail f6053c2
use amd64 binary (Pi should get there soon)
bhamail File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/sh | ||
|
||
# Copyright (c) 2019-present Sonatype, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
desiredVersion="$1" | ||
echo "desired nancy version: ${desiredVersion}" | ||
if [ -z "$desiredVersion" ]; then | ||
>&2 echo "must specify a desiredVersion, like: latest or v1.0.15" | ||
exit 1 | ||
elif [[ ${desiredVersion} == "latest" ]]; then | ||
latest_version_is=$(curl --fail -s https://api.github.com/repos/sonatype-nexus-community/nancy/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")') | ||
desiredVersion=${latest_version_is} | ||
elif [[ ${desiredVersion:0:1} != "v" ]]; then | ||
>&2 echo "specific nancy version (${desiredVersion}) must start with v, like: v1.0.15" | ||
exit 1 | ||
fi | ||
# installer filename excludes v from version | ||
sourceUrl="https://github.com/sonatype-nexus-community/nancy/releases/download/${desiredVersion}/nancy_${desiredVersion:1}_linux_amd64.apk" | ||
echo "installing nancy via ${sourceUrl}" | ||
curl --fail -L -o nancy.apk ${sourceUrl} | ||
apk add --no-progress --quiet --no-cache --allow-untrusted nancy.apk |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not a major thing, but I think a good idea in general is to clean up after yourself, so maybe delete these packages unless they are needed?
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 think the upgraded
grep
must stick around because it is used later when running the docker image (to detect the "latest" version).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.
Yeah that makes sense. I'd ditch curl maybe unless you need it? It's not a huge deal but I personally love leaving the environment as pristine as possible.