Page MenuHomeDevCentral

Fetch and extract released PHP source code
ClosedPublic

Authored by dereckson on Oct 16 2018, 23:12.

Details

Summary

A PHP custom build starts with some source code.

When the build is for a released version, it's as simple as
decompress an archive. Version and hash in pillar.

As Jinja doesn't support dictionary expansion, the pure
Python state renderer is used here, to see if it's viable
to avoid the proliferation of read-pillar execution modules.

Ref T1469

Test Plan

salt-call --local state.sls roles/webserver-legacy/php-builder

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

dereckson requested review of this revision.Oct 16 2018, 23:12
dereckson created this revision.
dereckson updated this revision to Diff 4896.Oct 16 2018, 23:16

Remove .sls

dereckson updated this revision to Diff 4897.Oct 17 2018, 11:55

Extract an unique set of versions from pillar

dereckson retitled this revision from Extract PHP source code from releases to Fetch and extract released PHP source code.Oct 17 2018, 11:55
dereckson updated this revision to Diff 4898.Oct 17 2018, 12:01

More coherent presentation

dereckson updated this revision to Diff 4899.Oct 17 2018, 12:08

Hey, jinja doesn't like multiline

dereckson updated this revision to Diff 4900.Oct 17 2018, 12:09

Set in php_realase_versions

dereckson updated this revision to Diff 4901.Oct 17 2018, 12:16

Fix Python datastructures

dereckson updated this revision to Diff 4902.Oct 17 2018, 13:30

Switch to Python renderer

dereckson edited the summary of this revision. (Show Details)Oct 17 2018, 13:40
dereckson updated this revision to Diff 4903.Oct 17 2018, 16:22

Extract archives

dereckson accepted this revision.Oct 17 2018, 16:22
This revision is now accepted and ready to land.Oct 17 2018, 16:22
$ utils/dump-py-state.py roles/webserver-legacy/php-builder/source.sls
/opt/php:
  file.directory:
  - user: builder
/opt/php/archives:
  file.directory:
  - user: builder
/opt/php/archives/php-5.6.38.tar.bz2:
  file.managed:
  - source: http://fr2.php.net/get/php-5.6.38.tar.bz2/from/this/mirror
  - source_hash: d65b231bbdd63be4439ef5ced965cfd63e62983429dbd4dfcfb49981593ebc03
  - user: builder
/opt/php/php56:
  file.directory:
  - user: builder
php_build_php56:
  cmd.run:
  - name: tar xjf /opt/php/archives/php-5.6.38.tar.bz2 --strip-components=1 -C /opt/php/php56
  - user: builder
  - creates: /opt/php/php56/configure.in
This revision was automatically updated to reflect the committed changes.