{"id":24941380,"url":"https://github.com/wtower/ansible-node-deploy","last_synced_at":"2025-03-28T17:42:50.844Z","repository":{"id":68184832,"uuid":"62911642","full_name":"Wtower/ansible-node-deploy","owner":"Wtower","description":"Ansible role to deploy a Node.js app to Plesk.","archived":false,"fork":false,"pushed_at":"2017-07-25T12:43:19.000Z","size":12,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T18:26:17.850Z","etag":null,"topics":["ansible-role","deployment","nodejs","plesk"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Wtower.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2016-07-08T19:12:55.000Z","updated_at":"2017-03-23T08:16:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"4b4d9804-384a-48d6-8dfa-79c121e4c960","html_url":"https://github.com/Wtower/ansible-node-deploy","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wtower%2Fansible-node-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wtower%2Fansible-node-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wtower%2Fansible-node-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wtower%2Fansible-node-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wtower","download_url":"https://codeload.github.com/Wtower/ansible-node-deploy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246072196,"owners_count":20719270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ansible-role","deployment","nodejs","plesk"],"created_at":"2025-02-02T18:22:32.263Z","updated_at":"2025-03-28T17:42:50.839Z","avatar_url":"https://github.com/Wtower.png","language":null,"readme":"node-deploy\n===========\n\nAnsible role to deploy a Node.js app to Plesk\n\nUse [ansible-nvm](https://github.com/Wtower/ansible-nvm) role to ensure node is installed. \n\nRequired variables \n------------------\n\n(passed as extra variables):\n\n- `project`: **Node project name**\n\nOptional variables\n------------------\n\n(passed as extra variables):\n\n- `exclude`: Additional pattern to exclude from sync, eg. `uploads/`.\n- `loaddata`: Specify mongo dump directory in host directory to perform a mongo restore, eg. `dump`.\n\nRequired Configuration variables \n--------------------------------\n\n(better to keep in configuration file as shown in examples):\n\n- `conf`: A dictionary to help organize variables, containing:\n- `conf.dev_path`: The local path of the project, eg ~/workspace/python/myproject.\n- `conf.host_path`: The remote path, where the wsgi index script lies, eg /var/www/vhosts/subscription/domain.\n\nOptional Configuration variables\n--------------------------------\n\n- `conf.node_version`: The node.js version of the app, default: `4.4.7`.\n- `conf.node_port`: The node.js server port, default: `3000`.\n- `conf.start_script`: The node.js start script, default: `bin/www`.\n- `conf.node_env`: The node.js environment, default: `production`.\n- `conf.https_only`: If true then configure Apache \n  [only for SSL](https://github.com/Wtower/ansible-node-deploy/issues/6). Default: `false`.\n- `conf.domain_name`: Domain name to be used in Apache conf. Omit to skip configure Apache in Plesk \n  and register system service.\n- `conf.vhost_conf_path`: The remote path, where the apache configuration override (`vhost.conf`) is located.\n\nOther default variables\n-----------------------\n\n- `ansible_user_id`: The user id with access to mysql and mysql database.\n- `sync_opts`: Additional options for rsync. Default: exclude `.*`. \n\nPlaybook examples\n-----------------\n\nSee the folder `examples/`:\n\n- `node_deploy.yml`: playbook example\n- `node_apps.yml`: configuration example\n\nTask description\n----------------\n\n1. Check that local project path in configuration is valid and has package.json\n\n   Checks that there is a valid local path specified in `node_apps.yml` and a `package.json` exists.\n   Avoids deploying wrong files.\n\n2. Check if gulp file exists\n\n   So that to execute next step.\n\n3. Execute gulp\n\n   Execute `gulp --production` locally.\n\n4. Create directory\n\n   Creates a `project` directory in target to deploy files.\n\n5. (Enable Apache proxy) (removed)\n\n   Makes sure that `mod_proxy` is enabled.\n   If the configuration changes, causes Apache to restart in the end (notifies handler).\n\n6. Build sync options\n\n   Append any additional excluded files in the rsync options.\n\n7. Sync files\n\n   Syncs files to target directory.\n\n   :warning: Make sure that you have synced back any user uploaded files with manual `rsync`. \n\n8. Load data\n\n   Perform a mongo restore from the optionall specified additional variable `loaddata`.\n\n9. Configure Apache\n\n   Configure Apache to proxy to server using the provided template file.\n   If the configuration changes, causes Plesk to reconfigure the domain in the end (notifies handler).\n   If the configuration changes, causes Apache to restart in the end (notifies handler).\n\n10. Configure Apache SSL\n\n   Same as above, for SSL vhost.\n\n11. Set node path\n\n   Auxiliary task which sets a variable with the nvm node path executables.\n\n13. (Upgrade npm) (removed)\n\n   Upgrades global npm.\n\n14. (Install npm requirements) (removed)\n\n   Run `npm install`.\n\n15. Configure service\n\n   Configure an init service to execute node.js using the provided template file.\n   If the configuration changes, causes service to restart (notifies handler).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtower%2Fansible-node-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwtower%2Fansible-node-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtower%2Fansible-node-deploy/lists"}