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

Added rockcraft.yaml and build workflows #1

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Push Multiarch Images
on:
pull_request:
push:
branches:
- main

jobs:
build-and-push-arch-specifics:
name: Build Rocks and Push Arch Specific Images
uses: canonical/k8s-workflows/.github/workflows/build_rocks.yaml@main
with:
owner: ${{ github.repository_owner }}
trivy-image-config: "trivy.yaml"
multiarch-awareness: true
cache-action: ${{ (github.event_name == 'push') && 'save' || 'restore' }}
build-and-push-multiarch-manifest:
name: Combine Rocks and Push Multiarch Manifest
uses: canonical/k8s-workflows/.github/workflows/assemble_multiarch_image.yaml@main
needs: [build-and-push-arch-specifics]
with:
rock-metas: ${{ needs.build-and-push-arch-specifics.outputs.rock-metas }}
dry-run: ${{ github.event_name != 'push' }}
37 changes: 37 additions & 0 deletions rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: metrics-server
summary: ROCK for the metrics-server Project.
description: This ROCK is a drop in replacement for the metrics-server/metrics-server image.
version: "0.7.0"
license: Apache-2.0

base: bare
build-base: ubuntu@22.04
platforms:
amd64:
# TODO: Add after workflows support bulding arm64 ROCKs
# arm64:

services:
metrics-server:
override: replace
summary: "metrics-server service"
startup: enabled
command: "/metrics-server [ ]"
on-failure: shutdown

entrypoint-service: metrics-server

parts:
metrics-server:
plugin: nil
source: https://github.com/kubernetes-sigs/metrics-server.git
source-type: git
source-tag: v0.7.0
source-depth: 1
build-packages:
- build-essential
build-snaps:
- go/1.21/stable
override-build: |
make
cp $CRAFT_PART_BUILD/metrics-server $CRAFT_PART_INSTALL
3 changes: 3 additions & 0 deletions trivy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
timeout: 20m
scan:
offline-scan: true
Loading