Compare commits
9
Commits
73f92406c6
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0604758bf | ||
|
|
2767a71e5c | ||
|
|
01c3cd9d8e | ||
|
|
82e33f502a | ||
|
|
23da31d247 | ||
|
|
99a9fb63a6 | ||
|
|
cae1fab1f6 | ||
|
|
a4376d499f | ||
|
|
bfd91178e1 |
@@ -35,6 +35,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: gitea.tryton.geeraert.eu/pi-ux-ce/dyndns_python:latest
|
tags: gitea.tryton.geeraert.eu/pi-ux-ce/dyndns_python:latest
|
||||||
|
cache-from: type=registry,ref=gitea.tryton.geeraert.eu/pi-ux-ce/dyndns_python:buildcache
|
||||||
|
cache-to: type=registry,ref=gitea.tryton.geeraert.eu/pi-ux-ce/dyndns_python:buildcache,mode=max
|
||||||
|
|
||||||
|
|
||||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||||
|
|||||||
@@ -5,16 +5,6 @@ metadata:
|
|||||||
---
|
---
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: CronJob
|
kind: CronJob
|
||||||
spec:
|
|
||||||
affinity:
|
|
||||||
nodeAffinity:
|
|
||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
|
||||||
nodeSelectorTerms:
|
|
||||||
- matchFields:
|
|
||||||
- key: metadata.name
|
|
||||||
operator: In
|
|
||||||
values:
|
|
||||||
- kube-master
|
|
||||||
metadata:
|
metadata:
|
||||||
name: dyndns-pythonrenew
|
name: dyndns-pythonrenew
|
||||||
namespace: dyndns-python
|
namespace: dyndns-python
|
||||||
@@ -23,10 +13,12 @@ spec:
|
|||||||
jobTemplate:
|
jobTemplate:
|
||||||
spec:
|
spec:
|
||||||
ttlSecondsAfterFinished: 100
|
ttlSecondsAfterFinished: 100
|
||||||
|
backoffLimit: 4
|
||||||
template:
|
template:
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: dyndns-python
|
- name: dyndns-python
|
||||||
image: gitea.tryton.geeraert.eu/pi-ux-ce/dyndns_python:latest
|
image: gitea.tryton.geeraert.eu/pi-ux-ce/dyndns_python:latest
|
||||||
restartPolicy: Never
|
imagePullPolicy: IfNotPresent
|
||||||
|
restartPolicy: OnFailure
|
||||||
|
|
||||||
|
|||||||
+8
-1
@@ -30,15 +30,22 @@ def update_zone(subdomain,new_ip,domain_id):
|
|||||||
result = client.put('/domain/zone/'+new_domain+'/dynHost/record/'+domain_id,
|
result = client.put('/domain/zone/'+new_domain+'/dynHost/record/'+domain_id,
|
||||||
ip=new_ip,
|
ip=new_ip,
|
||||||
subDomain=subdomain)
|
subDomain=subdomain)
|
||||||
|
print("Zone updated")
|
||||||
refresh_dns()
|
refresh_dns()
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def refresh_dns():
|
def refresh_dns():
|
||||||
result_refresh = client.post('/domain/zone/'+new_domain+'/refresh')
|
result_refresh = client.post('/domain/zone/'+new_domain+'/refresh')
|
||||||
|
print("DNS refreshed")
|
||||||
return result_refresh
|
return result_refresh
|
||||||
|
|
||||||
def MyIP():
|
def MyIP():
|
||||||
response = requests.get('https://ifconfig.me/ip')
|
response = requests.get('https://ifconfig.me/ip')
|
||||||
|
print("Current IP: "+response.text)
|
||||||
return response.text
|
return response.text
|
||||||
|
|
||||||
result_update = update_zone(new_subdomain,MyIP(),str(Domain_id()[0]))
|
try:
|
||||||
|
result_update = update_zone(new_subdomain,MyIP(),str(Domain_id()[0]))
|
||||||
|
except:
|
||||||
|
raise
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
FROM python:3
|
FROM python:3
|
||||||
|
|
||||||
|
MAINTAINER pi-ux-ce
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
COPY requirements.txt ./
|
COPY requirements.txt ./
|
||||||
|
RUN pip install --upgrade pip
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
Reference in New Issue
Block a user