Skip to content

Commit

Permalink
Use current (as in PR) func image in integration tests (knative#1548)
Browse files Browse the repository at this point in the history
* cleanup: style

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fix: use current func image for in cluster tests

Signed-off-by: Matej Vasek <mvasek@redhat.com>

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
  • Loading branch information
matejvasek authored and lance committed Feb 15, 2023
1 parent 9670bde commit 4057d33
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test-e2e-oncluster-runtime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- uses: imjasonh/setup-ko@v0.6
- name: Install Binaries
run: ./hack/binaries.sh
- name: Setup testing func image
run: ./hack/create-testing-func-image.sh
- name: Allocate Cluster
run: ./hack/allocate.sh
- name: Deploy Tekton
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-e2e-oncluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- uses: imjasonh/setup-ko@v0.6
- name: Install Binaries
run: ./hack/binaries.sh
- name: Setup testing func image
run: ./hack/create-testing-func-image.sh
- name: Allocate Cluster
run: ./hack/allocate.sh
- name: Deploy Tekton
Expand Down
15 changes: 15 additions & 0 deletions hack/create-testing-func-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

KO_DOCKER_REPO="ttl.sh/$(head -c 128 </dev/urandom | LC_CTYPE=C tr -dc 'a-z0-9' | fold -w 8 | head -n 1)"
export KO_DOCKER_REPO

REF_FILE=$(mktemp)

ko build --image-refs "${REF_FILE}" --tags "30m" -B ./cmd/func

yq -Y -i ".spec.steps[0].image = \"$(cat "${REF_FILE}")\"" \
pipelines/resources/tekton/task/func-deploy/0.1/func-deploy.yaml
22 changes: 11 additions & 11 deletions pipelines/resources/tekton/task/func-deploy/0.1/func-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ spec:
description: >-
This Task performs a deploy operation using the Knative `func` CLI
params:
- name: path
description: Path to the function project
default: ""
- name: image
description: Container image to be deployed
default: ""
- name: path
description: Path to the function project
default: ""
- name: image
description: Container image to be deployed
default: ""
workspaces:
- name: source
description: The workspace containing the function project
steps:
- name: func-deploy
image: "ghcr.io/knative/func/func:latest"
script: |
export FUNC_IMAGE="$(params.image)"
func deploy --verbose --build=false --push=false --path=$(params.path) --remote=false
- name: func-deploy
image: "ghcr.io/knative/func/func:latest"
script: |
export FUNC_IMAGE="$(params.image)"
func deploy --verbose --build=false --push=false --path=$(params.path) --remote=false

0 comments on commit 4057d33

Please sign in to comment.