{"id":13945600,"url":"https://github.com/o/symfony-build-deploy","last_synced_at":"2025-10-12T13:31:43.757Z","repository":{"id":139102488,"uuid":"46824764","full_name":"o/symfony-build-deploy","owner":"o","description":"Notes for creating builds and deployment for Symfony2 projects","archived":false,"fork":false,"pushed_at":"2017-06-09T10:32:47.000Z","size":4,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-20T08:46:01.329Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/o.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2015-11-24T23:19:30.000Z","updated_at":"2022-01-07T00:05:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"715a4033-ebb3-4c6e-b933-faecc80c3b21","html_url":"https://github.com/o/symfony-build-deploy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/o/symfony-build-deploy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o%2Fsymfony-build-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o%2Fsymfony-build-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o%2Fsymfony-build-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o%2Fsymfony-build-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/o","download_url":"https://codeload.github.com/o/symfony-build-deploy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/o%2Fsymfony-build-deploy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011443,"owners_count":26084947,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"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-08-08T04:01:08.977Z","updated_at":"2025-10-12T13:31:43.725Z","avatar_url":"https://github.com/o.png","language":null,"funding_links":[],"categories":["Resources"],"sub_categories":[],"readme":"## Symfony2, Symfony3 build and deployment best practices \n\n#### Upload your code to the production server\n\nTag a version of your code as a release\n\n    git tag ${TAG_NAME}\n    git push --tags\n        \nDownload a tagged version from Git as `tar.gz` archive\n    \nFrom any git server\n    \n    git archive --format=tar.gz -o \"/path/to/archive/folder/${GIT_REPOSITORY}-${TAG_NAME}.tar.gz\" --prefix=\"${GIT_REPOSITORY}-${TAG_NAME}/\" ${TAG_NAME}\n    \nFrom Github\n\n    curl -L --user \"${GIT_USERNAME}:${GIT_PASSWORD}\" --output \"/path/to/archive/folder/${GIT_REPOSITORY}-${TAG_NAME}.tar.gz\" \"https://github.com/${GIT_ACCOUNT}/${GIT_REPOSITORY}/archive/${TAG_NAME}.tar.gz\"\n\nCreate a release directory (Creating seperate folder for each release is strongly recommended)\n\n    mkdir -p /path/to/release/folder/${GIT_REPOSITORY}-${TAG_NAME}\n    \nExtract contents of archive to release directory\n\n    tar -zxf \"/path/to/archive/folder/${GIT_REPOSITORY}-${TAG_NAME}.tar.gz\" --directory \"/path/to/release/folder/${GIT_REPOSITORY}-${TAG_NAME}\" --strip-components 1\n\nCopy parameters.yml contains production parameters to project folder\n\n    cp \"/path/to/parameters/${GIT_REPOSITORY}.yml\" \"/path/to/release/folder/${GIT_REPOSITORY}-${TAG_NAME}/app/config/parameters.yml\"\n\n#### Post install tasks\n\n    cd \"/path/to/release/folder/${GIT_REPOSITORY}-${TAG_NAME}\"\n    \nFor running `post-install-cmd` scripts run in the production environment\n\n    export SYMFONY_ENV=prod\n    \nInstall vendors\n\n    composer.phar install --no-dev --optimize-autoloader\n    \nClear cache\n\n    /usr/bin/php app/console cache:clear --env=prod --no-debug\n    \nFor Symfony3\n\n    /usr/bin/php bin/console cache:clear --env=prod --no-debug\n    \nDump your assets (If you need)\n    \n    /usr/bin/php app/console assetic:dump --env=prod --no-debug\n    \nFor Symfony3\n\n    /usr/bin/php bin/console assetic:dump --env=prod --no-debug\n    \nExecutes (or dumps) the SQL needed to update the database schema to match the current mapping metadata.\n\n    /usr/bin/php app/console doctrine:schema:update --force\n    \nFor Symfony3\n\n    /usr/bin/php bin/console doctrine:schema:update --force\n    \nGive necesssary permissions (in this example, www-data belongs to nginx)\n\n    chown -R www-data: \"/path/to/release/folder/${GIT_REPOSITORY}-${TAG_NAME}\"\n\nFinally, symlink release folder to web server root\n\n    ln -sf \"/path/to/release/folder/${GIT_REPOSITORY}-${TAG_NAME}\" \"/var/www/${GIT_REPOSITORY}\"\n\nIf you use op-code cache with `php-fpm`, restart `php5-fpm` for invalidating cache every release. If you're using Apache with `mod_php`, you should restart it.\n\n*Don't forget to disable op-code cache on CLI interface using opcache.enable_cli (in php.ini) configuration option to prevent inconsistent results. You can check quickly with `$ php -i | grep opcache.enable`*\n\n#### Notes on deploying to multiple servers:\n\nCompress files for easy transfer\n\n    tar -zcf \"/path/to/build/folder/${GIT_REPOSITORY}-${TAG_NAME}\" .\n    \nExtract files to same directory on destination server\n\nFollowing Ansible tasks helps to distribute `builds` to other servers\n\n     - name: Create release directory\n       file:\n         path={{release_directory}}\n         state=directory\n \n     - name: Extracting release\n       unarchive:\n         src={{build_directory}}/{{project_name}}-{{release_version}}.tar.gz\n         dest={{release_directory}}\n         owner=www-data\n \n     - name: Symlinking release\n       file:\n         src={{release_directory}}\n         dest={{application_directory}}\n         state=link\n \n     - name: Start PHP5-FPM\n       service:\n         name=php5-fpm\n         state=reloaded\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo%2Fsymfony-build-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fo%2Fsymfony-build-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo%2Fsymfony-build-deploy/lists"}