-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from appuio/review
Badges and tests
- Loading branch information
Showing
12 changed files
with
164 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,9 @@ | ||
#______________________________________________________________________________ | ||
#### Base Image, to save build time on local dev machine | ||
ARG GOARCH=amd64 | ||
ARG ARCH=amd64-edge | ||
FROM docker.io/library/golang:1.13-alpine as builder | ||
FROM docker.io/library/alpine:3.10 as runtime | ||
|
||
WORKDIR /go/src/app | ||
|
||
COPY ["go.mod", "go.sum", "./"] | ||
|
||
RUN \ | ||
go mod download | ||
|
||
ARG VERSION=unspecified | ||
ARG GIT_COMMIT=unspecified | ||
|
||
COPY / . | ||
RUN \ | ||
go build -ldflags "-X main.version=${VERSION} -X main.commit=${GIT_COMMIT} -X main.date=$(date -u '+%Y-%m-%dT%TZ')" | ||
|
||
#______________________________________________________________________________ | ||
#### Runtime Image | ||
ARG ARCH=amd64-edge | ||
FROM docker.io/multiarch/alpine:${ARCH} as runtime | ||
|
||
ENV ALPINE_MIRROR=http://dl-cdn.alpinelinux.org/alpine | ||
ENTRYPOINT ["image-cleanup"] | ||
|
||
RUN \ | ||
echo "${ALPINE_MIRROR}/${ALPINE_REL}/main" > /etc/apk/repositories && \ | ||
echo "${ALPINE_MIRROR}/${ALPINE_REL}/community" >> /etc/apk/repositories && \ | ||
apk update && \ | ||
apk upgrade && \ | ||
apk add --no-cache curl bash | ||
|
||
COPY --from=builder /go/src/app/image-cleanup /usr/bin/image-cleanup | ||
COPY image-cleanup /usr/bin/image-cleanup | ||
USER 1000:0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package commands | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
"testing" | ||
) | ||
|
||
func Test_printGitHEAD(t *testing.T) { | ||
type args struct { | ||
cmd *cobra.Command | ||
args []string | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
}{ | ||
// TODO: Add test cases. | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package commands | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
"testing" | ||
) | ||
|
||
func Test_printImageStreamsFromNamespace(t *testing.T) { | ||
type args struct { | ||
cmd *cobra.Command | ||
args []string | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
}{ | ||
// TODO: Add test cases. | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.