Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
ungx
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
language: go
go: 1.12.x
# Don't grab any dependencies or whatnot, we're not building go-ipfs, rather
# forking the upstream one.
install: true
before_script:
# Configure the SSH key to pull and push the repository
- echo $GITHUB_PUSH_KEY | base64 -d > ~/.ssh/id_rsa
- chmod 0600 ~/.ssh/id_rsa
# Clone the upstream IPFS repository to ungx
- mkdir -p $GOPATH/src/github.com/ipfs
- cd $GOPATH/src/github.com/ipfs
- git clone --depth=1 https://github.com/ipfs/go-ipfs.git
- cd go-ipfs
# Remove go module support for the main ipfs repository
- rm go.mod go.sum
# Install the necessary tools for ungx-ing and convert go-ipfs
- go get github.com/whyrusleeping/gx
- go get github.com/karalabe/ungx
- ungx --fork=github.com/ipsn/go-ipfs --embed=github.com/lucas-clemente/quic-go
# Save the latest commit hash and wipe all git history recursively
- COMMIT=`git rev-parse HEAD`
- find . -type d -name .git | xargs -d '\n' rm -rf
# Remove all remnants of the gx package manager, and go modules in dependencies
- find . -type d -name .gx | xargs -d '\n' rm -rf
- find . -type f -name go.mod | xargs -d '\n' rm
- find . -type f -name go.sum | xargs -d '\n' rm
# Save the ungx-ed readme to update the master branch with
- cd $GOPATH/src/github.com/ipsn/go-ipfs
- cp README.md ../README.md
# Wipe the current ipsn/go-ipfs master and move in the freshly ungx-ed content
- git remote add upstream git@github.com:ipsn/go-ipfs.git
- git fetch upstream
- git checkout master
- git rm -r '*'
- mv $GOPATH/src/github.com/ipfs/go-ipfs/{.[!.],}* .
# Remove the test folder, it pulls in its own govendor, murdering this process
- rm -rf test
# Remove any executable and unused dependencies, we don't care about junk in our deps
- go get github.com/kardianos/govendor
- BINARIES=`govendor list | grep 'pl ' | grep gxlibs | cut -d ' ' -f 3 | sed 's#^github.com/ipsn/go-ipfs/##g'`
- for BIN in $BINARIES; do rm $BIN/*.go; done
- govendor remove +program +unused
- govendor remove +unused # Govendor sucks, remove more unused dependencies
- govendor remove +unused # Govendor still sucks, remove more unused dependencies
- govendor fetch +missing # Pull in anything that's missing
# Flatten internal vendor folders and get rid of nestings
- govendor add +external
- find . | egrep '[^.]/vendor$' | xargs -d '\n' rm -rf
- govendor fetch +missing
# Embed a few dependencies that don't keep their own APIs
- mv vendor/github.com/bifurcation gxlibs/github.com/bifurcation
- find . | egrep '\.go$' | xargs -d '\n' sed -i 's#github.com/bifurcation/mint#github.com/ipsn/go-ipfs/gxlibs/github.com/bifurcation/mint#g'
- govendor remove github.com/bifurcation/mint/...
- mv vendor/github.com/dgraph-io gxlibs/github.com/dgraph-io
- find . | egrep '\.go$' | xargs -d '\n' sed -i 's#github.com/dgraph-io/badger#github.com/ipsn/go-ipfs/gxlibs/github.com/dgraph-io/badger#g'
- govendor remove github.com/dgraph-io/badger/...
# Overwrite the reposiory readme and commit all the changes
- cp -f ../README.md README.md
- rm .gitignore
- git add .
- if [ -n "$(git status --porcelain)" ]; then git commit --author="Péter Szilágyi <peterke@gmail.com>" -m "Ungx-ed commit $COMMIT"; fi
# Sanity check that the repository can be built
- go install ./...
script:
# Everything seems ok, push the ungx-ed master branch back to GitHub
- git push upstream master