From faa76eaf8919d1e9658c80e5f869fac9b57a49ea Mon Sep 17 00:00:00 2001 From: Stevan Le Meur Date: Mon, 6 Mar 2017 12:02:55 +0100 Subject: [PATCH] Add command goals to all templates provided by default with Che --- .../src/main/resources/samples.json | 300 +++++++++++------- 1 file changed, 185 insertions(+), 115 deletions(-) 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 87a2d7b121aa..69759c23f7a9 100644 --- a/ide/che-core-ide-templates/src/main/resources/samples.json +++ b/ide/che-core-ide-templates/src/main/resources/samples.json @@ -26,7 +26,8 @@ "type": "mvn", "commandLine": "mvn -f ${current.project.path} clean install -DskipTests", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Build" } }, { @@ -34,7 +35,8 @@ "type": "custom", "commandLine": "$TOMCAT_HOME/bin/catalina.sh stop", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Run" } }, { @@ -42,7 +44,8 @@ "type": "mvn", "commandLine": "mvn -f ${current.project.path} clean install -DskipTests && cp ${current.project.path}/target/*.war $TOMCAT_HOME/webapps/ROOT.war && $TOMCAT_HOME/bin/catalina.sh run 2>&1", "attributes": { - "previewUrl": "http://${server.port.8080}" + "previewUrl": "http://${server.port.8080}", + "goal": "Run" } }, { @@ -50,7 +53,8 @@ "type": "mvn", "commandLine": "mvn -f ${current.project.path} clean install -DskipTests && cp ${current.project.path}/target/*.war $TOMCAT_HOME/webapps/ROOT.war && $TOMCAT_HOME/bin/catalina.sh jpda run 2>&1", "attributes": { - "previewUrl": "http://${server.port.8080}" + "previewUrl": "http://${server.port.8080}", + "goal": "Debug" } } ], @@ -131,7 +135,8 @@ "type": "custom", "commandLine": "cd ${current.project.path} && gcc -o Hello Hello.c && ./Hello", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Run" } } ], @@ -167,7 +172,8 @@ "type": "custom", "commandLine": "mvn -f ${current.project.path} clean install", "attributes": { - "previewUrl": "http://${server.port.6080}" + "previewUrl": "http://${server.port.6080}", + "goal": "Run" } } ], @@ -202,7 +208,8 @@ "type": "custom", "commandLine": "mvn -f ${current.project.path} clean install", "attributes": { - "previewUrl": "http://${server.port.6080}" + "previewUrl": "http://${server.port.6080}", + "goal": "Run" } } ], @@ -237,7 +244,8 @@ "type": "custom", "commandLine": "cd ${current.project.path} && go get -d && go run main.go", "attributes": { - "previewUrl": "http://${server.port.8080}" + "previewUrl": "http://${server.port.8080}", + "goal": "Run" } } ], @@ -272,7 +280,8 @@ "type": "custom", "commandLine": "cd ${current.project.path} && go get -d && go run main.go", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Run" } } ], @@ -307,13 +316,18 @@ "type": "mvn", "commandLine": "mvn -f ${current.project.path} clean install", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Build" } }, { "name": "run", "type": "custom", - "commandLine": "cd ${current.project.path} && mvn exec:java -Dexec.mainClass='org.eclipse.che.wordcount.WordCount'" + "commandLine": "cd ${current.project.path} && mvn exec:java -Dexec.mainClass='org.eclipse.che.wordcount.WordCount'", + "attributes": { + "previewUrl": "", + "goal": "Run" + } } ], "links": [], @@ -347,7 +361,8 @@ "type": "custom", "commandLine": "cd ${current.project.path} && python main.py", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Run" } } ], @@ -382,7 +397,8 @@ "type": "custom", "commandLine": "cd ${current.project.path} && sudo virtualenv /env && sudo pip install -r requirements.txt && python main.py", "attributes": { - "previewUrl": "http://${server.port.8080}" + "previewUrl": "http://${server.port.8080}", + "goal": "Run" } } ], @@ -417,7 +433,8 @@ "type": "custom", "commandLine": "cd ${GAE} && ./dev_appserver.py 2>&1 --skip_sdk_update_check true --host=0.0.0.0 --admin_host=0.0.0.0 ${current.project.path}", "attributes": { - "previewUrl": "http://${server.port.8080}" + "previewUrl": "http://${server.port.8080}", + "goal": "Run" } } ], @@ -452,7 +469,8 @@ "type": "custom", "commandLine": "cd ${current.project.path} && bundle install", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Build" } }, { @@ -460,7 +478,8 @@ "type": "custom", "commandLine": "cd ${current.project.path} && rails server -b 0.0.0.0", "attributes": { - "previewUrl": "http://${server.port.3000}" + "previewUrl": "http://${server.port.3000}", + "goal": "Run" } } ], @@ -496,7 +515,8 @@ "type": "custom", "commandLine": "cd ${current.project.path} && ruby main.rb", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Run" } } ], @@ -533,7 +553,8 @@ "type": "custom", "commandLine": "cd ${current.project.path} && node app/app.js", "attributes": { - "previewUrl": "http://${server.port.3000}" + "previewUrl": "http://${server.port.3000}", + "goal": "Run" } } ], @@ -543,51 +564,53 @@ "Node.JS" ] }, - { - "name": "angular-patternfly-starter", - "displayName": "angular-patternfly-starter", - "path": "/angular-patternfly-starter", - "description": "Angular PatternFly Starter Project.", - "projectType": "node-js", - "mixins": [], - "attributes": { - "language": [ - "javascript" - ] - }, - "modules": [], - "problems": [], - "source": { - "type": "git", - "location": "https://github.com/patternfly/angular-patternfly-demo-app.git", - "parameters": {} - }, - "commands": [ - { - "name": "install dependencies", - "type": "custom", - "commandLine": "cd ${current.project.path} && npm install --no-bin-links && bower install", - "attributes": { - "previewUrl": "" - } - }, - { - "name": "run", - "type": "custom", - "commandLine": "cd ${current.project.path} && grunt server", - "attributes": { - "previewUrl": "http://${server.port.8003}" - } - } - ], - "links": [], - "category": "Samples", - "tags": [ - "nodejs", - "patternfly", - "javascript", - "Node.JS" - ] + { + "name": "angular-patternfly-starter", + "displayName": "angular-patternfly-starter", + "path": "/angular-patternfly-starter", + "description": "Angular PatternFly Starter Project.", + "projectType": "node-js", + "mixins": [], + "attributes": { + "language": [ + "javascript" + ] + }, + "modules": [], + "problems": [], + "source": { + "type": "git", + "location": "https://github.com/patternfly/angular-patternfly-demo-app.git", + "parameters": {} + }, + "commands": [ + { + "name": "install dependencies", + "type": "custom", + "commandLine": "cd ${current.project.path} && npm install --no-bin-links && bower install", + "attributes": { + "previewUrl": "", + "goal": "Build" + } + }, + { + "name": "run", + "type": "custom", + "commandLine": "cd ${current.project.path} && grunt server", + "attributes": { + "previewUrl": "http://${server.port.8003}", + "goal": "Run" + } + } + ], + "links": [], + "category": "Samples", + "tags": [ + "nodejs", + "patternfly", + "javascript", + "Node.JS" + ] }, { "name": "web-java-spring", @@ -614,7 +637,8 @@ "type": "mvn", "commandLine": "mvn -f ${current.project.path} clean install && cp ${current.project.path}/target/*.war $TOMCAT_HOME/webapps/ROOT.war", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Build" } }, { @@ -622,7 +646,8 @@ "type": "custom", "commandLine": "$TOMCAT_HOME/bin/catalina.sh run 2>&1", "attributes": { - "previewUrl": "http://${server.port.8080}" + "previewUrl": "http://${server.port.8080}", + "goal": "Run" } }, { @@ -630,7 +655,8 @@ "type": "custom", "commandLine": "$TOMCAT_HOME/bin/catalina.sh stop", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Run" } }, { @@ -638,7 +664,8 @@ "type": "mvn", "commandLine": "mvn -f ${current.project.path} clean install && cp ${current.project.path}/target/*.war $TOMCAT_HOME/webapps/ROOT.war && $TOMCAT_HOME/bin/catalina.sh run 2>&1", "attributes": { - "previewUrl": "http://${server.port.8080}" + "previewUrl": "http://${server.port.8080}", + "goal": "Run" } }, { @@ -646,7 +673,8 @@ "type": "mvn", "commandLine": "mvn -f ${current.project.path} clean install && cp ${current.project.path}/target/*.war $TOMCAT_HOME/webapps/ROOT.war && $TOMCAT_HOME/bin/catalina.sh jpda run 2>&1", "attributes": { - "previewUrl": "http://${server.port.8080}" + "previewUrl": "http://${server.port.8080}", + "goal": "Debug" } } ], @@ -683,7 +711,8 @@ "type": "custom", "commandLine": "cd ${current.project.path} && make && ./a.out", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Run" } } ], @@ -719,7 +748,8 @@ "type": "custom", "commandLine": "cd ${current.project.path} && npm install && bower install", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Build" } }, { @@ -727,7 +757,8 @@ "type": "custom", "commandLine": "cd ${current.project.path} && grunt serve", "attributes": { - "previewUrl": "http://${server.port.9000}" + "previewUrl": "http://${server.port.9000}", + "goal": "Run" } } ], @@ -762,7 +793,8 @@ "type": "custom", "commandLine": "sudo service apache2 start && sudo tail -f /var/log/apache2/access.log -f /var/log/apache2/error.log", "attributes": { - "previewUrl": "http://${server.port.80}/${current.project.relpath}" + "previewUrl": "http://${server.port.80}/${current.project.relpath}", + "goal": "Run" } }, { @@ -770,7 +802,8 @@ "type": "custom", "commandLine": "sudo service apache2 stop", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Run" } }, { @@ -778,7 +811,8 @@ "type": "custom", "commandLine": "sudo service apache2 restart", "attributes": { - "previewUrl": "http://${server.port.80}/${current.project.relpath}" + "previewUrl": "http://${server.port.80}/${current.project.relpath}", + "goal": "Run" } } ], @@ -814,7 +848,8 @@ "type": "custom", "commandLine": "cd ${GAE} && ./dev_appserver.py 2>&1 --php_executable_path=/usr/bin/php5-cgi --skip_sdk_update_check true --host=0.0.0.0 --admin_host=0.0.0.0 ${current.project.path}", "attributes": { - "previewUrl": "http://${server.port.8080}" + "previewUrl": "http://${server.port.8080}", + "goal": "Run" } } ], @@ -849,7 +884,8 @@ "type": "mvn", "commandLine": "mvn -f ${current.project.path} clean install", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Build" } }, { @@ -857,7 +893,8 @@ "type": "mvn", "commandLine": "mvn -f ${current.project.path} clean install && java -jar ${current.project.path}/target/*.jar", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Run" } } ], @@ -893,7 +930,8 @@ "type": "custom", "commandLine": "cd ${current.project.path} && dotnet restore", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Build" } }, { @@ -901,7 +939,8 @@ "type": "custom", "commandLine": "cd ${current.project.path} && dotnet run", "attributes": { - "previewUrl": "http://${server.port.5000}" + "previewUrl": "http://${server.port.5000}", + "goal": "Run" } } ], @@ -936,7 +975,8 @@ "type": "mvn", "commandLine": "mvn -f ${current.project.path} clean install && cp ${current.project.path}/target/*.war $TOMEE_HOME/webapps/ROOT.war", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Build" } }, { @@ -944,7 +984,8 @@ "type": "custom", "commandLine": "$TOMEE_HOME/bin/catalina.sh run 2>&1", "attributes": { - "previewUrl": "http://${server.port.8080}" + "previewUrl": "http://${server.port.8080}", + "goal": "Run" } }, { @@ -952,7 +993,8 @@ "type": "custom", "commandLine": "$TOMEE_HOME/bin/catalina.sh stop", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Run" } }, { @@ -960,7 +1002,8 @@ "type": "mvn", "commandLine": "mvn -f ${current.project.path} clean install && cp ${current.project.path}/target/*.war $TOMEE_HOME/webapps/ROOT.war && $TOMEE_HOME/bin/catalina.sh run 2>&1", "attributes": { - "previewUrl": "http://${server.port.8080}" + "previewUrl": "http://${server.port.8080}", + "goal": "Run" } }, { @@ -968,7 +1011,8 @@ "type": "mvn", "commandLine": "mvn -f ${current.project.path} clean install && cp ${current.project.path}/target/*.war $TOMEE_HOME/webapps/ROOT.war && $TOMEE_HOME/bin/catalina.sh jpda run 2>&1", "attributes": { - "previewUrl": "http://${server.port.8080}" + "previewUrl": "http://${server.port.8080}", + "goal": "Debug" } } ], @@ -1005,21 +1049,26 @@ "type": "custom", "commandLine": "print-help && cd ${current.project.path} && npm install express@4.13.4 && express -f . && cp -rn /bitnami/mongodb/conf ${current.project.path} && npm install mongodb@2.1.18 --save && npm install && counter=0; until nc -z localhost 27017; do counter=$((counter+1)); if [ $counter == 10 ]; then echo \"Error: Couldn't connect to MongoDB.\"; exit 1; fi; echo \"Trying to connect to MongoDB at localhost. Attempt $counter.\"; sleep 5; done; echo \"Connected to MongoDB database. Starting application server.\" && npm start", "attributes": { - "previewUrl": "http://${server.port.3000}" + "previewUrl": "http://${server.port.3000}", + "goal": "Run" } }, { "name": "2. Stop", "type": "custom", "commandLine": "print-help && cd ${current.project.path} && pkill -u bitnami node && echo \"Web server stopped.\"", - "attributes": {} + "attributes": { + "previewUrl": "", + "goal": "Run" + } }, { "name": "3. Run", "type": "custom", "commandLine": "print-help && cd ${current.project.path} && npm start", "attributes": { - "previewUrl": "http://${server.port.3000}" + "previewUrl": "http://${server.port.3000}", + "goal": "Run" } } ], @@ -1055,13 +1104,19 @@ "name": "1. Create project", "type": "custom", "commandLine": "print-help && mkdir ${current.project.path}/app_template && cd ${current.project.path}/app_template && swift-package init --type executable 2>&1 | grep -v \"no version information available\"; swift build 2>&1 | grep -v \"no version information available\"; echo \"Project built successfully.\"", - "attributes": {} + "attributes": { + "previewUrl": "", + "goal": "Run" + } }, { "name": "2. Run", "type": "custom", "commandLine": "print-help && cd ${current.project.path}/app_template && swift build 2>&1 | grep -v \"no version information available\"; ./.build/debug/app_template", - "attributes": {} + "attributes": { + "previewUrl": "", + "goal": "Run" + } } ], "links": [], @@ -1097,21 +1152,26 @@ "type": "custom", "commandLine": "print-help && sudo HOME=/root /opt/bitnami/nami/bin/nami start mariadb && cp -a /tmp/laravel-sample/. ${current.project.path} && cd ${current.project.path} && composer update && php artisan migrate && php artisan serve --host=0.0.0.0 --port=3000", "attributes": { - "previewUrl": "http://${server.port.3000}/" + "previewUrl": "http://${server.port.3000}/", + "goal": "Run" } }, { "name": "2. Stop", "type": "custom", "commandLine": "print-help && cd ${current.project.path} && pkill -u bitnami php && echo \"Web server stopped.\"", - "attributes": {} + "attributes": { + "previewUrl": "", + "goal": "Run" + } }, { "name": "3. Run", "type": "custom", "commandLine": "print-help && cd ${current.project.path} && php artisan serve --host=0.0.0.0 --port=3000", "attributes": { - "previewUrl": "http://${server.port.3000}/" + "previewUrl": "http://${server.port.3000}/", + "goal": "Run" } } ], @@ -1148,7 +1208,8 @@ "type": "custom", "commandLine": "print-help && sudo HOME=/root /opt/bitnami/nami/bin/nami start mariadb && cd ${current.project.path} && mv README.md README-CHE.md && rails new . --skip-bundle --database mysql && sed -Ei 's/\\s*#\\s*gem(.*)therubyracer/gem\\1therubyracer/' Gemfile && bundle install && bundle exec rails db:create && bundle exec rails db:migrate && bundle exec rails server -b 0.0.0.0 -p 3000", "attributes": { - "previewUrl": "http://${server.port.3000}/" + "previewUrl": "http://${server.port.3000}/", + "goal": "Run" } }, { @@ -1156,7 +1217,8 @@ "type": "custom", "commandLine": "print-help && cd ${current.project.path} && bundle exec rails server -b 0.0.0.0 -p 3000", "attributes": { - "previewUrl": "http://${server.port.3000}/" + "previewUrl": "http://${server.port.3000}/", + "goal": "Run" } } ], @@ -1193,7 +1255,8 @@ "type": "custom", "commandLine": "print-help && sudo HOME=/root /opt/bitnami/nami/bin/nami execute codeigniter createProject --force $(basename ${current.project.path}) | grep -v undefined && php -S 0.0.0.0:8000 -t ${current.project.path}", "attributes": { - "previewUrl": "http://${server.port.8000}/" + "previewUrl": "http://${server.port.8000}/", + "goal": "Run" } }, { @@ -1201,7 +1264,8 @@ "type": "custom", "commandLine": "print-help && php -S 0.0.0.0:8000 -t ${current.project.path}", "attributes": { - "previewUrl": "http://${server.port.8000}/" + "previewUrl": "http://${server.port.8000}/", + "goal": "Run" } } ], @@ -1238,7 +1302,8 @@ "type": "custom", "commandLine": "print-help && sudo HOME=/root nami execute symfony createProject --force $(basename ${current.project.path}) | grep -v undefined && ln -fs ${current.project.path}/web/app.php ${current.project.path}/web/index.php && php -S 0.0.0.0:8000 -t ${current.project.path}/web", "attributes": { - "previewUrl": "http://${server.port.8000}/" + "previewUrl": "http://${server.port.8000}/", + "goal": "Run" } }, { @@ -1246,7 +1311,8 @@ "type": "custom", "commandLine": "print-help && php -S 0.0.0.0:8000 -t ${current.project.path}/web", "attributes": { - "previewUrl": "http://${server.port.8000}/" + "previewUrl": "http://${server.port.8000}/", + "goal": "Run" } } ], @@ -1283,21 +1349,26 @@ "type": "custom", "commandLine": "print-help && sudo HOME=/root /opt/bitnami/nami/bin/nami execute activator createProject --force $(basename ${current.project.path}) play-java | grep -v undefined && cd ${current.project.path} && /opt/bitnami/activator/bin/activator -Dsbt.log.noformat=true -Doffline=true -Dhttp.host=0.0.0.0 -Dhttp.port=9000 ~run", "attributes": { - "previewUrl": "http://${server.port.9000}/" + "previewUrl": "http://${server.port.9000}/", + "goal": "Run" } }, { "name": "2. Stop", "type": "custom", "commandLine": "print-help && cd ${current.project.path} && pkill -u bitnami -n java && echo \"Web server stopped.\"", - "attributes": {} + "attributes": { + "previewUrl": "", + "goal": "Run" + } }, { "name": "3. Run", "type": "custom", "commandLine": "print-help && cd ${current.project.path} && /opt/bitnami/activator/bin/activator -Doffline=true -Dhttp.host=0.0.0.0 -Dhttp.port=9000 -Dsbt.log.noformat=true ~run", "attributes": { - "previewUrl": "http://${server.port.9000}/" + "previewUrl": "http://${server.port.9000}/", + "goal": "Run" } } ], @@ -1332,7 +1403,8 @@ "type": "custom", "commandLine": "chmod 777 ${current.project.path}/data; echo \"\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; cp /usr/local/zend/etc/php.ini /tmp/update-php.ini && grep -q 'extension=pcntl.so' /tmp/update-php.ini || echo \"\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": "" + "previewUrl": "", + "goal": "Common" } }, { @@ -1340,7 +1412,8 @@ "type": "custom", "commandLine": "cp /usr/local/zend/etc/php.ini /tmp/update-php.ini && grep -q 'extension=pcntl.so' /tmp/update-php.ini || echo \"\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": "" + "previewUrl": "", + "goal": "Common" } }, { @@ -1348,7 +1421,8 @@ "type": "custom", "commandLine": "sudo rm -rf ${current.project.path}/data/doctrine-cache", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Common" } } ], @@ -1382,7 +1456,8 @@ "type": "custom", "commandLine": "chmod 777 ${current.project.path}/data/cache; echo \"\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", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Common" } } ], @@ -1416,7 +1491,8 @@ "type": "custom", "commandLine": "chmod 777 ${current.project.path}/data/cache; echo \"\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", "attributes": { - "previewUrl": "" + "previewUrl": "", + "goal": "Common" } } ], @@ -1449,9 +1525,7 @@ "convertToTopLevelProject": "true" } }, - "commands": [ - - ], + "commands": [], "links": [], "category": "Samples", "tags": [ @@ -1481,9 +1555,7 @@ "convertToTopLevelProject": "true" } }, - "commands": [ - - ], + "commands": [], "links": [], "category": "Samples", "tags": [ @@ -1513,9 +1585,7 @@ "convertToTopLevelProject": "true" } }, - "commands": [ - - ], + "commands": [], "links": [], "category": "Samples", "tags": [