Require dep to be installed before building (#4461)

This commit is contained in:
Daniel Nelson
2018-07-24 14:57:24 -07:00
committed by Greg
parent d95824a9c1
commit 9051ea9dc0
10 changed files with 204 additions and 86 deletions

View File

@@ -155,12 +155,8 @@ def go_get(branch, update=False, no_uncommitted=False):
if local_changes() and no_uncommitted:
logging.error("There are uncommitted changes in the current directory.")
return False
if not check_path_for("dep"):
logging.info("Downloading `dep`...")
get_command = "go get -u github.com/golang/dep/cmd/dep"
run(get_command)
logging.info("Retrieving dependencies with `dep`...")
run("{}/bin/dep ensure -v".format(os.environ.get("GOPATH",
run("{}/bin/dep ensure -v -vendor-only".format(os.environ.get("GOPATH",
os.path.expanduser("~/go"))))
return True

28
scripts/ci-1.10.docker Normal file
View File

@@ -0,0 +1,28 @@
FROM golang:1.10.3
RUN chmod -R 755 "$GOPATH"
RUN DEBIAN_FRONTEND=noninteractive \
apt update && apt install -y --no-install-recommends \
autoconf \
git \
libtool \
locales \
make \
python-boto \
rpm \
ruby \
ruby-dev \
zip && \
rm -rf /var/lib/apt/lists/*
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
RUN locale-gen C.UTF-8 || true
ENV LANG=C.UTF-8
RUN gem install fpm
RUN go get -d github.com/golang/dep && \
cd src/github.com/golang/dep && \
git checkout -q v0.4.1 && \
go install -ldflags="-X main.version=v0.4.1" ./cmd/dep

28
scripts/ci-1.9.docker Normal file
View File

@@ -0,0 +1,28 @@
FROM golang:1.9.7
RUN chmod -R 755 "$GOPATH"
RUN DEBIAN_FRONTEND=noninteractive \
apt update && apt install -y --no-install-recommends \
autoconf \
git \
libtool \
locales \
make \
python-boto \
rpm \
ruby \
ruby-dev \
zip && \
rm -rf /var/lib/apt/lists/*
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
RUN locale-gen C.UTF-8 || true
ENV LANG=C.UTF-8
RUN gem install fpm
RUN go get -d github.com/golang/dep && \
cd src/github.com/golang/dep && \
git checkout -q v0.4.1 && \
go install -ldflags="-X main.version=v0.4.1" ./cmd/dep

View File

@@ -1,35 +0,0 @@
#!/bin/bash
ARTIFACT_DIR='artifacts'
run()
{
"$@"
ret=$?
if [[ $ret -eq 0 ]]
then
echo "[INFO] [ $@ ]"
else
echo "[ERROR] [ $@ ] returned $ret"
exit $ret
fi
}
run make
run mkdir -p ${ARTIFACT_DIR}
run gzip telegraf -c > "$ARTIFACT_DIR/telegraf.gz"
# RPM is used to build packages for Enterprise Linux hosts.
# Boto is used to upload packages to S3.
run sudo apt-get update
run sudo apt-get install -y rpm python-boto ruby ruby-dev autoconf libtool
run sudo gem install fpm
if git describe --exact-match HEAD 2>&1 >/dev/null; then
run ./scripts/build.py --release --package --platform=all --arch=all --upload --bucket=dl.influxdata.com/telegraf/releases
elif [ "${CIRCLE_STAGE}" = nightly ]; then
run ./scripts/build.py --nightly --package --platform=all --arch=all --upload --bucket=dl.influxdata.com/telegraf/nightlies
else
run ./scripts/build.py --package --platform=all --arch=all
fi
run mv build $ARTIFACT_DIR