feat: SugarCRM 6.5.26 CE - Docker + compose + CI/CD
Some checks failed
Docker Build & Push SugarCRM 6.5 CE / build-and-push (push) Has been cancelled
Some checks failed
Docker Build & Push SugarCRM 6.5 CE / build-and-push (push) Has been cancelled
- PHP 5.6 Apache Dockerfile (Debian Jessie, archive repos) - Source from bklein01/sugarcrm GitHub mirror - MySQL 5.7 database with healthcheck - Silent install via init.sh (AdminWizard disabled) - REST v4.1 API test script (test_api.py) - Gitea Actions CI/CD for registry push - Full README with API docs and pitfall notes
This commit is contained in:
41
envtemplate.py
Normal file
41
envtemplate.py
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env python
|
||||
import os, sys, getopt
|
||||
from string import Template
|
||||
|
||||
def main(argv):
|
||||
inputfile = ''
|
||||
outputfile = ''
|
||||
try:
|
||||
opts, args = getopt.getopt(argv,"hi:o:",["ifile=","ofile="])
|
||||
except getopt.GetoptError:
|
||||
print 'envtemplate.py -i <inputfile> -o <outputfile>'
|
||||
sys.exit(2)
|
||||
for opt, arg in opts:
|
||||
if opt == '-h':
|
||||
print 'envtemplate.py -i <inputfile> -o <outputfile>'
|
||||
sys.exit()
|
||||
elif opt in ("-i", "--ifile"):
|
||||
inputfile = arg
|
||||
elif opt in ("-o", "--ofile"):
|
||||
outputfile = arg
|
||||
|
||||
# Populate case-insensitive env var dictionary
|
||||
values = dict()
|
||||
for k in os.environ:
|
||||
v = os.environ.get(k)
|
||||
values[k] = v
|
||||
values[k.lower()] = v
|
||||
|
||||
# Read template and substitute
|
||||
with open(inputfile) as f:
|
||||
templatestr = f.read()
|
||||
|
||||
out = Template(templatestr).substitute(values)
|
||||
|
||||
print "Writing output to {}".format(outputfile)
|
||||
|
||||
with open(outputfile, "w") as f:
|
||||
f.write(out)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv[1:])
|
||||
Reference in New Issue
Block a user