Skip to content

Commit

Permalink
Merge pull request #8 from dwertent/fix-dev-image
Browse files Browse the repository at this point in the history
Fix dev image
  • Loading branch information
dwertent committed Dec 1, 2022
2 parents 3c8da1b + 2a9b272 commit 728ae47
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
description: 'image tag'
required: true
type: string
tag_latest:
description: 'should this image have the latest tag'
required: false
default: false
type: boolean
image_name:
description: 'image registry and name'
required: true
Expand Down Expand Up @@ -60,11 +65,18 @@ jobs:

- name: Build and push image
if: ${{ inputs.support_platforms }}
run: docker buildx build . --file build/Dockerfile --tag ${{ inputs.image_name }}:${{ inputs.image_tag }} --tag ${{ inputs.image_name }}:latest --build-arg image_version=${{ inputs.image_tag }} --build-arg client=${{ inputs.client }} --push --platform linux/amd64,linux/arm64
run: docker buildx build . --file build/Dockerfile --tag ${{ inputs.image_name }}:${{ inputs.image_tag }} --build-arg image_version=${{ inputs.image_tag }} --build-arg client=${{ inputs.client }} --platform linux/amd64,linux/arm64

- name: Build and push image without amd64/arm64 support
if: ${{ !inputs.support_platforms }}
run: docker buildx build . --file build/Dockerfile --tag ${{ inputs.image_name }}:${{ inputs.image_tag }} --tag ${{ inputs.image_name }}:latest --build-arg image_version=${{ inputs.image_tag }} --build-arg client=${{ inputs.client }} --push
run: docker buildx build . --file build/Dockerfile --tag ${{ inputs.image_name }}:${{ inputs.image_tag }} --build-arg image_version=${{ inputs.image_tag }} --build-arg client=${{ inputs.client }}

- name: Tag image as latest
if: ${{ inputs.tag_latest }}
run: docker tag ${{ inputs.image_name }}:${{ inputs.image_tag }}} ${{ inputs.image_name }}:latest

- name: Push image to registry
run: docker push ${{ inputs.image_name }}

- name: Install cosign
uses: sigstore/cosign-installer@main
Expand All @@ -75,6 +87,5 @@ jobs:
env:
COSIGN_EXPERIMENTAL: "true"
run: |
cosign sign --force ${{ inputs.image_name }}:latest
cosign sign --force ${{ inputs.image_name }}:${{ inputs.image_tag }}
cosign sign --force ${{ inputs.image_name }}
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [ master ]
paths-ignore:
# Do not run the pipeline if only Markdown files changed
- '**.md'
jobs:
test:
Expand Down Expand Up @@ -86,6 +85,7 @@ jobs:
client: "image-release"
image_name: "quay.io/${{ github.repository_owner }}/kubescape"
image_tag: "v2.0.${{ github.run_number }}"
tag_latest: true
support_platforms: true
cosign: true
secrets: inherit
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (report *ReportEventReceiver) addPathURL(urlObj *url.URL) {
case SubmitContextRBAC:
urlObj.Path = "rbac-visualizer"
case SubmitContextRepository:
urlObj.Path = fmt.Sprintf("repositories-scan/%s", report.reportID)
urlObj.Path = fmt.Sprintf("repository-scanning/%s", report.reportID)
default:
urlObj.Path = "dashboard"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestGetURL(t *testing.T) {
"XXXX",
SubmitContextRepository,
)
assert.Equal(t, "https://cloud.armosec.io/repositories-scan/XXXX?utm_campaign=Submit&utm_medium=CLI&utm_source=GitHub", reporter.GetURL())
assert.Equal(t, "https://cloud.armosec.io/repository-scanning/XXXX?utm_campaign=Submit&utm_medium=CLI&utm_source=GitHub", reporter.GetURL())
}

// Test submit and NOT registered url
Expand Down

0 comments on commit 728ae47

Please sign in to comment.