{"id":19251213,"url":"https://github.com/rexops/rex-application","last_synced_at":"2026-06-18T13:31:48.460Z","repository":{"id":138907745,"uuid":"45208488","full_name":"RexOps/rex-application","owner":"RexOps","description":"A class to manage application deployments","archived":false,"fork":false,"pushed_at":"2017-02-15T11:10:26.000Z","size":78,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-23T16:48:39.679Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RexOps.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-29T20:24:07.000Z","updated_at":"2017-05-31T10:13:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"776f6745-502f-4276-863a-2d29ab00bffb","html_url":"https://github.com/RexOps/rex-application","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/RexOps/rex-application","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RexOps%2Frex-application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RexOps%2Frex-application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RexOps%2Frex-application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RexOps%2Frex-application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RexOps","download_url":"https://codeload.github.com/RexOps/rex-application/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RexOps%2Frex-application/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34493356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T18:21:08.186Z","updated_at":"2026-06-18T13:31:48.439Z","avatar_url":"https://github.com/RexOps.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Application\n\nThe Application class provides the deployment and instance management functions.\n\n## Types\n\nCurrently the following application types are supported. It is easy to create custom ones.\n\n### Static\n\nFor static website deployment. This deployment upload files to the webserver and link the document root with the newly uploaded files.\n\n\n### PHP\n\nPHP deployment is like static deployment.\n\n\n#### FPM\n\nPHP-FPM deployment extends the PHP deployment with the possibility to restart php-fpm service.\n\n\n### Tomcat\n\nTomcat deployment uses the tomcat-manager to deploy war archives. Additionally it supports 2 instance deployments. With this it is possible to deploy all servers with a new version before advising mod_jk to route traffic to the new version.\n\nAdditionally it restarts tomcat after the deployment to get a clean jvm.\n\n\n### JBoss\n\nJBoss deployment uploads an ear file to the deployment directory of JBoss and uses .dodeploy file to trigger the deployment.\n\nAdditionally it restarts jboss after the deployment to get a clean jvm.\n\n\n## Custom Application Types\n\nIf you need to extend the deployment you can easily create custom application classes.\n\nFor this you need to create 2 classes. One *application* and one *instance* class.\n\n### Application Class\n\nTo create an application class you need to inherit from a provided base type. In this example we extend the *Application::PHP::FPM* type.\n\nAfter this we need to register the new application type to the project class.\n\n```perl\nProject-\u003eregister_app_type($order, $package_Name, $condition_CodeRef);\n```\n\n* $oder: an order of \"0\" will run the detection of this custom application type at first. The provided application types using an order of 100.\n* $package_Name: the class name for the application.\n* $condition_CodeRef: code that detects the application type.\n\n\n```perl\npackage MyApp {\n\n  use Moose;\n  use MyApp::Instance;\n\n  require Rex::Commands;\n\n  extends 'Application::PHP::FPM';\n\n  Project-\u003eregister_app_type(90, __PACKAGE__, sub {\n    if(Rex::Commands::connection()-\u003eserver =~ m/^my\\-appsrv/) {\n      return 1;\n    }\n\n    return 0;\n  });\n\n}\n\n1;\n```\n\n### Instance Class\n\nThe instance class must inherit from one of the provided base types.\n\n```perl\npackage My::Instance {\n\n  use Moose;\n  use Rex::Commands::Run;\n  use Rex::Commands::Fs;\n  use Rex::Commands::File;\n\n  require Rex::Commands;\n\n  extends 'Application::PHP::FPM::Instance';\n\n  after configure_app =\u003e sub {\n    # do something after the configuration\n  };\n\n}\n\n1;\n```\n\n# COPYRIGHT\n\nCopyright 2015 FILIADATA GmbH\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frexops%2Frex-application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frexops%2Frex-application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frexops%2Frex-application/lists"}