Skip to content
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
22 changes: 0 additions & 22 deletions .chglog/CHANGELOG.tpl.md

This file was deleted.

30 changes: 0 additions & 30 deletions .chglog/config.yml

This file was deleted.

38 changes: 15 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,31 @@ jobs:
with:
ref: main
fetch-depth: 0

- name: Bump version and push tag
uses: anothrNick/github-tag-action@1.64.0
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
WITH_V: false

- name: Set up Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"

- name: Install git-chglog
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install dependencies
run: |
curl -LO https://github.com/git-chglog/git-chglog/releases/download/v0.15.4/git-chglog_0.15.4_linux_386.tar.gz
tar -xzf git-chglog_0.15.4_linux_386.tar.gz
chmod +x git-chglog
sudo mv git-chglog /usr/local/bin/
git-chglog --version
python -m pip install --upgrade pip
pip install poetry git-changelog

- name: Generate HISTORY.md
run: |
git-chglog -o HISTORY.md
git-changelog > HISTORY.md
cat HISTORY.md

- name: Commit and Push
Expand All @@ -57,22 +65,6 @@ jobs:
git push
fi

- name: Bump version and push tag
uses: anothrNick/github-tag-action@1.64.0
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
WITH_V: false

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry

- name: Git details about version
id: git-details
env:
Expand Down
14 changes: 14 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,20 @@ This recipe does the following:
cortex catalog descriptor -y -t ${entity} | yq "with(.info.x-cortex-owners[]; select(.type | downcase == \"group\") | select(.provider == null) | .provider = \"${provider}\" )" | cortex catalog create -f-
done

-----------------------------------------------------------------------------
Export all workflows
-----------------------------------------------------------------------------

This recipe creates YAML files for each Workflow. This may be helpful if you are considering enabling GitOps for Workflows and you want to export current Workflows as a starting point.

.. code:: bash

for workflow in `cortex workflows list --csv --no-headers --columns tag`
do
echo "workflow = $workflow"
cortex workflows get --tag $workflow --yaml > $workflow.yaml
done

-----------------------------------------------------------------------------
Obfuscating a Cortex export
-----------------------------------------------------------------------------
Expand Down
24 changes: 15 additions & 9 deletions cortexapps_cli/commands/integrations_commands/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
@app.command()
def add(
ctx: typer.Context,
alias: str = typer.Option(..., "--alias", "-a", help="Alias for this configuration"),
api_key: str = typer.Option(..., "--api-key", "-api", help="API key"),
alias: str = typer.Option(None, "--alias", "-a", help="Alias for this configuration"),
host: str = typer.Option(None, "--host", "-h", help="Optional host name"),
username: str = typer.Option(None, "--username", "-u", help="username"),
password: str = typer.Option(None, "--password", "-p", help="password"),
tenant_id: str = typer.Option(None, "--tenant", "-t", help="Optional tenant id"),
is_default: bool = typer.Option(False, "--is-default", "-i", help="If this is the default configuration"),
file_input: Annotated[typer.FileText, typer.Option("--file", "-f", help="JSON file containing configurations, if command line options not used; can be passed as stdin with -, example: -f-")] = None,
):
Expand All @@ -21,19 +23,23 @@ def add(
client = ctx.obj["client"]

if file_input:
if alias or api_key or is_default or host:
raise typer.BadParameter("When providing a custom event definition file, do not specify any other custom event attributes")
if alias or host or username or password or tenant_id or is_default:
raise typer.BadParameter("When providing a prometheus definition file, do not specify any other attributes")
data = json.loads("".join([line for line in file_input]))
else:

data = {
"alias": alias,
"apiKey": api_key,
"host": host,
"isDefault": is_default,
"username": username,
"password": password,
"tenant_id": tenant_id,
"is_default": is_default
}

# remove any data elements that are None - can only be is_default
data = {k: v for k, v in data.items() if v is not None}
for k, v in data.items():
if v is None:
raise typer.BadParameter("Missing required parameter: " + k)

r = client.post("api/v1/prometheus/configuration", data=data)
print_json(data=r)
Expand All @@ -51,7 +57,7 @@ def add_multiple(

data = json.loads("".join([line for line in file_input]))

r = client.put("api/v1/aws/configurations", data=data)
r = client.put("api/v1/prometheus/configurations", data=data)
print_json(data=r)

@app.command()
Expand Down
Loading