Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create action that copies ROCK to Docker #29

Open
orfeas-k opened this issue Dec 4, 2023 · 3 comments
Open

Create action that copies ROCK to Docker #29

orfeas-k opened this issue Dec 4, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@orfeas-k
Copy link
Contributor

orfeas-k commented Dec 4, 2023

What needs to get done

Create an action to copy ROCK to Docker. We could create a composite action (which is essentially just a workflow file).

Why it needs to get done

At the moment, these lines of code are copied-pasted over a lot of our workflows

build_and_publish_rock.yaml
build_and_scan_rock.yaml
build_scan_and_test_rock.yaml

In order to avoid copy-pasting and reuse this inside a workflow's step, we need to create an action for it.

You call a reusable workflow by using the uses keyword. Unlike when you are using actions within a workflow, you call reusable workflows directly within a job, and not from within job steps.

(source)

Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/KF-5129.

This message was autogenerated

@orfeas-k
Copy link
Contributor Author

orfeas-k commented Dec 12, 2023

We still need this after #36, since we 're doing the following in all WFs introduced there (scan-rock.yaml, sanity-test.yaml, integration-test.yaml, publish-rock.yaml)

          DOCKER_IMAGE=${{ inputs.rock-name }}:${{ inputs.rock-version }}
          sudo skopeo --insecure-policy copy oci-archive:${{ inputs.rock-filename }} docker-daemon:$DOCKER_IMAGE
          echo "image=$DOCKER_IMAGE" >> "$GITHUB_OUTPUT"

This could also be coupled with the download-artifact action and be a Download and export ROCK to Docker action

@orfeas-k
Copy link
Contributor Author

As @NohaIhab pointed out here, we could omit skopeo as a dependency and use the skopeo bin provided when installing rockcraft, as it is used here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant