Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3792091
D1937.id4902.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D1937.id4902.diff
View Options
diff --git a/pillar/webserver/sites.sls b/pillar/webserver/sites.sls
--- a/pillar/webserver/sites.sls
+++ b/pillar/webserver/sites.sls
@@ -58,6 +58,12 @@
# Username must be unique and use max 31 characters.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+php_custom_builds:
+ php56:
+ mode: release
+ version: 5.6.38
+ hash: d65b231bbdd63be4439ef5ced965cfd63e62983429dbd4dfcfb49981593ebc03
+
php_fpm_instances:
# PHP 7.2, generally installed as package/port
prod:
diff --git a/roles/webserver-legacy/php-builder/init.sls b/roles/webserver-legacy/php-builder/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/webserver-legacy/php-builder/init.sls
@@ -0,0 +1,10 @@
+# -------------------------------------------------------------
+# Salt — Compile custom PHP builds
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2018-10-16
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+include:
+ - .source
diff --git a/roles/webserver-legacy/php-builder/source.sls b/roles/webserver-legacy/php-builder/source.sls
new file mode 100644
--- /dev/null
+++ b/roles/webserver-legacy/php-builder/source.sls
@@ -0,0 +1,57 @@
+#!py
+
+# -------------------------------------------------------------
+# Salt — Compile custom PHP builds
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2018-10-16
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Builds and versions helper methods
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+
+def get_release_builds():
+ return {name: build
+ for (name, build) in __pillar__["php_custom_builds"].items()
+ if build["mode"] == "release"}
+
+
+def get_release_versions():
+ versions = [(build['version'], build['hash'])
+ for build in get_release_builds().values()]
+
+ return set(versions)
+
+
+# -------------------------------------------------------------
+# Configuration provider
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+
+def run():
+ config = {}
+
+ builder_user = 'builder'
+ directories_to_create = ['/opt/php', '/opt/php/archives']
+
+ # Task: create directories
+ for directory in directories_to_create:
+ config[directory] = {'file.directory': [{'user': builder_user}]}
+
+ # Task: fetch archives
+ for version, archive_hash in get_release_versions():
+ archive = "/opt/php/archives/php-" + version + ".tar.bz2"
+ url = "http://fr2.php.net/get/php-" + version + ".tar.bz2/from/this/mirror"
+
+ config[archive] = {'file.managed': [
+ {'source': url},
+ {'source_hash': archive_hash},
+ {'user': builder_user},
+ ]}
+
+ # Task: extract archives to
+
+ return config
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 28, 15:19 (9 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2269257
Default Alt Text
D1937.id4902.diff (3 KB)
Attached To
Mode
D1937: Fetch and extract released PHP source code
Attached
Detach File
Event Timeline
Log In to Comment