{"id":27646066,"url":"https://github.com/in2code-de/in2code.deploymentlocker","last_synced_at":"2026-07-08T18:31:07.844Z","repository":{"id":56990694,"uuid":"53513423","full_name":"in2code-de/In2code.DeploymentLocker","owner":"in2code-de","description":"Simple script to prohibit parallel execution of the same TYPO3.Surf deployment","archived":false,"fork":false,"pushed_at":"2018-08-23T12:45:02.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-24T01:16:11.637Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/in2code-de.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-09T16:32:19.000Z","updated_at":"2018-08-23T12:45:03.000Z","dependencies_parsed_at":"2022-08-21T13:50:15.282Z","dependency_job_id":null,"html_url":"https://github.com/in2code-de/In2code.DeploymentLocker","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/in2code-de%2FIn2code.DeploymentLocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/in2code-de%2FIn2code.DeploymentLocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/in2code-de%2FIn2code.DeploymentLocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/in2code-de%2FIn2code.DeploymentLocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/in2code-de","download_url":"https://codeload.github.com/in2code-de/In2code.DeploymentLocker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250540935,"owners_count":21447428,"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":[],"created_at":"2025-04-24T01:16:26.863Z","updated_at":"2025-10-25T05:32:36.161Z","avatar_url":"https://github.com/in2code-de.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# In2code.DeploymentLocker - Prevent parallel execution of the same deployment\n\n## Description\n\nTYPO3.Surf is a CLI application for automated deployment. When a deployment is runs,\nmany tasks are executed in a order. If a deployment runs parallel in two seperate processes,\nit might leave your deployment target in an unusable and hard recoverable state.\n\nTo prevent, that one deployment is executet twice ore more times at the same time, you\ncan simply lock it.\n\nThis does not affect any other deployment. You can still run another deployment in parallel!\n\n## Installation\n\nInstall In2code.DeploymentLocker via composer\n\n\tcomposer require in2code/deploymentlocker\n\n## How to Use\n\nOpen the deployment you want to protect and add followinf line after the php opening tag.\nIt should look like this: (Notice that the annotation is optional)\n\n\t\u003c?php\n\t/** @var \\TYPO3\\Surf\\Domain\\Model\\Deployment $deployment */\n\t\\In2code\\DeploymentLocker\\DeploymentLocker::lockDeployment($deployment);\n\nThat's it. Repeat for any other deployment you want to protect.\n\n## What happens?\n\nThe DeploymentLocker writes himself to $GLOBALS, so the object will exist for the whole\nruntime. (Maybe a static property would be equivalent ore better?)\nWhen the object is created, it checks if there's a lock file for the current deployment.\nIf true, then an Exception will be thrown and the deployment stops immediatley.\nOtherwise the lock file is created. After runtime the lockfile will be\ndeleted and the deployment can be started again.\n\nYou can catch the Exception in your deployment and output some other information or\nimplement a \"sleep for X and try again later\" stuff, but i won't recommend that.\n\n## Testing \u0026 Contributing\n\nFeel free to open a discussion, create a fork or create pull requests.\n\nThis package is \"tested by production\" ;)\nHonestly this is a excerpt from another package i wrote some years ago.\nThat package is still used for Surf \u003c 2.0 and requires In2code.SurfGui.\n\n## Copyright\n\nAll copyright belongs to in2code GmbH \u003cinfo@in2code.de\u003e.\nThe author of this package is Oliver Eglseder \u003coliver.eglseder@in2code.de\u003e.\nThis package is licensed under GNU General Public License, version 3 or later (http://www.gnu.org/licenses/gpl.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fin2code-de%2Fin2code.deploymentlocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fin2code-de%2Fin2code.deploymentlocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fin2code-de%2Fin2code.deploymentlocker/lists"}