Skip to content

Commit

Permalink
add codefresh pipelines
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>
  • Loading branch information
jdolitsky committed Jan 14, 2019
1 parent 500cecb commit 4227b7f
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .codefresh/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '1.0'
stages:
- build
- release
steps:
BuildDockerImage:
title: Build Docker image
stage: build
type: build
image_name: ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}
PushDockerImage:
title: Push Docker image (latest)
stage: release
type: push
candidate: ${{BuildDockerImage}}
image_name: ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}
registry: dockerhub
28 changes: 28 additions & 0 deletions .codefresh/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Note: must set env var GITHUB_TOKEN for goreleaser
version: '1.0'
stages:
- build
- release
steps:
BuildDockerImage:
title: Build Docker image
stage: build
type: build
image_name: ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}
UploadReleaseArtifacts:
title: Upload release artifacts
stage: release
image: goreleaser/goreleaser:v0.95.0
working_directory: /go/src/github.com/${{CF_REPO_OWNER}}
commands:
- ln -s /codefresh/volume/${{CF_REPO_NAME}} ${{CF_REPO_NAME}} && cd ${{CF_REPO_NAME}}
- git checkout tags/${{CF_BRANCH_TAG_NORMALIZED}}
- goreleaser --rm-dist
PushDockerImageTagged:
title: Push Docker image (tag)
stage: release
type: push
candidate: ${{BuildDockerImage}}
image_name: ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}
tag: ${{CF_BRANCH_TAG_NORMALIZED}}
registry: dockerhub
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:1.11-alpine as builder
ADD . /go/src/github.com/jdolitsky/chart-scanner
WORKDIR /go/src/github.com/jdolitsky/chart-scanner
RUN go install github.com/jdolitsky/chart-scanner/cmd/chart-scanner

FROM alpine
RUN apk --update add ca-certificates
COPY --from=builder /go/bin/chart-scanner /bin/chart-scanner
RUN mkdir /workspace
WORKDIR /workspace
ENTRYPOINT ["/bin/chart-scanner"]

0 comments on commit 4227b7f

Please sign in to comment.