Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker #6

Merged
merged 4 commits into from
Jun 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ workflows:
- test
- coverage
- lint
- deploy:
- deploy_github_release:
requires:
- test
- coverage
- lint
filters:
branches:
only: master
- deploy_docker:
requires:
- test
- coverage
Expand Down Expand Up @@ -68,7 +76,8 @@ jobs:
key: v1-gometalinter-{{ checksum "/go/bin/gometalinter" }}
paths: [/go/bin/*]

deploy:
deploy_github_release:
working_directory: /go/src/github.com/circleci/circleci-cli
docker:
- image: circleci/golang:1.10
environment:
Expand Down Expand Up @@ -97,3 +106,28 @@ jobs:
- save_cache:
key: v2-goreleaser-{{ checksum "~/goreleaser_amd64.deb" }}
paths: [~/goreleaser_amd64.deb]

deploy_docker:
docker:
- image: circleci/command-convenience:0.1.392-2e3ae33
environment:
NAME: circleci-cli
CONTAINER_ORG: circlecidx
DOCKERFILE_PATH: Dockerfile
DOCKER_REGISTRY: dockerhub
working_directory: /go/src/github.com/circleci/circleci-cli
steps:
- setup_docker_engine:
docker_layer_caching: true
- checkout
- run:
name: Build the binary
command: make
- run:
name: Build and push circleci-cli image
command: publish
- run:
name: Update the "latest" tag
command: publish
environment:
CONTAINER_VERSION: latest
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM circleci/golang:1.10.3

COPY build/linux/amd64/circleci-cli /usr/local/bin/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ VERSION=0.1

GOFILES = $(shell find . -name '*.go' -not -path './vendor/*')

OS = $(shell uname)
OS ?= $(shell uname)

CLIPATH=github.com/CircleCI-Public/circleci-cli

Expand Down
2 changes: 2 additions & 0 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func configQuery(ctx context.Context) (*buildConfigResponse, error) {
}

func validateConfig(cmd *cobra.Command, args []string) error {

ctx := context.Background()
response, err := configQuery(ctx)

Expand All @@ -140,6 +141,7 @@ func validateConfig(cmd *cobra.Command, args []string) error {

func expandConfig(cmd *cobra.Command, args []string) error {
ctx := context.Background()

response, err := configQuery(ctx)

if err != nil {
Expand Down