-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix(test_connexion) install ping #19
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8d42ea0
test connexion
nriss 195589a
install ping and update publisher
nriss 5ed36cd
test ping
nriss 82dccd0
test ping
nriss 806fc5e
add docker entry point
nriss 38b219f
remove ping
nriss 40bcc69
update docker image
nriss 3f17908
update entrypoint
nriss 5194f55
new test
nriss 2d24fa8
not satisfying solution but ok
nriss 9c16840
indent
nriss adb49c8
curling directly
nriss 117e443
more tests
nriss a7704d5
Merge branch 'main' into nr/updatePublisherConnexionTest
nriss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,38 @@ | ||
FROM jruby:9.2.17.0-jdk11 as build-image | ||
FROM jruby:9.2.18.0-jdk11 as build-image | ||
|
||
RUN apt-get update \ | ||
&& apt-get upgrade -y \ | ||
&& apt-get install -y build-essential npm \ | ||
&& apt-get install -y iputils-ping \ | ||
&& apt-get autoremove --purge -y \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
RUN gem install jekyll | ||
|
||
RUN npm install -g fsh-sushi | ||
|
||
WORKDIR /build | ||
|
||
COPY . . | ||
COPY _updatePublisher_curl.sh _updatePublisher_curl.sh | ||
COPY _genonce.sh _genonce.sh | ||
COPY input input | ||
COPY ig.ini ig.ini | ||
COPY sushi-config.yaml sushi-config.yaml | ||
COPY package-list.json package-list.json | ||
|
||
RUN ./_updatePublisher.sh -y || echo "ok" | ||
RUN ./_updatePublisher_curl.sh -y || echo "ok" | ||
|
||
RUN ./_genonce.sh -y | ||
|
||
FROM scratch | ||
FROM alpine:3.13 | ||
|
||
WORKDIR /app | ||
|
||
COPY docker-entrypoint.sh /app/docker-entrypoint.sh | ||
RUN chmod +x /app/docker-entrypoint.sh | ||
|
||
COPY --from=build-image /build /app | ||
COPY --from=build-image /bin/sh /bin/sh | ||
|
||
CMD /bin/sh | ||
ENTRYPOINT ["/app/docker-entrypoint.sh"] |
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,133 @@ | ||
#!/bin/bash | ||
pubsource=https://github.com/HL7/fhir-ig-publisher/releases/latest/download/ | ||
publisher_jar=publisher.jar | ||
dlurl=$pubsource$publisher_jar | ||
|
||
input_cache_path=$PWD/input-cache/ | ||
|
||
scriptdlroot=https://raw.githubusercontent.com/HL7/ig-publisher-scripts/main | ||
update_bat_url=$scriptdlroot/_updatePublisher.bat | ||
gen_bat_url=$scriptdlroot/_genonce.bat | ||
gencont_bat_url=$scriptdlroot/_gencontinuous.bat | ||
gencont_sh_url=$scriptdlroot/_gencontinuous.sh | ||
gen_sh_url=$scriptdlroot/_genonce.sh | ||
update_sh_url=$scriptdlroot/_updatePublisher.sh | ||
|
||
skipPrompts=false | ||
FORCE=false | ||
|
||
if ! type "curl" > /dev/null; then | ||
echo "ERROR: Script needs curl to download latest IG Publisher. Please install curl." | ||
exit 1 | ||
fi | ||
|
||
while [ "$#" -gt 0 ]; do | ||
case $1 in | ||
-f|--force) FORCE=true ;; | ||
-y|--yes) skipPrompts=true ; FORCE=true ;; | ||
*) echo "Unknown parameter passed: $1. Exiting"; exit 1 ;; | ||
esac | ||
shift | ||
done | ||
|
||
echo "Checking internet connection" | ||
case "$OSTYPE" in | ||
linux-gnu* ) curl -sSf tx.fhir.org > /dev/null ;; | ||
darwin* ) ping tx.fhir.org -c 1 >/dev/null ;; | ||
*) echo "unknown: $OSTYPE"; exit 1 ;; | ||
esac | ||
|
||
if [ $? -ne 0 ] ; then | ||
echo "Offline (or the terminology server is down), unable to update. Exiting" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -d "$input_cache_path" ] ; then | ||
if [ $FORCE != true ]; then | ||
echo "$input_cache_path does not exist" | ||
message="create it?" | ||
read -r -p "$message" response | ||
else | ||
response=y | ||
fi | ||
fi | ||
|
||
if [[ $response =~ ^[yY].*$ ]] ; then | ||
mkdir ./input-cache | ||
fi | ||
|
||
publisher="$input_cache_path$publisher_jar" | ||
|
||
if test -f "$publisher" ; then | ||
echo "IG Publisher FOUND in input-cache" | ||
jarlocation="$publisher" | ||
jarlocationname="Input Cache" | ||
upgrade=true | ||
else | ||
publisher="../$publisher_jar" | ||
upgrade=true | ||
if test -f "$publisher"; then | ||
echo "IG Publisher FOUND in parent folder" | ||
jarlocation="$publisher" | ||
jarlocationname="Parent Folder" | ||
upgrade=true | ||
else | ||
echo "IG Publisher NOT FOUND in input-cache or parent folder" | ||
jarlocation=$input_cache_path$publisher_jar | ||
jarlocationname="Input Cache" | ||
upgrade=false | ||
fi | ||
fi | ||
|
||
if [[ $skipPrompts == false ]]; then | ||
|
||
if [[ $upgrade == true ]]; then | ||
message="Overwrite $jarlocation? (Y/N) " | ||
else | ||
echo Will place publisher jar here: "$jarlocation" | ||
message="Ok (enter 'y' or 'Y' to continue, any other key to cancel)?" | ||
fi | ||
read -r -p "$message" response | ||
else | ||
response=y | ||
fi | ||
if [[ $skipPrompts == true ]] || [[ $response =~ ^[yY].*$ ]]; then | ||
|
||
echo "Downloading most recent publisher to $jarlocationname - it's ~100 MB, so this may take a bit" | ||
curl -L $dlurl -o "$jarlocation" --create-dirs | ||
else | ||
echo cancelled publisher update | ||
fi | ||
|
||
if [[ $skipPrompts != true ]]; then | ||
message="Update scripts? (enter 'y' or 'Y' to continue, any other key to cancel)?" | ||
read -r -p "$message" response | ||
fi | ||
|
||
if [[ $skipPrompts == true ]] || [[ $response =~ ^[yY].*$ ]]; then | ||
echo "Downloading most recent scripts " | ||
|
||
curl -L $update_bat_url -o /tmp/_updatePublisher.new | ||
cp /tmp/_updatePublisher.new _updatePublisher.bat | ||
rm /tmp/_updatePublisher.new | ||
|
||
curl -L $gen_bat_url -o /tmp/_genonce.new | ||
cp /tmp/_genonce.new _genonce.bat | ||
rm /tmp/_genonce.new | ||
|
||
curl -L $gencont_bat_url -o /tmp/_gencontinuous.new | ||
cp /tmp/_gencontinuous.new _gencontinuous.bat | ||
rm /tmp/_gencontinuous.new | ||
|
||
curl -L $gencont_sh_url -o /tmp/_gencontinuous.new | ||
cp /tmp/_gencontinuous.new _gencontinuous.sh | ||
rm /tmp/_gencontinuous.new | ||
|
||
curl -L $gen_sh_url -o /tmp/_genonce.new | ||
cp /tmp/_genonce.new _genonce.sh | ||
rm /tmp/_genonce.new | ||
|
||
curl -L $update_sh_url -o /tmp/_updatePublisher.new | ||
cp /tmp/_updatePublisher.new _updatePublisher.sh | ||
rm /tmp/_updatePublisher.new | ||
fi |
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,11 @@ | ||
#!/bin/sh | ||
|
||
# Exit immediately if a command exits with a non-zero status. | ||
set -e | ||
|
||
# Trace execution | ||
[[ "${DEBUG}" ]] && set -x | ||
|
||
export STATIC_ROOT="${STATIC_ROOT:-/var/www/static/cohort360-ig}" | ||
|
||
rm -rf "${STATIC_ROOT}" && cp -r ./output "${STATIC_ROOT}" |
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.
let me try to build another image in order to check if
ping
works :)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.
There is no rush, we can wait until next week! Thanks!
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.
Holà 👋 Actually, if you have some time to check this out, we'd like to publish these IGs soon, to share them with collaborators. Thanks :)