Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
Update relevant glide usage to dep
Browse files Browse the repository at this point in the history
We cannot completely remove glide because we are using
`glide nv`. If we had a requirement of Go 1.9+ maybe that could
be dropped, since the go tools in that version don't include
vendor anymore with `./...`, but until then it needs to stay.
  • Loading branch information
carolynvs-msft committed Jan 23, 2018
1 parent e4b65d8 commit e558d6a
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
- docker
cache:
directories:
- .glide
- $GOPATH/pkg/dep
script:
- make verify build build-integration build-e2e test images
deploy:
Expand Down
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ SERVICE_CATALOG_MUTABLE_IMAGE = $(REGISTRY)service-catalog-$(ARCH):$(MUTABLE
USER_BROKER_IMAGE = $(REGISTRY)user-broker-$(ARCH):$(VERSION)
USER_BROKER_MUTABLE_IMAGE = $(REGISTRY)user-broker-$(ARCH):$(MUTABLE_TAG)

# precheck to avoid kubernetes-incubator/service-catalog#361
$(if $(realpath vendor/k8s.io/apimachinery/vendor), \
$(error the vendor directory exists in the apimachinery \
vendored source and must be flattened. \
run 'glide i -v'))

ifdef UNIT_TESTS
UNIT_TEST_FLAGS=-run $(UNIT_TESTS) -v
endif
Expand All @@ -111,6 +105,7 @@ else
scBuildImageTarget = .scBuildImage
endif

# Even though we migrated to dep, it doesn't replace the `glide nv` command
NON_VENDOR_DIRS = $(shell $(DOCKER_CMD) glide nv)

# This section builds the output binaries.
Expand Down
2 changes: 1 addition & 1 deletion build/verify-errexit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ REPO_ROOT=$(dirname "${BASH_SOURCE}")/..
if [ "$*" != "" ]; then
args="$*"
else
args=$(ls "$REPO_ROOT" | grep -v vendor | grep -v glide)
args=$(ls "$REPO_ROOT" | grep -v vendor | grep -v Gopkg)
fi

# Gather the list of files that appear to be shell scripts.
Expand Down
30 changes: 30 additions & 0 deletions contrib/jenkins/init_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
GO_VERSION='1.9'
HELM_VERSION='v2.7.0'
GLIDE_VERSION='v0.12.3'
DEP_VERSION='v0.3.2'

function update-golang() {
# Check version of golang
Expand Down Expand Up @@ -92,10 +93,39 @@ function update-glide() {
}


function update-dep() {
# Check version of dep
local current="$(dep --version 2>/dev/null || echo "unknown")"

# dep version prints its output in the format:
# dep:
# version : v0.3.2
# build date :
# git hash :
# go version : go1.9.2
# go compiler : gc
# platform : darwin/amd64
# To isolate the version string, we include the leading space
# in the comparison, and ommit the trailing wildcard.
if [[ "${current}" == *" ${DEP_VERSION}"* ]]; then
echo "dep is up-to-date: ${current}"
else
echo "Upgrading dep ${current} to ${DEP_VERSION}"

# Install new dep.
local dep_url='https://github.com/golang/dep/releases/download/'
dep_url+="${DEP_VERSION}/dep-linux-amd64"

curl -sSL -o /usr/local/bin/dep "${dep_url}" && chmod +x /usr/local/bin/dep \
|| { echo "Cannot upgrade dep to ${DEP_VERSION}"; return 1; }
fi
}

function main() {
update-golang || error_exit 'Failed to update golang'
update-helm || error_exit 'Failed to update helm'
update-glide || error_exit 'Failed to update glide'
update-dep || error_exit 'Failed to update dep'
}

main
7 changes: 4 additions & 3 deletions docs/devguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ have found possible (or practical). Below is a summary of the repository's
layout:

.
├── .glide # Glide cache (untracked)
├── bin # Destination for binaries compiled for linux/amd64 (untracked)
├── build # Contains build-related scripts and subdirectories containing Dockerfiles
├── charts # Helm charts for deployment
Expand All @@ -40,7 +39,9 @@ layout:
├── pkg # Contains all non-"main" Go packages
├── plugin # Plugins for API server
├── test # Integration and e2e tests
└── vendor # Glide-managed dependencies
├── vendor # dep-managed dependencies
├── Gopkg.toml # dep manifest
└── Gopkg.lock # dep lock (autogenerated, do not edit)

## Working on Issues

Expand Down Expand Up @@ -150,7 +151,7 @@ To build the service-catalog:

The above will build all executables and place them in the `bin` directory. This
is done within a Docker container-- meaning you do not need to have all of the
necessary tooling installed on your host (such as a golang compiler or glide).
necessary tooling installed on your host (such as a golang compiler or dep).
Building outside the container is possible, but not officially supported.

Note, this will do the basic build of the service catalog. There are more
Expand Down

0 comments on commit e558d6a

Please sign in to comment.