Skip to content

Commit

Permalink
[CI] use install scripts from py-ipfs-http-client (#1068)
Browse files Browse the repository at this point in the history
* use install scripts from py-ipfs-http-client

* fix typo in docs rule
  • Loading branch information
luizirber authored Jul 1, 2020
1 parent 40b5c35 commit 80d975c
Showing 1 changed file with 56 additions and 4 deletions.
60 changes: 56 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,61 @@ jobs:
- <<: *test
name: integration (ipfs/redis)
before_install:
- sudo snap install ipfs
- "/snap/bin/ipfs --version"
- "/snap/bin/ipfs daemon --init --offline &>/dev/null &"
- |-
### Copied from https://github.com/ipfs-shipyard/py-ipfs-http-client/blob/master/.travis.yml
### ==== MODIFY THIS WHEN CHANGING TARGET OR MINIMUM IPFS VERSION ==== ###
case "${IPFS_VERSION:-latest}" in
latest) # Currently targeted version
VERSION=0.6.0
SHA512_LINUX=57e4ac078f4605e3e765c6c5a54fe6e7f45268fa7ec06fc54f03e0046643dff65718f6f143a67fe08c458a7c86e30b5a53c400bdb57b6a2122bdc5df1a4b8f33
SHA512_DARWIN=daf6fd4cef6b892ecff432895912c3962c4033d81c275fd8ab7172612f87db0aedfeb0d4c5a408a3f07d6f56399b4d5300d25e81c20d9cc9bed59fef02581360
SHA512_WINDOWS=2fb04eaa90b57fa9239a9e05234f288d017ba6d9001fa5330929faec3d6e0ad8b7d7eab35c3d0ee42fdd52e0d60a9b591dee3e59251b6d0e00c3d1ead15bf12d
;;
compat) # Earliest supported version
VERSION=0.4.22
SHA512_LINUX=49b99fec741d67f7bad8fb6fbbd984967f06dfc3de846d10dca34b166f621a182d12f13cf5ccf4e4f33747b67cede6f4205b4cd9b57ce5244128d1385ec82c85
;;
esac
### ------------------------------ END ------------------------------- ###
set -u
# Derive usable parameters from the above constants
case "${TRAVIS_OS_NAME}" in
linux)
export IPFS_DL_PATH="go-ipfs/v${VERSION}/go-ipfs_v${VERSION}_linux-amd64.tar.gz"
export IPFS_DL_SHA512="${SHA512_LINUX}"
;;
osx)
export IPFS_DL_PATH="go-ipfs/v${VERSION}/go-ipfs_v${VERSION}_darwin-amd64.tar.gz"
export IPFS_DL_SHA512="${SHA512_DARWIN}"
# Make the `sha512sum` command available under that name
export PATH="$(echo /usr/local/Cellar/coreutils/*/libexec/gnubin):${PATH}"
;;
windows)
export IPFS_DL_PATH="go-ipfs/v${VERSION}/go-ipfs_v${VERSION}_windows-amd64.zip"
export IPFS_DL_SHA512="${SHA512_WINDOWS}"
;;
esac
export IPFS_DL_BASENAME="${IPFS_DL_PATH##*/}"
set +u
# Download the daemon application
- wget "https://dist.ipfs.io/${IPFS_DL_PATH}" 2>&1
# Verify its checksum
- echo "${IPFS_DL_SHA512} ${IPFS_DL_BASENAME}" | sha512sum -c
# Extract verified archive
- |-
if [[ "${IPFS_DL_BASENAME}" =~ .*\.zip ]];
then
unzip "${IPFS_DL_BASENAME}"
else
tar -xvf "${IPFS_DL_BASENAME}"
fi
# Add IPFS daemon to search path
- export PATH="${PWD}/go-ipfs:${PATH}"
- ipfs daemon --init --offline &>/dev/null &
services:
- redis
- docker
Expand All @@ -56,7 +108,7 @@ jobs:
python: 3.5
- <<: *test
python: 3.7
end:
env:
- TOXENV=docs
- <<: *test
python: 2.7
Expand Down

0 comments on commit 80d975c

Please sign in to comment.