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 jobs to separate AWS environments from build environments #481

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

klutchell
Copy link
Contributor

This allows more granular control over which environments are used for which steps, and avoids requiring a single environment to define how to build, sign, and publish.

Initially this workflow will still fallback to the existing monolith environments and the behaviour should be unchanged.

Change-type: minor

os_version=$(git describe --abbrev=0)
echo "os_version=${os_version#v*}" >>"${GITHUB_OUTPUT}"

meta_balena_version="$(balena_lib_get_meta_balena_base_version)"

Check failure

Code scanning / octoscan

Write to "$GITHUB_OUTPUT" in a bash script. Error

Write to "$GITHUB_OUTPUT" in a bash script.

dt_arch="$(balena_lib_get_dt_arch "${MACHINE}")"
echo "dt_arch=${dt_arch}" >>"${GITHUB_OUTPUT}"

Check failure

Code scanning / octoscan

Use of "git checkout" in a bash script with a potentially dangerous reference. Error

Use of "git checkout" in a bash script with a potentially dangerous reference.
env:
# renovate: datasource=github-tags depName=aws/aws-cli
AWSCLI_VERSION: 2.22.10
with:

Check failure

Code scanning / octoscan

Write to "$GITHUB_OUTPUT" in a bash script. Error

Write to "$GITHUB_OUTPUT" in a bash script.
# renovate: datasource=github-tags depName=aws/aws-cli
AWSCLI_VERSION: 2.22.10
with:
version: "${{ env.AWSCLI_VERSION }}"

Check failure

Code scanning / octoscan

Write to "$GITHUB_OUTPUT" in a bash script. Error

Write to "$GITHUB_OUTPUT" in a bash script.
This allows more granular control over which environments are used
for which steps, and avoids requiring a single environment to define
how to build, sign, and publish.

This is better for security as it allows each job to only have
the secrets it needs, and not all secrets for all steps.

We retain backwards compatibility by falling back to the original
monolith environment input for now.

Change-type: minor
Signed-off-by: Kyle Harding <[email protected]>
Signed-off-by: Kyle Harding <[email protected]>
This key was only used to fetch the supervisor image name from the API,
but that endpoint does not need auth as the supervisor images are public.

Change-type: patch
Signed-off-by: Kyle Harding <[email protected]>
@klutchell klutchell temporarily deployed to balena-staging.com January 3, 2025 20:43 — with GitHub Actions Inactive
script: |
const result = await fetch(`https://api.${process.env.API_ENV}/${process.env.TRANSLATION}/device_type?\$filter=slug%20eq%20%27${process.env.DEVICE_SLUG}%27&\$select=slug,is_private`, {
headers: {
'Content-type': 'application/json',

Check failure

Code scanning / octoscan

Write to "$GITHUB_OUTPUT" in a bash script. Error

Write to "$GITHUB_OUTPUT" in a bash script.
'Authorization': `Bearer ${{ secrets.BALENA_API_DEPLOY_KEY }}`
}
})
const data = await result.json()

Check failure

Code scanning / octoscan

Write to "$GITHUB_OUTPUT" in a bash script. Error

Write to "$GITHUB_OUTPUT" in a bash script.
const data = await result.json()
console.log(JSON.stringify(data, null, 2))
return data.d[0].is_private

Check failure

Code scanning / octoscan

Write to "$GITHUB_OUTPUT" in a bash script. Error

Write to "$GITHUB_OUTPUT" in a bash script.
@klutchell klutchell temporarily deployed to balena-staging.com January 3, 2025 20:44 — with GitHub Actions Inactive
@klutchell klutchell temporarily deployed to balena-staging.com January 3, 2025 20:44 — with GitHub Actions Inactive
@klutchell klutchell temporarily deployed to balena-cloud.com January 3, 2025 21:47 — with GitHub Actions Inactive
@klutchell klutchell temporarily deployed to balena-cloud.com January 3, 2025 21:47 — with GitHub Actions Inactive
@klutchell klutchell temporarily deployed to balena-cloud.com January 3, 2025 21:47 — with GitHub Actions Inactive
@klutchell klutchell temporarily deployed to balena-staging.com January 3, 2025 23:51 — with GitHub Actions Inactive
@klutchell klutchell temporarily deployed to balena-staging.com January 3, 2025 23:51 — with GitHub Actions Inactive
@klutchell klutchell temporarily deployed to balena-staging.com January 3, 2025 23:52 — with GitHub Actions Inactive
@klutchell klutchell temporarily deployed to balena-staging.com January 4, 2025 00:30 — with GitHub Actions Inactive
@klutchell klutchell temporarily deployed to balena-cloud.com January 4, 2025 00:30 — with GitHub Actions Inactive
@klutchell klutchell temporarily deployed to balena-cloud.com January 4, 2025 00:30 — with GitHub Actions Inactive
@klutchell klutchell temporarily deployed to balena-cloud.com January 4, 2025 00:30 — with GitHub Actions Inactive
Signed-off-by: Kyle Harding <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant