-
Notifications
You must be signed in to change notification settings - Fork 536
Created test_release.sh to test centos|fedora|ubuntu images
#613
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
Changes from 1 commit
e4d5bd3
ab43bad
d8f15e2
fc0012e
ca01487
9fe7083
d51a038
c6bf2b1
9ace86f
65b8383
0d52edb
878e419
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| OS_LIST=( | ||
| centos:7 | ||
| centos:8 | ||
| fedora:28 | ||
| ubuntu:16.04 | ||
| ubuntu:18.04 | ||
| ) | ||
|
|
||
| FAILED=() | ||
| RET_VALUE=0 | ||
|
|
||
| # We'll use this simple tokenized Dockerfile. | ||
| # https://serverfault.com/a/72511 | ||
| IFS='' read -r -d '' TOKENIZED <<"EOF" | ||
| FROM {{OS}} | ||
|
|
||
| ENV DEBIAN_FRONTEND noninteractive | ||
| {{PACMAN}} | ||
| ADD https://algorand-releases.s3.us-east-1.amazonaws.com/channel/stable/install_stable_linux-amd64_2.0.1.tar.gz /tmp | ||
|
|
||
| RUN \ | ||
| set -eux; \ | ||
| mkdir /opt/installer ; \ | ||
| cd /opt/installer ; \ | ||
| tar xvf /tmp/install*tar.gz ; \ | ||
| ./update.sh -i -c stable -p /opt/algorand/node -d /opt/algorand/node/data -n ; | ||
|
|
||
| WORKDIR /opt/algorand/node | ||
| RUN ["./goal", "node", "start", "-d", "data"] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think if you replaced this
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good to know, will change. |
||
| EOF | ||
|
|
||
| for item in ${OS_LIST[*]} | ||
| do | ||
| # Install root certs. | ||
| # We use pattern substitution here (like sed). | ||
| # ${parameter/pattern/substitution} | ||
| if [[ $item =~ ubuntu ]] | ||
| then | ||
| WITH_PACMAN=$(echo -e "${TOKENIZED//\{\{PACMAN\}\}/RUN apt update && apt install -y ca-certificates}") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can include the debian var as a one liner, I've seen it like this before:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, changed. |
||
| else | ||
| # CentOS/Fedora must have the updated root certs already installed. | ||
| WITH_PACMAN=$(echo -e "${TOKENIZED//\{\{PACMAN\}\}/}") | ||
| fi | ||
|
|
||
| # Finally, designate the OS and send the fully-formed Dockerfile to Docker. | ||
| echo -e "${WITH_PACMAN/\{\{OS\}\}/$item}" | docker build -t "$item" - | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this cache the image if you run it multiple times?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it appears to be getting the image from the cache:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll need to make sure that running the command multiple times can test different versions. Moving the I'm also wondering about the goal of test in general. @tsachiherman is the |
||
|
|
||
| if ! docker run -it "$item" /bin/bash -c "/opt/algorand/node/algod -v" | ||
| then | ||
| RET_VALUE=1 | ||
| FAILED+=("$item") | ||
| fi | ||
| done | ||
|
|
||
| if [ "${#FAILED[@]}" -gt 0 ] | ||
| then | ||
| echo -e "\n$(tput setaf 1)[$0]$(tput sgr0) The following images have problems:" | ||
| for failed in ${FAILED[*]} | ||
| do | ||
| echo " - $failed" | ||
| done | ||
| echo | ||
| fi | ||
|
|
||
| exit $RET_VALUE | ||
|
|
||
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.
If you included an
ARG channeloption you could specify different channels to this script. Inupdate.shyou would use$channelThis would let us run this test with stable/nightly/beta release channels.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.
Done.