Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PHP and PHP + MySQL Che-7 stacks with samples #13434

Merged
merged 2 commits into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 161 additions & 0 deletions ide/che-core-ide-stacks/src/main/resources/stacks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2944,5 +2944,166 @@
"name": "type-che7.svg",
"mediaType": "image/svg+xml"
}
},
{
"id": "php",
"name": "PHP with Theia IDE",
"creator": "Valerii Svydenko",
"tags": [
"Theia",
"Debian",
"PHP",
"Apache"
],
"scope": "general",
"description": "Default PHP Stack with PHP 7.1 and Theia IDE",
"components": [
{
"version": "9",
"name": "Debian"
},
{
"version": "7.1.29",
"name": "PHP"
},
{
"name": "Apache",
"version": "2.4"
}
],
"workspaceConfig": {
"environments": {
"default": {
"recipe": {
"content": "eclipse/php:7.1-che7",
"type": "dockerimage"
},
"machines": {
"php-container": {
"attributes": {
"memoryLimitBytes": "536870912"
},
"servers": {},
"volumes": {
"projects": {
"path": "/projects"
},
"composer": {
"path": "/home/user/.composer"
},
"symfony": {
"path": "/home/user/.symfony"
}
},
"installers": [],
"env": {
"HOME": "/home/user",
"PS1": "$(echo ${0})\\$ "
}
}
}
}
},
"name": "default",
"defaultEnv": "default",
"description": null,
"attributes": {
"editor": "eclipse/che-theia/next",
"plugins": "eclipse/che-machine-exec-plugin/0.0.1, redhat/php/latest, redhat/php-debugger/latest"
},
"links": []
},
"stackIcon": {
"name": "type-che7.svg",
"mediaType": "image/svg+xml"
}
},
{
"id": "php+mysql",
"name": "PHP + MySQL with Theia IDE",
"creator": "Valerii Svydenko",
"tags": [
"Theia",
"Debian",
"PHP",
"Apache",
"MySQL"
],
"scope": "general",
"description": "Default PHP Stack with PHP 7.1 + MySQL and Theia IDE",
"components": [
{
"version": "9",
"name": "Debian"
},
{
"version": "7.1.29",
"name": "PHP"
},
{
"name": "Apache",
"version": "2.4"
},
{
"name": "MySQL",
"version": "14.14"
}
],
"workspaceConfig": {
"environments": {
"default": {
"recipe": {
"content": "kind: List\nitems:\n - \n apiVersion: v1\n kind: Pod\n metadata:\n name: web\n labels:\n type: db\n spec:\n containers:\n - \n image: eclipse/php:7.1-che7\n name: php-container\n ports:\n - \n containerPort: 8080\n protocol: TCP\n resources:\n limits:\n memory: 512Mi\n - \n image: centos/mysql-57-centos7\n name: mysql\n ports:\n - \n name: mysql\n containerPort: 3306\n protocol: TCP\n env:\n - \n name: MYSQL_USER\n value: homestead\n - \n name: MYSQL_ROOT_PASSWORD\n value: secret\n - \n name: MYSQL_PASSWORD\n value: secret\n - \n name: MYSQL_DATABASE\n value: homestead\n resources:\n limits:\n memory: 256Mi\n - \n apiVersion: v1\n kind: Service\n metadata:\n name: db\n spec:\n selector:\n type: db\n ports:\n - \n name: mysql\n port: 3306\n protocol: TCP\n targetPort: mysql\n",
"type": "kubernetes",
"contentType": "application/x-yaml"
},
"machines": {
"web/php-container": {
"attributes": {
"memoryLimitBytes": "536870912"
},
"servers": {},
"volumes": {
"projects": {
"path": "/projects"
},
"composer": {
"path": "/home/user/.composer"
},
"symfony": {
"path": "/home/user/.symfony"
}
},
"installers": [],
"env": {
"HOME": "/home/user",
"PS1": "$(echo ${0})\\$ "
}
},
"web/mysql": {
"attributes": {},
"servers": {
"mysql": {
"attributes": {},
"port": "3306",
"protocol": "tcp"
}
},
"volumes": {},
"installers": [],
"env": {}
}
}
}
},
"name": "default",
"defaultEnv": "default",
"description": null,
"attributes": {
"editor": "eclipse/che-theia/next",
"plugins": "eclipse/che-machine-exec-plugin/0.0.1, redhat/php/latest, redhat/php-debugger/latest"
},
"links": []
}
}
]
204 changes: 203 additions & 1 deletion ide/che-core-ide-templates/src/main/resources/samples.json
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,26 @@
"location": "https://github.com/che-samples/web-php-simple.git",
"parameters": {}
},
"commands": [],
"commands": [
{
"name": "Start Apache Web Server",
"type": "custom",
"commandLine": "service apache2 start",
"attributes": {
"previewUrl": "",
"goal": "Run"
}
},
{
"name": "Stop Apache Web Server",
"type": "custom",
"commandLine": "service apache2 stop",
"attributes": {
"previewUrl": "",
"goal": "Run"
}
}
],
"links": [],
"category": "Samples",
"tags": [
Expand Down Expand Up @@ -736,6 +755,189 @@
"php"
]
},
{
"name": "symfony-demo",
"displayName": "symfony-demo",
"path": "/symfony-demo",
"description": "Symfony Demo Application https://symfony.com/",
"projectType": "php",
"mixins": [],
"attributes": {
"language": [
"php"
]
},
"modules": [],
"problems": [],
"source": {
"type": "git",
"location": "https://github.com/symfony/demo.git",
"parameters": {}
},
"commands": [
{
"name": "Start Symfony Web Server",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/symfony-demo && $HOME/.symfony/bin/symfony server:start",
"attributes": {
"previewUrl": "",
"goal": "Run"
}
},
{
"name": "Stop Symfony Web Server",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/symfony-demo && $HOME/.symfony/bin/symfony server:stop",
"attributes": {
"previewUrl": "",
"goal": "Run"
}
},
{
"name": "Install dependencies",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/symfony-demo && composer install && wget https://get.symfony.com/cli/installer -O - | bash",
"attributes": {
"previewUrl": "",
"goal": "Run"
}
}
],
"links": [],
"category": "Samples",
"tags": [
"MySQL",
"PHP"
]
},
{
"name": "laravel-realworld-example-app",
"displayName": "laravel-realworld-example-app",
"path": "/laravel-realworld-example-app",
"description": "Exemplary real world backend API built with Laravel https://realworld.io",
"projectType": "php",
"mixins": [],
"attributes": {
"language": [
"php"
]
},
"modules": [],
"problems": [],
"source": {
"type": "git",
"location": "https://github.com/gothinkster/laravel-realworld-example-app.git",
"parameters": {}
},
"commands": [
{
"name": "Start Artisan Web Server",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/laravel-realworld-example-app && php artisan serve",
"attributes": {
"previewUrl": "",
"goal": "Run"
}
},
{
"name": "Install dependencies",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/laravel-realworld-example-app && composer install",
"attributes": {
"previewUrl": "",
"goal": "Run"
}
},
{
"name": "Copy the example env file and make the required configuration changes in the .env file",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/laravel-realworld-example-app && cp .env.example .env",
"attributes": {
"previewUrl": "",
"goal": "Run"
}
},
{
"name": "Generate a new application key",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/laravel-realworld-example-app && php artisan key:generate",
"attributes": {
"previewUrl": "",
"goal": "Run"
}
},
{
"name": "Generate a new JWT authentication secret key",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/laravel-realworld-example-app && php artisan jwt:generate",
"attributes": {
"previewUrl": "",
"goal": "Run"
}
},
{
"name": "Run the database migrations",
"type": "custom",
"commandLine": "cd ${CHE_PROJECTS_ROOT}/laravel-realworld-example-app && php artisan migrate",
"attributes": {
"previewUrl": "",
"goal": "Run"
}
}
],
"links": [],
"category": "Samples",
"tags": [
"MySQL",
"PHP"
]
},
{
"name": "crud-php",
"displayName": "pdo",
"path": "/pdo",
"description": "Code for the simple PHP and MySQL database app tutorial. https://www.taniarascia.com/create-a-simple-database-app-connecting-to-mysql-with-php/",
"projectType": "php",
"mixins": [],
"attributes": {
"language": [
"php"
]
},
"modules": [],
"problems": [],
"source": {
"type": "git",
"location": "https://github.com/taniarascia/pdo.git",
"parameters": {}
},
"commands": [
{
"name": "Start Apache Web Server",
"type": "custom",
"commandLine": "service apache2 start",
"attributes": {
"previewUrl": "",
"goal": "Run"
}
},
{
"name": "Stop Apache Web Server",
"type": "custom",
"commandLine": "service apache2 stop",
"attributes": {
"previewUrl": "",
"goal": "Run"
}
}
],
"links": [],
"category": "Samples",
"tags": [
"MySQL",
"PHP"
]
},
{
"name": "console-java-simple",
"displayName": "console-java-simple",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ public enum Stack {
NODEJS_AND_POSTGRES("nodejs-postgres"),
OPENSHIFT_SQL("openshift-sql"),
PHP("php-default"),
PHP_CHE7("php"),
PHP_MYSQL_CHE7("php+mysql"),
PHP_GAE("php-gae"),
PHP_5_6("php5.6-default"),
PLATFORMIO("platformio"),
Expand Down
Loading