crossfinger

This commit is contained in:
PAPAMICA
2022-05-10 15:29:19 +02:00
parent 520554cbea
commit feae4b1712
6 changed files with 86 additions and 76 deletions

View File

@@ -5,8 +5,8 @@ name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
#push:
# branches: [ automation-template ]
push:
branches: [ automation-template ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

View File

@@ -16,41 +16,51 @@ result["templates"] = []
templates = []
for filename in glob.glob("*.y*ml"):
data = []
dataset = {}
repository = {}
env = []
categories = []
file = open(filename)
for line in file.readlines():
if re.search('#&', line):
data=line[3:-1].split(': ', 1)
if data[0] == "categories":
categories = data[1].split(', ')
dataset[data[0]] = categories
else:
dataset[data[0]] = data[1]
if re.search('#%', line):
envtemp = {}
dataenv=line[3:-1].split(': ', 1)
envtemp["name"] = dataenv[0]
envtemp["label"] = dataenv[1]
env.append(envtemp)
if data:
repository = {
"url": GITHUB_REPOSITORY_URL,
"stackfile": filename
}
dataset["repository"] = repository
dataset["env"] = env
templates.append(dataset)
#else:
#print (f"{filename} not updated !")
try:
data = []
dataset = {}
repository = {}
env = []
categories = []
file = open(filename)
for line in file.readlines():
if re.search('#&', line):
data=line[3:-1].split(': ', 1)
if data[0] == "type":
type_=int(data[1])
dataset[data[0]] = type_
elif data[0] == "categories":
categories = data[1].split(', ')
dataset[data[0]] = categories
else:
dataset[data[0]] = data[1]
if re.search('#%', line):
envtemp = {}
dataenv=line[3:-1].split(': ', 1)
envtemp["name"] = dataenv[0]
envtemp["label"] = dataenv[1]
env.append(envtemp)
if data:
repository = {
"url": GITHUB_REPOSITORY_URL,
"stackfile": filename
}
dataset["repository"] = repository
#dataset["type"] = 3
dataset["env"] = env
templates.append(dataset)
print (f"{filename} ")
else:
print (f" 🚸 {filename} not updated !")
except:
print (f"{filename} error !")
result["templates"] = templates
json_data = json.dumps(result, indent=4)
with open('templates-portainer.json', 'w') as outfile:
outfile.write(json_data)
print ("File generated !")
try:
result["templates"] = templates
json_data = json.dumps(result, indent=4)
with open('templates-portainer.json', 'w') as outfile:
outfile.write(json_data)
print ("\nFile generated !")
except:
print (" ❌ Error when generate !")

View File

@@ -35,40 +35,6 @@
}
]
},
{
"type": 3,
"title": "Website HTML PHP 3",
"description": "Simple HTML website under PHP 7.4",
"note": "Website: <a href='https://github.com/LavoWeb/Docker' target='_blank' rel='noopener'>Github.com</a>",
"categories": [
"SelfHosted",
"PAPAMICA"
],
"platform": "linux",
"logo": "http://assets.stickpng.com/thumbs/5847f5bdcef1014c0b5e489c.png",
"repository": {
"url": "https://github.com/PAPAMICA/docker-compose-collection",
"stackfile": "website-html copy 2.yml"
},
"env": [
{
"name": "SERVICE",
"label": "name of the service (no spaces or points)"
},
{
"name": "DATA_LOCATION",
"label": "data localization (example: /apps/service)"
},
{
"name": "URL",
"label": "service link (example: service.papamica.fr or service.com)"
},
{
"name": "NETWORK",
"label": "your Traefik network (example: proxy)"
}
]
},
{
"type": 3,
"title": "Website HTML PHP 2",
@@ -102,6 +68,40 @@
"label": "your Traefik network (example: proxy)"
}
]
},
{
"type": 3,
"title": "Website HTML PHP 3",
"description": "Simple HTML website under PHP 7.4",
"note": "Website: <a href='https://github.com/LavoWeb/Docker' target='_blank' rel='noopener'>Github.com</a>",
"categories": [
"SelfHosted",
"PAPAMICA"
],
"platform": "linux",
"logo": "http://assets.stickpng.com/thumbs/5847f5bdcef1014c0b5e489c.png",
"repository": {
"url": "https://github.com/PAPAMICA/docker-compose-collection",
"stackfile": "website-html copy 2.yml"
},
"env": [
{
"name": "SERVICE",
"label": "name of the service (no spaces or points)"
},
{
"name": "DATA_LOCATION",
"label": "data localization (example: /apps/service)"
},
{
"name": "URL",
"label": "service link (example: service.papamica.fr or service.com)"
},
{
"name": "NETWORK",
"label": "your Traefik network (example: proxy)"
}
]
}
]
}

View File

@@ -4,7 +4,7 @@
#& type: 3
#& title: Website HTML PHP 3
#& description: Simple HTML website under PHP 7.4
# note: Website: <a href='https://github.com/LavoWeb/Docker' target='_blank' rel='noopener'>Github.com</a>
#& note: Website: <a href='https://github.com/LavoWeb/Docker' target='_blank' rel='noopener'>Github.com</a>
#& categories: SelfHosted, PAPAMICA
#& platform: linux
#& logo: http://assets.stickpng.com/thumbs/5847f5bdcef1014c0b5e489c.png

View File

@@ -4,7 +4,7 @@
#& type: 3
#& title: Website HTML PHP 2
#& description: Simple HTML website under PHP 7.4
# note: Website: <a href='https://github.com/LavoWeb/Docker' target='_blank' rel='noopener'>Github.com</a>
#& note: Website: <a href='https://github.com/LavoWeb/Docker' target='_blank' rel='noopener'>Github.com</a>
#& categories: SelfHosted, PAPAMICA
#& platform: linux
#& logo: http://assets.stickpng.com/thumbs/5847f5bdcef1014c0b5e489c.png

View File

@@ -4,7 +4,7 @@
#& type: 3
#& title: Website HTML PHP
#& description: Simple HTML website under PHP 7.4
# note: Website: <a href='https://github.com/LavoWeb/Docker' target='_blank' rel='noopener'>Github.com</a>
#& note: Website: <a href='https://github.com/LavoWeb/Docker' target='_blank' rel='noopener'>Github.com</a>
#& categories: SelfHosted, PAPAMICA
#& platform: linux
#& logo: http://assets.stickpng.com/thumbs/5847f5bdcef1014c0b5e489c.png