Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit f611ee7

Browse files
authored
Merge pull request #700 from rumpl/feat-remove-experimental
Remove experimental because it's not used
2 parents 8d6c935 + b3ad239 commit f611ee7

13 files changed

+33
-137
lines changed

BUILDING.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,6 @@ make test-e2e # run the end-to-end tests
6666
Vendoring of external imports uses the [`dep`](https://github.com/golang/dep) tool.
6767
Please refer to its documentation if you need to update a dependency.
6868

69-
### Experimental
70-
71-
Just add the `EXPERIMENTAL=on` flag before invoking a build target:
72-
```console
73-
$ make EXPERIMENTAL=on bin/docker-app
74-
$ ./bin/docker-app version
75-
...
76-
Experimental: on
77-
```
78-
7969
## Build using Docker
8070

8171
If you don't have Go installed but Docker is present, you can also use

Dockerfile

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ FROM dockercore/golang-cross:1.12.9@sha256:3ea9dcef4dd2c46d80445c0b22d6177817f4c
22
ENV DISABLE_WARN_OUTSIDE_CONTAINER=1
33

44
RUN apt-get install -y -q --no-install-recommends \
5-
coreutils \
6-
util-linux \
7-
uuid-runtime
5+
coreutils \
6+
util-linux \
7+
uuid-runtime
88

99
WORKDIR /go/src/github.com/docker/cli
1010

1111
RUN git clone https://github.com/docker/cli . && git checkout a1b83ffd2cbeefc0752e5aa7a543d49c1ddfd2cb
1212

1313
ARG GOPROXY
1414
RUN make binary-osx binary-windows binary && \
15-
cp build/docker-linux-amd64 /usr/bin/docker
15+
cp build/docker-linux-amd64 /usr/bin/docker
1616

1717
WORKDIR /go/src/github.com/docker/app/
1818

@@ -21,35 +21,33 @@ FROM build AS dev
2121
ENV PATH=${PATH}:/go/src/github.com/docker/app/bin/
2222
ARG DEP_VERSION=v0.5.4
2323
RUN curl -o /usr/bin/dep -L https://github.com/golang/dep/releases/download/${DEP_VERSION}/dep-linux-amd64 && \
24-
chmod +x /usr/bin/dep
24+
chmod +x /usr/bin/dep
2525
ARG GOTESTSUM_VERSION=v0.3.4
2626
ARG GOPROXY
2727
RUN mkdir $GOPATH/src/gotest.tools && \
28-
git clone -q https://github.com/gotestyourself/gotestsum $GOPATH/src/gotest.tools/gotestsum && \
29-
cd $GOPATH/src/gotest.tools/gotestsum && \
30-
git -C $GOPATH/src/gotest.tools/gotestsum checkout -q $GOTESTSUM_VERSION && \
31-
GO111MODULE=on GOOS=linux go build -o /usr/local/bin/gotestsum-linux gotest.tools/gotestsum && \
32-
GO111MODULE=on GOOS=darwin go build -o /usr/local/bin/gotestsum-darwin gotest.tools/gotestsum && \
33-
GO111MODULE=on GOOS=windows go build -o /usr/local/bin/gotestsum-windows.exe gotest.tools/gotestsum && \
34-
ln -s gotestsum-linux /usr/local/bin/gotestsum
28+
git clone -q https://github.com/gotestyourself/gotestsum $GOPATH/src/gotest.tools/gotestsum && \
29+
cd $GOPATH/src/gotest.tools/gotestsum && \
30+
git -C $GOPATH/src/gotest.tools/gotestsum checkout -q $GOTESTSUM_VERSION && \
31+
GO111MODULE=on GOOS=linux go build -o /usr/local/bin/gotestsum-linux gotest.tools/gotestsum && \
32+
GO111MODULE=on GOOS=darwin go build -o /usr/local/bin/gotestsum-darwin gotest.tools/gotestsum && \
33+
GO111MODULE=on GOOS=windows go build -o /usr/local/bin/gotestsum-windows.exe gotest.tools/gotestsum && \
34+
ln -s gotestsum-linux /usr/local/bin/gotestsum
3535
# Source for cmd/test2json is part of the Go distribution and is
3636
# therefore available in the base image.
3737
RUN GOOS=linux go build -o /usr/local/bin/test2json-linux cmd/test2json && \
38-
GOOS=darwin go build -o /usr/local/bin/test2json-darwin cmd/test2json && \
39-
GOOS=windows go build -o /usr/local/bin/test2json-windows.exe cmd/test2json
38+
GOOS=darwin go build -o /usr/local/bin/test2json-darwin cmd/test2json && \
39+
GOOS=windows go build -o /usr/local/bin/test2json-windows.exe cmd/test2json
4040
RUN go get -d gopkg.in/mjibson/esc.v0 && \
41-
cd /go/src/github.com/mjibson/esc && \
42-
go build -v -o /usr/bin/esc . && \
43-
rm -rf /go/src/* /go/pkg/* /go/bin/*
41+
cd /go/src/github.com/mjibson/esc && \
42+
go build -v -o /usr/bin/esc . && \
43+
rm -rf /go/src/* /go/pkg/* /go/bin/*
4444
COPY . .
4545

4646
FROM dev AS cross
47-
ARG EXPERIMENTAL="off"
4847
ARG TAG="unknown"
49-
RUN make EXPERIMENTAL=${EXPERIMENTAL} TAG=${TAG} cross
48+
RUN make TAG=${TAG} cross
5049

5150
FROM cross AS e2e-cross
52-
ARG EXPERIMENTAL="off"
5351
ARG TAG="unknown"
5452
# Run e2e tests
55-
RUN make EXPERIMENTAL=${EXPERIMENTAL} TAG=${TAG} e2e-cross
53+
RUN make TAG=${TAG} e2e-cross

Dockerfile.invocation-image

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@ ARG ALPINE_VERSION=3.10.1
33
FROM golang:1.13.0 AS build
44

55
RUN apt-get update -qq && apt-get install -y -q --no-install-recommends \
6-
coreutils \
7-
util-linux \
8-
uuid-runtime
6+
coreutils \
7+
util-linux \
8+
uuid-runtime
99

1010
WORKDIR /go/src/github.com/docker/app/
1111

1212
COPY . .
13-
ARG EXPERIMENTAL="off"
1413
ARG TAG="unknown"
15-
RUN make EXPERIMENTAL=${EXPERIMENTAL} BUILD_TAG=${BUILD_TAG} TAG=${TAG} bin/cnab-run
14+
RUN make BUILD_TAG=${BUILD_TAG} TAG=${TAG} bin/cnab-run
1615

17-
# local cnab invocation image
16+
# local cnab invocation image
1817
FROM alpine:${ALPINE_VERSION} as invocation
1918
RUN apk add --no-cache ca-certificates && adduser -S cnab
2019
USER cnab

Jenkinsfile

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,10 @@ pipeline {
7676
ansiColor('xterm') {
7777
sh 'make -f docker.Makefile save-invocation-image'
7878
sh 'make -f docker.Makefile INVOCATION_IMAGE_TAG=$TAG-coverage OUTPUT=coverage-invocation-image.tar save-invocation-image-tag'
79-
sh 'make -f docker.Makefile INVOCATION_IMAGE_TAG=$TAG-coverage-experimental OUTPUT=coverage-experimental-invocation-image.tar save-invocation-image-tag'
8079
}
8180
dir('_build') {
8281
stash name: 'invocation-image', includes: 'invocation-image.tar'
8382
stash name: 'coverage-invocation-image', includes: 'coverage-invocation-image.tar'
84-
stash name: 'coverage-experimental-invocation-image', includes: 'coverage-experimental-invocation-image.tar'
8583
}
8684
}
8785
}
@@ -90,7 +88,6 @@ pipeline {
9088
dir('src/github.com/docker/app') {
9189
sh 'docker rmi docker/cnab-app-base:$TAG'
9290
sh 'docker rmi docker/cnab-app-base:$TAG-coverage'
93-
sh 'docker rmi docker/cnab-app-base:$TAG-coverage-experimental'
9491
}
9592
deleteDir()
9693
}
@@ -130,34 +127,6 @@ pipeline {
130127
}
131128
}
132129
}
133-
stage("Coverage (experimental)") {
134-
agent { label 'ubuntu-1804 && x86_64 && overlay2' }
135-
steps {
136-
dir('src/github.com/docker/app') {
137-
checkout scm
138-
dir('_build') {
139-
unstash "coverage-experimental-invocation-image"
140-
sh 'docker load -i coverage-experimental-invocation-image.tar'
141-
}
142-
ansiColor('xterm') {
143-
sh 'make EXPERIMENTAL=on TEST_RESULTS_PREFIX="experimental-" -f docker.Makefile TAG=$TAG-coverage-experimental coverage-run || true'
144-
sh 'make EXPERIMENTAL=on TEST_RESULTS_PREFIX="experimental-" -f docker.Makefile TAG=$TAG-coverage-experimental coverage-results'
145-
}
146-
}
147-
}
148-
post {
149-
always {
150-
dir('src/github.com/docker/app/_build/test-results') {
151-
sh '[ ! -e experimental-unit-coverage.xml ] || sed -i -E -e \'s,"github.com/docker/app","unit/experimental",g; s,"github.com/docker/app/([^"]*)","unit/experimental/\\1",g\' experimental-unit-coverage.xml'
152-
sh '[ ! -e experimental-e2e-coverage.xml ] || sed -i -E -e \'s,"github.com/docker/app/e2e","e2e/experimental",g\' experimental-e2e-coverage.xml'
153-
archiveArtifacts '*.xml'
154-
junit '*.xml'
155-
}
156-
sh 'docker rmi docker/cnab-app-base:$TAG-coverage-experimental'
157-
deleteDir()
158-
}
159-
}
160-
}
161130
stage("Test Linux") {
162131
agent { label 'ubuntu-1804 && x86_64 && overlay2' }
163132
environment {

Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@ ifeq ($(BUILDTIME),)
88
$(warning unable to set BUILDTIME. Set the value manually)
99
endif
1010

11-
BUILDTAGS=""
12-
ifeq ($(EXPERIMENTAL),on)
13-
BUILDTAGS="experimental"
14-
endif
15-
1611
LDFLAGS := "-s -w \
1712
-X $(PKG_NAME)/internal.GitCommit=$(COMMIT) \
1813
-X $(PKG_NAME)/internal.Version=$(TAG) \
19-
-X $(PKG_NAME)/internal.Experimental=$(EXPERIMENTAL) \
2014
-X $(PKG_NAME)/internal.BuildTime=$(BUILDTIME)"
2115

2216
EXEC_EXT :=

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,3 @@ Commands:
382382

383383
Run 'docker app COMMAND --help' for more information on a command.
384384
```
385-
386-
## Experimental
387-
388-
Some commands are flagged as experimental and will remain in this state until
389-
they mature. These commands are only accessible using an experimental binary.
390-
Feel free to test these commands and give us some feedback!
391-
392-
See [BUILDING.md/Experimental](BUILDING.md#experimental).

docker.Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ E2E_CROSS_CTNR_NAME := $(BIN_NAME)-e2e-cross-$(TAG)
1414
COV_CTNR_NAME := $(BIN_NAME)-cov-$(TAG)
1515
SCHEMAS_CTNR_NAME := $(BIN_NAME)-schemas-$(TAG)
1616

17-
BUILD_ARGS=--build-arg EXPERIMENTAL=$(EXPERIMENTAL) --build-arg TAG=$(TAG) --build-arg COMMIT=$(COMMIT) --build-arg ALPINE_VERSION=$(ALPINE_VERSION) --build-arg GOPROXY=$(GOPROXY)
17+
BUILD_ARGS=--build-arg TAG=$(TAG) --build-arg COMMIT=$(COMMIT) --build-arg ALPINE_VERSION=$(ALPINE_VERSION) --build-arg GOPROXY=$(GOPROXY)
1818

1919
PKG_PATH := /go/src/$(PKG_NAME)
2020

@@ -37,7 +37,7 @@ shell: build_dev_image ## run a shell in the docker build image
3737
docker run -ti --rm $(DEV_IMAGE_NAME) bash
3838

3939
cross: create_bin ## cross-compile binaries (linux, darwin, windows)
40-
docker build $(BUILD_ARGS) --target=cross -t $(CROSS_IMAGE_NAME) .
40+
docker build $(BUILD_ARGS) --target=cross -t $(CROSS_IMAGE_NAME) .
4141
docker create --name $(CROSS_CTNR_NAME) $(CROSS_IMAGE_NAME) noop
4242
docker cp $(CROSS_CTNR_NAME):$(PKG_PATH)/bin/$(BIN_NAME)-linux bin/$(BIN_NAME)-linux
4343
docker cp $(CROSS_CTNR_NAME):$(PKG_PATH)/bin/$(BIN_NAME)-darwin bin/$(BIN_NAME)-darwin
@@ -48,7 +48,7 @@ cross: create_bin ## cross-compile binaries (linux, darwin, windows)
4848
@$(call chmod,+x,bin/$(BIN_NAME)-windows.exe)
4949

5050
cli-cross: create_bin
51-
docker build $(BUILD_ARGS) --target=build -t $(CLI_IMAGE_NAME) .
51+
docker build $(BUILD_ARGS) --target=build -t $(CLI_IMAGE_NAME) .
5252
docker create --name $(CLI_CNTR_NAME) $(CLI_IMAGE_NAME) noop
5353
docker cp $(CLI_CNTR_NAME):/go/src/github.com/docker/cli/build/docker-linux-amd64 bin/docker-linux
5454
docker cp $(CLI_CNTR_NAME):/go/src/github.com/docker/cli/build/docker-darwin-amd64 bin/docker-darwin
@@ -90,15 +90,15 @@ test: test-unit test-e2e ## run all tests
9090

9191
test-unit: build_dev_image ## run unit tests
9292
@$(call mkdir,_build/test-results)
93-
docker run --rm -v $(CURDIR)/_build/test-results:/test-results $(DEV_IMAGE_NAME) make EXPERIMENTAL=$(EXPERIMENTAL) TEST_RESULTS_PREFIX=$(TEST_RESULTS_PREFIX) test-unit
93+
docker run --rm -v $(CURDIR)/_build/test-results:/test-results $(DEV_IMAGE_NAME) make TEST_RESULTS_PREFIX=$(TEST_RESULTS_PREFIX) test-unit
9494

9595
test-e2e: build_dev_image invocation-image ## run end-to-end tests
96-
docker run -v /var/run:/var/run:ro --rm --network="host" $(DEV_IMAGE_NAME) make EXPERIMENTAL=$(EXPERIMENTAL) TEST_RESULTS_PREFIX=$(TEST_RESULTS_PREFIX) bin/$(BIN_NAME) test-e2e
96+
docker run -v /var/run:/var/run:ro --rm --network="host" $(DEV_IMAGE_NAME) make TEST_RESULTS_PREFIX=$(TEST_RESULTS_PREFIX) bin/$(BIN_NAME) test-e2e
9797

9898
COV_LABEL := com.docker.app.cov-run=$(TAG)
9999
coverage-run: build_dev_image ## run tests with coverage
100100
@$(call mkdir,_build)
101-
docker run -v /var/run:/var/run:ro --name $(COV_CTNR_NAME) --network="host" -t $(DEV_IMAGE_NAME) make COMMIT=${COMMIT} TAG=${TAG} EXPERIMENTAL=$(EXPERIMENTAL) TEST_RESULTS_PREFIX=$(TEST_RESULTS_PREFIX) coverage
101+
docker run -v /var/run:/var/run:ro --name $(COV_CTNR_NAME) --network="host" -t $(DEV_IMAGE_NAME) make COMMIT=${COMMIT} TAG=${TAG} TEST_RESULTS_PREFIX=$(TEST_RESULTS_PREFIX) coverage
102102
coverage-results:
103103
docker cp $(COV_CTNR_NAME):$(PKG_PATH)/_build/cov/ ./_build/ci-cov
104104
docker cp $(COV_CTNR_NAME):$(PKG_PATH)/_build/test-results/ ./_build/test-results

e2e/main_test.go

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
package e2e
22

33
import (
4-
"bytes"
54
"encoding/json"
65
"flag"
76
"io/ioutil"
87
"os"
9-
"os/exec"
108
"path/filepath"
119
"runtime"
1210
"testing"
@@ -19,10 +17,9 @@ import (
1917
)
2018

2119
var (
22-
e2ePath = flag.String("e2e-path", ".", "Set path to the e2e directory")
23-
dockerCliPath = os.Getenv("DOCKERCLI_BINARY")
24-
hasExperimental = false
25-
dockerCli dockerCliCommand
20+
e2ePath = flag.String("e2e-path", ".", "Set path to the e2e directory")
21+
dockerCliPath = os.Getenv("DOCKERCLI_BINARY")
22+
dockerCli dockerCliCommand
2623
)
2724

2825
type dockerCliCommand struct {
@@ -119,13 +116,6 @@ func TestMain(m *testing.M) {
119116
createDockerAppSymLink(dockerApp, cliPluginDir)
120117

121118
dockerCli = dockerCliCommand{path: dockerCliPath, cliPluginDir: cliPluginDir}
122-
123-
cmd := exec.Command(dockerApp, "app", "--version")
124-
output, err := cmd.CombinedOutput()
125-
if err != nil {
126-
panic(err)
127-
}
128-
hasExperimental = bytes.Contains(output, []byte("Experimental: on"))
129119
os.Exit(m.Run())
130120
}
131121

e2e/plugin_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ func TestInvokePluginFromCLI(t *testing.T) {
2323
usage := icmd.RunCmd(cmd).Assert(t, icmd.Success).Combined()
2424

2525
goldenFile := "plugin-usage.golden"
26-
if hasExperimental {
27-
goldenFile = "plugin-usage-experimental.golden"
28-
}
2926
golden.Assert(t, usage, goldenFile)
3027

3128
// docker info should print app version and short description

e2e/testdata/plugin-usage-experimental.golden

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)