Compare commits
No commits in common. "main" and "1.0.1" have entirely different histories.
@ -3,12 +3,12 @@ name: ci
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "*"
|
- 'main'
|
||||||
tags:
|
tags:
|
||||||
- "*"
|
- '*'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- "main"
|
- 'main'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
@ -18,31 +18,28 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
git.sebclem.fr/${{ gitea.repository }}
|
git.sebclem.fr/${{ gitea.repository }}
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
- name: Login to DockerHub
|
||||||
- name: Login to registry
|
if: github.event_name != 'pull_request'
|
||||||
if: github.ref_type == 'tag'
|
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: git.sebclem.fr
|
registry: git.sebclem.fr
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: ${{ github.ref_type == 'tag' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
@ -1,4 +1,4 @@
|
|||||||
FROM python:3.12.5
|
FROM python:3
|
||||||
|
|
||||||
WORKDIR /usr/src/huwawei_lte_exporter
|
WORKDIR /usr/src/huwawei_lte_exporter
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ def prom_exporter():
|
|||||||
response.append('#HELP '+attribute+' '+info['help'])
|
response.append('#HELP '+attribute+' '+info['help'])
|
||||||
response.append('#TYPE '+attribute+' '+info['type'])
|
response.append('#TYPE '+attribute+' '+info['type'])
|
||||||
response.append(attribute+'{'+info['device']+'} '+info['value'])
|
response.append(attribute+'{'+info['device']+'} '+info['value'])
|
||||||
client.user.logout()
|
|
||||||
return '\n'.join(response)
|
return '\n'.join(response)
|
||||||
|
|
||||||
|
|
||||||
@ -76,6 +76,8 @@ config = configparser.ConfigParser()
|
|||||||
config.read('huwawei_lte_exporter.ini')
|
config.read('huwawei_lte_exporter.ini')
|
||||||
MANDATORY_ENV_VARS = ["ROUTER_ADDRESS", "ROUTER_USER", "ROUTER_PASS", "PROM_PORT"]
|
MANDATORY_ENV_VARS = ["ROUTER_ADDRESS", "ROUTER_USER", "ROUTER_PASS", "PROM_PORT"]
|
||||||
for var in MANDATORY_ENV_VARS:
|
for var in MANDATORY_ENV_VARS:
|
||||||
|
if not config.has_option('DEFAULT', var):
|
||||||
|
raise EnvironmentError("Failed because {} is not set.".format(var))
|
||||||
if var in os.environ:
|
if var in os.environ:
|
||||||
config['DEFAULT'][var] = os.environ[var]
|
config['DEFAULT'][var] = os.environ[var]
|
||||||
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
||||||
"extends": [
|
|
||||||
"config:base"
|
|
||||||
],
|
|
||||||
"commitMessagePrefix": ":arrow_up:"
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user