From 3615479be522e9f78cf42c7c64061f830927d1b0 Mon Sep 17 00:00:00 2001 From: Kaloyan Raev Date: Wed, 5 Oct 2016 11:03:46 +0300 Subject: [PATCH] Zend stack and project sample (#2700) ### What does this PR do? Adds a stack with [Zend Server](http://www.zend.com/en/products/zend_server), based on the [official docker image](https://hub.docker.com/r/_/php-zendserver/). Zend Server is a professional and certified PHP distribution. The docker image includes a free trial Developer license. Also adds a project sample of the [Astro Splash](https://github.com/kaloyan-raev/AstroSplash) application, which is a demo app based on the [Zend Expressive](https://zendframework.github.io/zend-expressive/) framework. After creating a workspace with these stack and template the user must: 1. Execute the `configure` command. 2. Execute the `restart zend server` command. 3. Click on the preview link generated by the `restart zend server` command. ### What issues does this PR fix or reference? - PHP support #2590 ### New behavior - New stack with Zend Server. - New project sample: Astro Splash demo app, based on Zend Expressive. --- .../src/main/resources/images/type-zend.svg | 70 +++++++++++++++ .../src/main/resources/stacks.json | 87 +++++++++++++++++++ .../src/main/resources/samples.json | 51 +++++++++++ 3 files changed, 208 insertions(+) create mode 100644 ide/che-core-ide-stacks/src/main/resources/images/type-zend.svg diff --git a/ide/che-core-ide-stacks/src/main/resources/images/type-zend.svg b/ide/che-core-ide-stacks/src/main/resources/images/type-zend.svg new file mode 100644 index 00000000000..3ce9e2bcbf6 --- /dev/null +++ b/ide/che-core-ide-stacks/src/main/resources/images/type-zend.svg @@ -0,0 +1,70 @@ + + + + Zend logo + + + + + + image/svg+xml + + Zend logo + + + + + + + diff --git a/ide/che-core-ide-stacks/src/main/resources/stacks.json b/ide/che-core-ide-stacks/src/main/resources/stacks.json index 6bb75dc668b..9b38f56ed43 100644 --- a/ide/che-core-ide-stacks/src/main/resources/stacks.json +++ b/ide/che-core-ide-stacks/src/main/resources/stacks.json @@ -1928,5 +1928,92 @@ "name": "type-bitnami.svg", "mediaType": "image/svg+xml" } + }, + { + "id": "zend", + "creator": "ide", + "name": "Zend", + "description": "Zend stack with PHP 7, Zend Server 9 and Z-Ray.", + "scope": "advanced", + "tags": [ + "PHP", + "Zend", + "Z-Ray", + "Composer", + "Ubuntu", + "Git" + ], + "components": [ + { + "name": "PHP", + "version": "7.0.6" + }, + { + "name": "Zend Server", + "version": "9.0.0" + }, + { + "name": "Composer", + "version": "---" + } + ], + "source": { + "type": "image", + "origin": "kaloyanraev/che-zendserver" + }, + "workspaceConfig": { + "environments": { + "default": { + "machines": { + "dev-machine": { + "agents": [ + "org.eclipse.che.terminal", "org.eclipse.che.ws-agent", "org.eclipse.che.ssh", "org.eclipse.che.ls.php", "org.eclipse.che.ls.json" + ], + "servers": {}, + "attributes" : { + "memoryLimitBytes": "2147483648" + } + } + }, + "recipe": { + "location": "kaloyanraev/che-zendserver", + "type": "dockerimage" + } + } + }, + "name": "default", + "defaultEnv": "default", + "description": null, + "commands": [ + { + "name": "restart zend server", + "type": "custom", + "commandLine": "sudo sed -i 's#zray.zendserver_ui_url=.*#zray.zendserver_ui_url=http://${server.port.10081}/ZendServer#g' /usr/local/zend/etc/conf.d/zray.ini && sudo /usr/local/zend/bin/zendctl.sh restart", + "attributes": { + "previewUrl": "http://${server.port.80}" + } + }, + { + "name": "stop zend server", + "type": "custom", + "commandLine": "sudo /usr/local/zend/bin/zendctl.sh stop", + "attributes": { + "previewUrl": "" + } + }, + { + "name": "show admin password", + "type": "custom", + "commandLine": "echo \"Zend Server admin password is `sudo cat /root/zend-password`\"", + "attributes": { + "previewUrl": "http://${server.port.10081}" + } + } + ] + }, + "stackIcon": { + "name": "type-zend.svg", + "mediaType": "image/svg+xml" + } } ] diff --git a/ide/che-core-ide-templates/src/main/resources/samples.json b/ide/che-core-ide-templates/src/main/resources/samples.json index e7a0423123b..d362d74a783 100644 --- a/ide/che-core-ide-templates/src/main/resources/samples.json +++ b/ide/che-core-ide-templates/src/main/resources/samples.json @@ -1260,5 +1260,56 @@ "tags": [ "Play" ] + }, + { + "name": "astro-splash", + "displayName": "astro-splash", + "path": "/astro-splash", + "description": "An app that uses the Astronomy Picture of the Day API provided by NASA and the Zend Expressive framework.", + "projectType": "php", + "mixins": [], + "attributes": { + "language": [ + "php" + ] + }, + "modules": [], + "problems": [], + "source": { + "type": "git", + "location": "https://github.com/kaloyan-raev/AstroSplash.git", + "parameters": {} + }, + "commands": [ + { + "name": "configure", + "type": "custom", + "commandLine": "chmod 777 ${current.project.path}/data; echo -e \"\n DocumentRoot ${current.project.path}/public\n SetEnv APPLICATION_ENV 'development'\n \n DirectoryIndex index.php\n AllowOverride All\n Require all granted\n \n\" | sudo tee /etc/apache2/sites-available/000-default.conf; composer --working-dir=${current.project.path} install && cp /usr/local/zend/etc/php.ini /tmp/update-php.ini && grep -q 'extension=pcntl.so' /tmp/update-php.ini || echo -e \"\nextension=pcntl.so\" | sudo tee -a /tmp/update-php.ini && php -c /tmp/update-php.ini ${current.project.path}/bin/update.php && rm /tmp/update-php.ini", + "attributes": { + "previewUrl": "" + } + }, + { + "name": "update images", + "type": "custom", + "commandLine": "cp /usr/local/zend/etc/php.ini /tmp/update-php.ini && grep -q 'extension=pcntl.so' /tmp/update-php.ini || echo -e \"\nextension=pcntl.so\" | sudo tee -a /tmp/update-php.ini && php -c /tmp/update-php.ini ${current.project.path}/bin/update.php && rm /tmp/update-php.ini", + "attributes": { + "previewUrl": "" + } + }, + { + "name": "clean doctrine cache", + "type": "custom", + "commandLine": "sudo rm -rf ${current.project.path}/data/doctrine-cache", + "attributes": { + "previewUrl": "" + } + } + ], + "links": [], + "category": "Samples", + "tags": [ + "Zend" + ] } ]