Skip to content

Commit

Permalink
Merge pull request #14 from canonical/feature/oci-factorization
Browse files Browse the repository at this point in the history
prepare repo for OCI factory
  • Loading branch information
lucabello committed Jul 31, 2023
2 parents 826c5bc + 499667d commit 32e8b45
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 31 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/build-rock.yaml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Pull Requests

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
branches:
- main

jobs:
pull-request:
name: PR
uses: canonical/observability/.github/workflows/rock-pull-request.yaml@main
secrets: inherit
18 changes: 18 additions & 0 deletions .github/workflows/rock-release-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish ROCK to GHCR with dev tag

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
workflow_dispatch: {}
push:
branches:
- main

jobs:
build:
uses: canonical/observability/.github/workflows/rock-release-dev.yaml@main
secrets: inherit
with:
rock-name: prometheus
26 changes: 26 additions & 0 deletions .github/workflows/rock-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Update ROCK

on:
workflow_dispatch: {}
schedule:
- cron: '0 0,4,8,12,16,20 * * *'

jobs:
build:
uses: canonical/observability/.github/workflows/rock-update.yaml@main
with:
rock-name: prometheus
source-repo: prometheus/prometheus
check-go: true
update-script: |
# The caller must provide $application_src and $rockcraft_yaml
# $application_src: The root folder of the cloned upstream project
# $rockcraft_yaml: Path of the rockcraft.yaml to update
if [[ -z "$application_src" || -z "$rockcraft_yaml"]]; then
echo "Remember to set the variables for application_src and rockcraft_yaml!"
exit 1;
fi
## Node dependency
node_version=$(jq -r '.devDependencies."@types/node"' "$application_src"/web/ui/package.json | tr -d '^')
yq -i 'del(.parts.prometheus.build-snaps.[] | select(. == "node/*"))' "$rockcraft_yaml"
ver="${node_version%%\.*}" yq -i '.parts.prometheus.build-snaps += "node/"+strenv(ver)+"/stable"' "$rockcraft_yaml"
14 changes: 0 additions & 14 deletions .github/workflows/update-rock.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion rockcraft.yaml → 2.45.0/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ parts:
source-tag: "v2.46.0"
build-snaps:
- go/1.19/stable
- node/18/stable
- node/17/stable
build-packages:
- make
override-build: |
Expand Down

0 comments on commit 32e8b45

Please sign in to comment.