Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
7822cc5163 | |||
4123277eb7 | |||
5d17a75e7e | |||
1db7232951 | |||
6a14f2cec8 | |||
085fa252f3 | |||
aa23e07221 | |||
263395c04c | |||
7b6023c869 | |||
|
9379e72199 | ||
67ed612dc9 | |||
3e727f0348 | |||
dd658be7ef | |||
0322030e57 | |||
16d7f4b52f | |||
12ed365dff | |||
1b9c4ac14b |
@ -3,12 +3,12 @@ name: ci
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- "*"
|
||||
tags:
|
||||
- '*'
|
||||
- "*"
|
||||
pull_request:
|
||||
branches:
|
||||
- 'main'
|
||||
- "main"
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
@ -18,6 +18,7 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
@ -29,17 +30,19 @@ jobs:
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
- name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
|
||||
- name: Login to registry
|
||||
if: github.ref_type == 'tag'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.sebclem.fr
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
push: ${{ github.ref_type == 'tag' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
@ -1,4 +1,4 @@
|
||||
FROM python:3
|
||||
FROM python:3.12.6
|
||||
|
||||
WORKDIR /usr/src/huwawei_lte_exporter
|
||||
|
||||
|
@ -54,7 +54,7 @@ def prom_exporter():
|
||||
response.append('#HELP '+attribute+' '+info['help'])
|
||||
response.append('#TYPE '+attribute+' '+info['type'])
|
||||
response.append(attribute+'{'+info['device']+'} '+info['value'])
|
||||
|
||||
client.user.logout()
|
||||
return '\n'.join(response)
|
||||
|
||||
|
||||
@ -76,8 +76,6 @@ config = configparser.ConfigParser()
|
||||
config.read('huwawei_lte_exporter.ini')
|
||||
MANDATORY_ENV_VARS = ["ROUTER_ADDRESS", "ROUTER_USER", "ROUTER_PASS", "PROM_PORT"]
|
||||
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:
|
||||
config['DEFAULT'][var] = os.environ[var]
|
||||
|
||||
|
5
huwawei_lte_exporter.ini
Normal file
5
huwawei_lte_exporter.ini
Normal file
@ -0,0 +1,5 @@
|
||||
[DEFAULT]
|
||||
ROUTER_ADDRESS=192.168.1.1
|
||||
ROUTER_USER=admin
|
||||
ROUTER_PASS=admin
|
||||
PROM_PORT=8080
|
7
renovate.json
Normal file
7
renovate.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:base"
|
||||
],
|
||||
"commitMessagePrefix": ":arrow_up:"
|
||||
}
|
Loading…
Reference in New Issue
Block a user