Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F4006510
D1534.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D1534.diff
View Options
diff --git a/roles/devserver/userland-software/files/ast.ini b/roles/devserver/userland-software/files/ast.ini
new file mode 100644
--- /dev/null
+++ b/roles/devserver/userland-software/files/ast.ini
@@ -0,0 +1,16 @@
+; -------------------------------------------------------------
+; PHP configuration
+; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+; Project: Nasqueron
+; License: Trivial work, not eligible to copyright
+; Source file: roles/devserver/userland-software/files/ast.ini
+; -------------------------------------------------------------
+;
+; <auto-generated>
+; This file is managed by our rOPS SaltStack repository.
+;
+; Changes to this file may cause incorrect behavior
+; and will be lost if the state is redeployed.
+; </auto-generated>
+
+extension=ast.so
diff --git a/roles/devserver/userland-software/files/install-php-extension.sh b/roles/devserver/userland-software/files/install-php-extension.sh
new file mode 100644
--- /dev/null
+++ b/roles/devserver/userland-software/files/install-php-extension.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# -------------------------------------------------------------
+# Intall PHP extension
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Author: Sébastien Santoro aka Dereckson
+# Created: 2018-03-29
+# License: BSD-2-Clause
+# Source file: roles/devserver/userland-software/files/install-php-extension.sh
+# -------------------------------------------------------------
+
+phpize
+./configure
+make
diff --git a/roles/devserver/userland-software/init.sls b/roles/devserver/userland-software/init.sls
--- a/roles/devserver/userland-software/init.sls
+++ b/roles/devserver/userland-software/init.sls
@@ -18,5 +18,6 @@
- .misc
- .notifications
- .phabricator
+ . .php-ast
- .psysh
- .wordpress
diff --git a/roles/devserver/userland-software/map.jinja b/roles/devserver/userland-software/map.jinja
new file mode 100644
--- /dev/null
+++ b/roles/devserver/userland-software/map.jinja
@@ -0,0 +1,20 @@
+# -------------------------------------------------------------
+# Salt — Provision dev software
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2018-03-29
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% set php = salt['grains.filter_by']({
+ 'Debian': {
+ 'current_api': '20170718',
+ 'extension_dir': '/usr/lib/php/20170718',
+ 'cli_conf_dir': '/etc/php/7.2/cli/conf.d/',
+ },
+ 'FreeBSD' : {
+ 'current_api': '20170718',
+ 'extension_dir': '/usr/local/lib/php/20170718',
+ 'cli_conf_dir': '/usr/local/etc/php/',
+ },
+}, default='Debian') %}
diff --git a/roles/devserver/userland-software/php-ast.sls b/roles/devserver/userland-software/php-ast.sls
new file mode 100644
--- /dev/null
+++ b/roles/devserver/userland-software/php-ast.sls
@@ -0,0 +1,48 @@
+# -------------------------------------------------------------
+# Salt — Provision dev software
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2018-03-29
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "roles/devserver/userland-software/map.jinja" import php with context %}
+
+# -------------------------------------------------------------
+# Fetch software
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/opt/php-ast:
+ file.directory:
+ - user: builder
+
+php_ast_repository:
+ git.latest:
+ - name: https://github.com/nikic/php-ast.git
+ - target: /opt/php-ast
+ - user: builder
+
+# -------------------------------------------------------------
+# Build software
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+php_ast_build:
+ cmd.script:
+ - source: salt://roles/devserver/userland-software/files/install-php-extension.sh
+ - cwd: /opt/php-ast
+ - runas: builder
+ - creates: /opt/php-ast/modules/ast.so
+
+php_ast_install:
+ cmd.run:
+ - name: make install
+ - cwd: /opt/php-ast
+ - creates: {{ php.extension_dir }}/ast.so
+
+# -------------------------------------------------------------
+# PHP configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{{ php.cli_conf_dir }}/ext-40-ast.ini:
+ file.managed:
+ - source: salt://roles/devserver/userland-software/files/ast.ini
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 16, 12:07 (20 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2352901
Default Alt Text
D1534.diff (4 KB)
Attached To
Mode
D1534: Install php-ast on devserver role
Attached
Detach File
Event Timeline
Log In to Comment