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

Improve automation next to erlang/docker-erlang-otp builds #7813

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

paulo-ferraz-oliveira
Copy link
Contributor

@paulo-ferraz-oliveira paulo-ferraz-oliveira commented Nov 2, 2023

Motivation

To automate Erlang/OTP release -based Docker image building next to erlang/docker-erlang-otp (these days I understand it's a manual process).

Description

As per what's been recently discussed in the #build-and-packaging EEF Slack channel, and since erlang/otp accepts triggering builds next to erlang/docker-erlang-otp (I'm not sure the other way around is completely agreed upon, but am assuming it), I'm pushing this to make that happen.

trigger-docker-build.yaml will be triggered by a workflow from this repository (I'm not exactly sure which one, so ⚠️ need guidance) by having the generated OTP version (otp_version) and SHA256 checksum (otp_download_sha256) as inputs.

In my tests, I used a custom GitHub App I created for that purpose, but I'm not sure how you intend to do integration between these two repositories (which is why the workflow contains commented out instructions that can later be updated/removed).

The rest of the implementation (and as per @garazdawi's suggestion) follows the GitHub Docs closely.

Further considerations

I'll shortly open the sister pull request to this one, next to erlang/docker-erlang-otp and it's possible change requests from there end up changing this one, or vice-versa.

Example

As an example of workflow dispatch triggering, here's what I used for my tests (note the # Requires comment).

---
"on":
  - push
  - workflow_dispatch

jobs:
  release:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - env:
          GITHUB_TOKEN: ${{ github.token }}
        # Requires <repo>settings/actions: Workflow permissions > Read and write permissions
        run: |
          gh workflow run trigger_docker_build.yml \
            --repo "${GITHUB_REPOSITORY}" \
            --ref main \
            --raw-field otp_version=26.0.1 \
            --raw-field otp_download_sha256=dc02213328f88939013bedcbb7f170ffec60fc718ef685221c813b579f812602

Copy link
Contributor

github-actions bot commented Nov 2, 2023

CT Test Results

    1 files    11 suites   5m 13s ⏱️
  93 tests   91 ✔️ 2 💤 0
109 runs  107 ✔️ 2 💤 0

Results for commit a742ed4.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@garazdawi
Copy link
Contributor

I will look at this and handle the security aspects of triggering the workflow when erlang/docker-erlang-otp#454 is merged.

@paulo-ferraz-oliveira
Copy link
Contributor Author

Thanks, @garazdawi. I'll keep an eye on this, so lemme know (afterward) if anything's missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants