Compare commits
No commits in common. "main" and "1.0.1" have entirely different histories.
@ -3,12 +3,12 @@ name: ci
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "*"
|
||||
- 'main'
|
||||
tags:
|
||||
- "*"
|
||||
- '*'
|
||||
pull_request:
|
||||
branches:
|
||||
- "main"
|
||||
- 'main'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
@ -18,31 +18,28 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
git.sebclem.fr/${{ gitea.repository }}
|
||||
git.sebclem.fr/${{ gitea.repository }}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
|
||||
- name: Login to registry
|
||||
if: github.ref_type == 'tag'
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
- name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
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@v6
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.ref_type == 'tag' }}
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
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
|
||||
|
||||
|
@ -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,6 +76,8 @@ 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]
|
||||
|
||||
|
@ -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