Commit 3995f3d7 authored by Dmitry Smirnov's avatar Dmitry Smirnov

Imported Upstream version 0.2.2+dfsg

parent d9b5d8c8
......@@ -18,7 +18,6 @@ env:
- GO15VENDOREXPERIMENT=1
install:
- go get ${TOOLS_CMD}/vet
- go get ${TOOLS_CMD}/cover
- go get github.com/modocache/gover
- go get github.com/mattn/goveralls
......
#!/usr/bin/env bash
set -e
set -xe
ORG_PATH="github.com/appc"
REPO_PATH="${ORG_PATH}/cni"
......@@ -14,18 +14,17 @@ export GOBIN=${PWD}/bin
export GOPATH=${PWD}/gopath
echo "Building API"
go build ${REPO_PATH}/libcni
go build "$@" ${REPO_PATH}/libcni
echo "Building reference CLI"
go install ${REPO_PATH}/cnitool
go install "$@" ${REPO_PATH}/cnitool
echo "Building plugins"
PLUGINS="plugins/meta/* plugins/main/* plugins/ipam/*"
for d in $PLUGINS; do
if [ -d $d ]; then
plugin=$(basename $d)
echo " " $plugin
go install ${REPO_PATH}/$d
go install "$@" ${REPO_PATH}/$d
fi
done
#!/usr/bin/env bash
set -xe
SRC_DIR="${SRC_DIR:-$PWD}"
FEDORA_INSTALL="dnf install -y golang tar xz bzip2 gzip sudo iproute wget"
FEDORA_IMAGE="docker://fedora:23"
ACBUILD_URL="https://github.com/appc/acbuild/releases/download/v0.2.2/acbuild.tar.gz"
ACBUILD="acbuild --debug"
BUILDFLAGS="-a --ldflags '-extldflags \"-static\"'"
TAG=$(git describe --exact-match --abbrev=0) || TAG=$(git describe)
RELEASE_DIR=release-${TAG}
OUTPUT_DIR=bin
rm -Rf ${SRC_DIR}/${RELEASE_DIR}
mkdir -p ${SRC_DIR}/${RELEASE_DIR}
sudo -E rkt run \
--volume rslvconf,kind=host,source=/etc/resolv.conf \
--mount volume=rslvconf,target=/etc/resolv.conf \
--volume src-dir,kind=host,source=$SRC_DIR \
--mount volume=src-dir,target=/opt/src \
--interactive \
--insecure-options=image \
${FEDORA_IMAGE} \
--exec /bin/bash \
-- -xe -c "\
${FEDORA_INSTALL}; cd /opt/src; umask 0022; CGO_ENABLED=0 ./build ${BUILDFLAGS}; \
for format in txz tbz2 tgz; do \
FILENAME=cni-${TAG}.\$format; \
FILEPATH=${RELEASE_DIR}/\$FILENAME; \
tar -C ${OUTPUT_DIR} --owner=0 --group=0 -caf \$FILEPATH .; \
done; \
wget -O - ${ACBUILD_URL} | tar -C /usr/bin -xzvf -; \
${ACBUILD} begin; \
${ACBUILD} set-name coreos.com/cni; \
${ACBUILD} label add version ${TAG}; \
${ACBUILD} copy --to-dir ${OUTPUT_DIR} /opt/cni/; \
${ACBUILD} write ${RELEASE_DIR}/cni-${TAG}.aci; \
${ACBUILD} end; \
pushd ${RELEASE_DIR}; for f in \$(ls); do sha1sum \$f > \$f.sha1; done; popd; \
chown -R ${UID} ${OUTPUT_DIR} ${RELEASE_DIR}; \
:"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment