Skip to content

Commit

Permalink
refactor: remove experimental Go CLI
Browse files Browse the repository at this point in the history
The experimental Go CLI, previously in the `garden-cli` and `garden-sync`
directories, has been moved to a separate repo: https://github.com/garden-io/experimental-go-cli.

Moving the Go CLI simplifies the build process. It also simplifies
development since users no longer need to have Go installed and the
source code in their `$GOPATH`.

Furthermore, the Go CLI works just fine as a standalone module since the docker
image it uses is available on DockerHub (https://hub.docker.com/r/gardenengine/garden-service)
and is updated on every merge to master. Therefore there's no real reason to
co-locate it with the rest of the Garden source code.
  • Loading branch information
eysi09 committed Feb 5, 2019
1 parent 4c0b775 commit e9ef3aa
Show file tree
Hide file tree
Showing 19 changed files with 3 additions and 1,395 deletions.
102 changes: 0 additions & 102 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ version: 2.1
# These can be used to inject shared variables
# see https://blog.daemonl.com/2016/02/yaml.html
.references:
# Go configuration for all our jobs
go-config: &go-config
docker:
- image: circleci/golang:1.10
working_directory: /go/src/github.com/garden-io/garden

# Configuration for our node jobs
node-config: &node-config
docker:
Expand Down Expand Up @@ -71,28 +65,6 @@ commands:
paths: [dashboard/node_modules]
key: dashboard-{{ checksum "dashboard/package-lock.json" }}

go_install_deps:
description: |
Installs our go dependancies and deals with caching and loading the cache
steps:
- restore_cache:
keys:
- pkg-cache-{{ checksum "Gopkg.lock" }}
- run: go get -u github.com/jstemmer/go-junit-report
- run:
name: Install dep
command: |
if [ ! -d /go/src/github.com/garden-io/garden/vendor ]; then
# This needs to match the version installed locally
curl -L -s https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 -o /go/bin/dep
chmod +x /go/bin/dep
/go/bin/dep ensure
fi
- save_cache:
key: pkg-cache-{{ checksum "Gopkg.lock" }}
paths:
- "/go/src/github.com/garden-io/garden/vendor"

docker_build:
description: Builds and Tags a Docker Image
parameters:
Expand Down Expand Up @@ -162,66 +134,6 @@ commands:
# Jobs section
#
jobs:
test-cli:
<<: *go-config
steps:
- checkout
- go_install_deps
# NOTE: This always fails in CI with the error:
#
# # github.com/garden-io/garden/vendor/github.com/havoc-io/mutagen/pkg/session
# ../vendor/github.com/havoc-io/mutagen/pkg/session/controller.go:113:25: undefined: mutagen.VersionMajor
# ../vendor/github.com/havoc-io/mutagen/pkg/session/controller.go:114:25: undefined: mutagen.VersionMinor
# ../vendor/github.com/havoc-io/mutagen/pkg/session/controller.go:115:25: undefined: mutagen.VersionPatch
#
# However, it does work locally. Moreover, it does work locally inside a circleci/golang:1.10 Docker container.
# Not sure why it keeps failing in CI.
#
# Therefore we're removing this step for now so that we can get this merged. Additionally, the Go CLI
# is being deprecated and moved into a separate repo once this has been merged.
#
# - run:
# name: Unit Tests
# command: |
# cd garden-cli
# go test -v 2>&1 | go-junit-report > /tmp/report.xml
# - store_artifacts:
# path: /tmp/report.xml
# - store_test_results:
# path: /tmp/
build-cli:
<<: *go-config
steps:
- checkout
- go_install_deps
- run: go get -u github.com/goreleaser/goreleaser
- run:
name: Build Go cli
command: |
cd garden-cli
# Set to snapshot builds unless we are on a git tag
FLAGS="--snapshot"
if [[ -n "$CIRCLE_TAG" ]]; then
FLAGS=""
fi
# Build them all
goreleaser $FLAGS --rm-dist
- store_artifacts:
path: garden-cli/dist/
destination: /downloads
build-sync-docker:
<<: *node-config
steps:
- checkout
- docker_build:
context: garden-sync
release-sync:
<<: *node-config
steps:
- checkout
- docker_release:
context: garden-sync
image: $DOCKER_ORG/garden-sync
build-service-docker:
<<: *node-config
steps:
Expand Down Expand Up @@ -321,12 +233,8 @@ workflows:
commit:
jobs:
- build-service
- test-cli:
requires:
- build-service
- test-service
- build-dashboard
- build-sync-docker
- build-service-docker:
requires:
- build-service
Expand All @@ -342,9 +250,6 @@ workflows:
- build-service
- build-dashboard:
<<: *only-master
- release-sync:
<<: *only-master
context: docker
- release-service-docker:
<<: *only-master
context: docker
Expand All @@ -356,8 +261,6 @@ workflows:
requires:
- build-service
- build-dashboard
- build-cli:
<<: *only-master

tags:
jobs:
Expand All @@ -370,17 +273,12 @@ workflows:
- build-service
- build-dashboard:
<<: *only-tags
- release-sync:
<<: *only-tags
context: docker
- release-service-docker:
<<: *only-tags
context: docker
requires:
- build-service
- build-dashboard
- build-cli:
<<: *only-tags
- release-service-pkg:
<<: *only-tags
requires:
Expand Down
4 changes: 0 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ Install Node modules for the root package, and the `dashboard` and `garden-servi

npm run bootstrap

Install Go dependencies for the `garden-cli`:

dep ensure

## Running a development version of the CLI

While developing the CLI, we recommend you run the dev command in your console:
Expand Down

0 comments on commit e9ef3aa

Please sign in to comment.