diff --git a/.github/workflows/build-rock.yaml b/.github/workflows/build-rock.yaml deleted file mode 100644 index 52e25ba..0000000 --- a/.github/workflows/build-rock.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: Build ROCK - -on: - workflow_dispatch: {} - push: - branches: - - main - schedule: - - cron: "0 12 * * 0" - -jobs: - build: - uses: canonical/observability/.github/workflows/build-rock.yaml@main - secrets: inherit - with: - rock-name: prometheus diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml new file mode 100644 index 0000000..4e0077b --- /dev/null +++ b/.github/workflows/pull-request.yaml @@ -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 diff --git a/.github/workflows/rock-release-dev.yaml b/.github/workflows/rock-release-dev.yaml new file mode 100644 index 0000000..1ff3edc --- /dev/null +++ b/.github/workflows/rock-release-dev.yaml @@ -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 diff --git a/.github/workflows/rock-update.yaml b/.github/workflows/rock-update.yaml new file mode 100644 index 0000000..512b0d1 --- /dev/null +++ b/.github/workflows/rock-update.yaml @@ -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" diff --git a/.github/workflows/update-rock.yaml b/.github/workflows/update-rock.yaml deleted file mode 100644 index ef31027..0000000 --- a/.github/workflows/update-rock.yaml +++ /dev/null @@ -1,14 +0,0 @@ -name: Update ROCK - -on: - workflow_dispatch: {} - schedule: - - cron: '0 0,4,8,12,16,20 * * *' - -jobs: - build: - uses: canonical/observability/.github/workflows/update-rock.yaml@main - with: - rock-name: prometheus - source-repo: prometheus/prometheus - check-go: true diff --git a/rockcraft.yaml b/2.45.0/rockcraft.yaml similarity index 98% rename from rockcraft.yaml rename to 2.45.0/rockcraft.yaml index 6236c8a..5f6ac60 100644 --- a/rockcraft.yaml +++ b/2.45.0/rockcraft.yaml @@ -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: |