forked from tektoncd/pipeline
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instead of doing a lot of hacks to make sure we have all the tools we need to auth + invoke ko, let's build an image that has what we need in advance. Eventually we should be able to build this image and refer to the built image in our steps (tektoncd#639) but for now we'll have to hardcode it. We may also improve this image in tektoncd#631, or decide to move away from `ko` entirely.
- Loading branch information
1 parent
9e7a67b
commit bdd78b6
Showing
5 changed files
with
116 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: PipelineResource | ||
metadata: | ||
name: tekton-pipelines | ||
spec: | ||
type: git | ||
params: | ||
- name: url | ||
value: https://github.com/tektoncd/pipeline # REPLACE with your own fork | ||
- name: revision | ||
value: master # REPLACE with your own commit | ||
--- | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: PipelineResource | ||
metadata: | ||
name: ko-image | ||
spec: | ||
type: image | ||
params: | ||
- name: url | ||
value: ko-ci # Registry is provided via parameter, this is a hack see #569 | ||
--- | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: TaskRun | ||
metadata: | ||
name: publish-ci-images-run | ||
spec: | ||
taskRef: | ||
name: publish-ci-images | ||
trigger: | ||
type: manual | ||
inputs: | ||
resources: | ||
- name: source | ||
resourceRef: | ||
name: tekton-pipelines | ||
params: | ||
- name: imageRegistry | ||
value: gcr.io/tekton-releases # REPLACE with your own registry | ||
outputs: | ||
resources: | ||
- name: builtKoImage | ||
resourceRef: | ||
name: ko-image |
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,27 @@ | ||
|
||
apiVersion: tekton.dev/v1alpha1 | ||
kind: Task | ||
metadata: | ||
name: publish-ci-images | ||
spec: | ||
inputs: | ||
resources: | ||
- name: source | ||
type: git | ||
params: | ||
- name: imageRegistry | ||
description: TODO(#569) This is a hack to make it easy for folks to switch the registry being used by the many many image outputs | ||
outputs: | ||
resources: | ||
- name: builtKoImage | ||
type: image | ||
steps: | ||
|
||
- name: build-push-ko-image | ||
image: gcr.io/kaniko-project/executor | ||
command: | ||
- /kaniko/executor | ||
args: | ||
- --dockerfile=/workspace/source/tekton/ko/Dockerfile | ||
- --destination=${inputs.params.imageRegistry}/${outputs.resources.builtKoImage.url} | ||
- --context=/workspace/source |
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,10 @@ | ||
FROM google/cloud-sdk:latest | ||
|
||
# Install golang | ||
RUN curl https://dl.google.com/go/go1.12.1.linux-amd64.tar.gz > go1.12.1.tar.gz | ||
RUN tar -C /usr/local -xzf go1.12.1.tar.gz | ||
ENV PATH="${PATH}:/usr/local/go/bin" | ||
|
||
# Install ko | ||
ENV GOBIN=/usr/local/go/bin | ||
RUN go get github.com/google/go-containerregistry/cmd/ko |
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