XR for Universal Blue and Fedora Atomic Desktops
vr fedora-atomic linux
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add CI script for building OCI images

+35
+35
ci/build-oci.nu
··· 1 + #!/usr/bin/env nu 2 + # SPDX-License-Identifier: AGPL-3.0-only 3 + # SPDX-FileCopyrightText: MatrixFurry <matrix@matrixfurry.com> 4 + 5 + const axr = path self .. 6 + const registry = "registry.gitlab.com" 7 + const project = "matrixfurry/xr-packages" 8 + 9 + def main [ 10 + image: string # name of the image to build 11 + --username (-u): string 12 + --token (-t): string 13 + --no-login (-l) # Use this if the machine is already authenticated with the container registry 14 + ] { 15 + let username = $username | default $env.CI_REGISTRY_USERNAME? 16 + let token = $token | default $env.CI_REGISTRY_PASSWORD? 17 + let registry_image = [$registry $project $image] | str join '/' 18 + 19 + if ($username | is-empty) and not $no_login { 20 + error make { 21 + msg: "Username not provided" 22 + help: "Please provide a username with --username or $env.CI_REGISTRY_USERNAME" 23 + } 24 + } 25 + if ($token | is-empty) and not $no_login { 26 + error make { 27 + msg: "Token not provided" 28 + help: "Please provide a deployment token with --token or $env.CI_REGISTRY_PASSWORD" 29 + } 30 + } 31 + 32 + if not $no_login {podman login $registry -u $username -p $token} 33 + podman build -t $registry_image ($axr | path join "oci" $image) 34 + podman push $registry_image 35 + }