-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
83 changed files
with
1,371 additions
and
976 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Build, sign, and package plugin | ||
description: Build, sign, and package plugin | ||
inputs: | ||
plugin_version_number: | ||
description: "The version number of the plugin" | ||
required: true | ||
grafana_access_policy_token: | ||
description: "The Grafana access policy token used to sign the plugin" | ||
required: true | ||
working_directory: | ||
description: "The working directory of the plugin" | ||
required: true | ||
is_enterprise: | ||
description: "Whether the plugin is an enterprise build or not" | ||
required: false | ||
default: "false" | ||
outputs: | ||
artifact_filename: | ||
description: "The filename of the plugin artifact" | ||
value: ${{ steps.artifact-filename.outputs.filename }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Determine artifact filename | ||
shell: bash | ||
id: artifact-filename | ||
# yamllint disable rule:line-length | ||
run: | | ||
echo filename="grafana-oncall${{ inputs.is_enterprise == 'true' && '-ee' || '' }}-app-${{ inputs.plugin_version_number }}.zip" >> $GITHUB_OUTPUT | ||
- name: Build, sign, and package plugin | ||
shell: bash | ||
working-directory: ${{ inputs.working_directory }} | ||
env: | ||
GRAFANA_ACCESS_POLICY_TOKEN: ${{ inputs.grafana_access_policy_token }} | ||
run: | | ||
jq --arg v "${{ inputs.plugin_version_number }}" '.version=$v' package.json > package.new && mv package.new package.json && jq '.version' package.json; | ||
yarn build | ||
yarn sign | ||
if [ ! -f dist/MANIFEST.txt ]; then echo "Sign failed, MANIFEST.txt not created, aborting." && exit 1; fi | ||
mv dist grafana-oncall-app | ||
zip -r grafana-oncall-app.zip ./grafana-oncall-app | ||
cp grafana-oncall-app.zip ${{ steps.artifact-filename.outputs.filename }} | ||
# yamllint enable rule:line-length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Set engine version in settings file | ||
description: Set engine version in settings file | ||
inputs: | ||
working_directory: | ||
description: The working directory | ||
required: true | ||
engine_version_number: | ||
description: The engine version number | ||
required: true | ||
settings_file_path: | ||
description: The path to the settings file to set VERSION in | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set engine version in settings file | ||
shell: bash | ||
working-directory: ${{ inputs.working_directory }} | ||
# yamllint disable rule:line-length | ||
run: | | ||
sed "0,/VERSION.*/ s/VERSION.*/VERSION = \"${{ inputs.engine_version_number }}\"/g" ${{ inputs.settings_file_path }} > ./settings.temp && mv settings.temp ${{ inputs.settings_file_path }} | ||
cat ${{ inputs.settings_file_path }} | grep VERSION | head -1 | ||
# yamllint enable rule:line-length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
.github/workflows/build-engine-docker-image-and-publish-to-dockerhub.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Build engine Docker image and publish to Dockerhub | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
engine_version: | ||
required: false | ||
type: string | ||
docker_image_tags: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build-engine-docker-image-and-publish-to-dockerhub: | ||
name: Build engine Docker image and publish to Dockerhub | ||
runs-on: ubuntu-latest | ||
# These permissions are needed to assume roles from Github's OIDC. | ||
# https://github.com/grafana/shared-workflows/tree/main/actions/build-push-to-dockerhub | ||
permissions: | ||
contents: read | ||
id-token: write | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v4 | ||
- name: Set engine version number in settings file | ||
if: inputs.engine_version | ||
uses: ./.github/actions/set-engine-version-in-settings | ||
with: | ||
working_directory: . | ||
engine_version_number: ${{ inputs.engine_version }} | ||
settings_file_path: engine/settings/base.py | ||
- name: Build engine Docker image and push to Dockerhub | ||
uses: grafana/shared-workflows/actions/build-push-to-dockerhub@main | ||
with: | ||
context: engine/ | ||
push: true | ||
platforms: linux/arm64/v8,linux/amd64 | ||
repository: grafana/oncall | ||
tags: ${{ inputs.docker_image_tags }} | ||
build-args: | | ||
BUILDKIT_INLINE_CACHE=1 | ||
target: prod | ||
cache-from: grafana/oncall:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: On commits to dev | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
|
||
concurrency: | ||
# Cancel any running workflow for the same branch when new commits are pushed. | ||
# We group both by ref_name (available when CI is triggered by a push to a branch/tag) | ||
# and head_ref (available when CI is triggered by a PR). | ||
group: "${{ github.ref_name }}-${{ github.head_ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-engine-docker-image-and-publish-to-dockerhub: | ||
name: Build engine Docker image and publish to Dockerhub | ||
uses: ./.github/workflows/build-engine-docker-image-and-publish-to-dockerhub.yml | ||
with: | ||
# https://github.com/docker/metadata-action?tab=readme-ov-file#tags-input | ||
docker_image_tags: | | ||
type=raw,value=dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: On pull requests | ||
|
||
on: | ||
pull_request: | ||
# You can use the merge_group event to trigger your GitHub Actions workflow when | ||
# a pull request is added to a merge queue | ||
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue#triggering-merge-group-checks-with-github-actions | ||
merge_group: | ||
|
||
concurrency: | ||
# Cancel any running workflow for the same branch when new commits are pushed. | ||
# We group both by ref_name (available when CI is triggered by a push to a branch/tag) | ||
# and head_ref (available when CI is triggered by a PR). | ||
group: "${{ github.ref_name }}-${{ github.head_ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
linting-and-tests: | ||
name: Linting and tests | ||
uses: ./.github/workflows/linting-and-tests.yml |
Oops, something went wrong.