-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #717 from ipfs/chore/rename-go-ipfs-test-1
feat: dual publishing go-ipfs and kubo
- Loading branch information
Showing
16 changed files
with
163 additions
and
12 deletions.
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,92 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
|
||
# This script replaces go build with repackaging of existing 'kubo' binaries | ||
# - go-ipfs is the old name of kubo, and we provide it for legacy reasons | ||
# - this script assumes kubo artifacts were built recently and are still | ||
# in local "releases/kubo/${version}" - this is ok because nobody will build | ||
# go-ipfs on their own, only kubo, and go-ipfs build happens automatically | ||
# when someone adds new kubo release with './dist add-release kubo <version>' | ||
|
||
# Usage in Makefile is drop-in replacement for build-go.sh: | ||
# build-from-kubo.sh "${relpath}" "${distname}" "${repo}" "${package}" "${versions}" | ||
|
||
# path to the root of ipfs/distributions repo | ||
rootpath="$(realpath "$1")" | ||
|
||
distname="$2" | ||
repo="$3" | ||
package="$4" | ||
versions="$5" | ||
|
||
# import utility functions and variables from regular go build script | ||
source "${rootpath}/build-go.sh" | ||
|
||
# override build step. | ||
# goBuild is skipped and we replaced it with repackaging of existing kubo artifacts | ||
# this way we build everything only once | ||
function doBuild() { | ||
local goos=$1 | ||
local goarch=$2 | ||
local package=$3 | ||
local output=$4 | ||
local version=$5 | ||
|
||
local dir name binname | ||
|
||
dir="$output" | ||
name="$(basename "$(pwd)")" | ||
binname="${name}_${version}_${goos}-${goarch}" | ||
|
||
# local dir with just recently built kubo release | ||
# that will be repackaged under go-ipfs name | ||
kuboreleasedir="${rootpath}/releases/kubo/${version}" | ||
kubobinname="kubo_${version}_${goos}-${goarch}" | ||
|
||
echo "==> repackaging kubo to go-ipfs for $goos $goarch" | ||
|
||
if [ -e "$dir/$binname" ]; then | ||
echo " $dir/$binname exists, skipping build" | ||
return | ||
fi | ||
echo " output to $dir/$binname" | ||
|
||
local build_dir_name=$name | ||
mkdir -p "$dir" | ||
|
||
# unpack kubo package (it produces 'kubo/ipfs[.exe]') | ||
case $(pkgType "$goos") in | ||
zip) | ||
unzip -oq "${kuboreleasedir}/${kubobinname}.zip" | ||
;; | ||
tar.gz) | ||
tar xf "${kuboreleasedir}/${kubobinname}.tar.gz" | ||
;; | ||
esac | ||
|
||
# remove any stale unpacked data | ||
rm -rf "$build_dir_name" | ||
|
||
# rename extracted directory to match name expected by build scripts (go-ipfs) | ||
mv "kubo" "$build_dir_name" | ||
|
||
# now (re)package it all up | ||
if bundleDist "$dir/$binname" "$goos" "$build_dir_name"; then | ||
buildDistInfo "$binname" "$dir" | ||
rm -rf "$build_dir_name" | ||
notice " repackaging of $binname succeeded!" | ||
else | ||
fail " failed to repackage $binname" | ||
success=1 | ||
fi | ||
|
||
notice " $goos $goarch repackaging succeeded!" | ||
|
||
# output results to results table | ||
echo "$target, $goos, $goarch, $success" >> "$output/results" | ||
} | ||
|
||
# run unmodified logic from build-go.sh | ||
startGoBuilds "${distname}" "${repo}" "${package}" "${versions}" | ||
# vim: ts=4:noet |
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 |
---|---|---|
|
@@ -68,3 +68,4 @@ v0.12.2 | |
v0.13.0-rc1 | ||
v0.13.0 | ||
v0.13.1 | ||
v0.14.0-rc1 |
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,4 @@ | ||
repo = github.com/ipfs/kubo | ||
package = cmd/ipfs | ||
|
||
include ../../common.mk |
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,14 @@ | ||
darwin amd64 | ||
darwin arm64 | ||
freebsd 386 | ||
freebsd amd64 | ||
freebsd arm | ||
openbsd 386 | ||
openbsd amd64 | ||
openbsd arm | ||
linux 386 | ||
linux amd64 | ||
linux arm | ||
linux arm64 | ||
windows 386 | ||
windows amd64 |
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 @@ | ||
v0.14.0-rc1 |
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 @@ | ||
kubo (go-ipfs) is the earliest and most widely used implementation of IPFS. It includes:\n- an IPFS daemon server\n- extensive command line tooling\n- an HTTP RPC API for controlling the node\n- an HTTP Gateway for serving content to HTTP browsers\n |
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 @@ | ||
kubo |
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 @@ | ||
ipfs |
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 @@ | ||
v0.14.0-rc1 |
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 |
---|---|---|
|
@@ -7,4 +7,5 @@ fs-repo-5-to-6 | |
fs-repo-6-to-7 | ||
fs-repo-7-to-8 | ||
fs-repo-8-to-9 | ||
fs-repo-9-to-10 | ||
fs-repo-9-to-10 | ||
go-ipfs |
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