Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

security: install Composer in specific channel #40

Merged
merged 6 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ symfony_composer_path: "{{ ansistrano_deploy_to }}/composer.phar"
symfony_composer_options: '--no-dev --optimize-autoloader --no-interaction'
symfony_composer_self_update: true # Always attempt a composer self-update
symfony_composer_version: 1.10.1 # Install specific composer version. If this variable is not set the latest stable version is installed
symfony_composer_channel: 2.2 # Install specific composer channel.
cbrunnkvist marked this conversation as resolved.
Show resolved Hide resolved

symfony_run_assets_install: true
symfony_assets_options: '--no-interaction'
Expand Down
12 changes: 11 additions & 1 deletion config/steps/composer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,22 @@

- name: Install stable composer
get_url: url=https://getcomposer.org/composer-stable.phar dest={{symfony_composer_path}} mode=0755 validate_certs=no force=no
when: symfony_composer_version is not defined
when: symfony_composer_version is not defined and symfony_composer_channel is not defined

- name: Install composer {{symfony_composer_version}}
get_url: url=https://getcomposer.org/download/{{symfony_composer_version}}/composer.phar dest={{symfony_composer_path}} mode=0755 validate_certs=no force=no
when: symfony_composer_version is defined

- name: Install composer installer
get_url: url=https://getcomposer.org/installer dest={{ansistrano_deploy_to}}/composer-installer.php mode=0755 validate_certs=no force=no
when: symfony_composer_channel is defined

- name: Install composer {{symfony_composer_channel}}
shell:
cmd: "{{symfony_php_path}} composer-installer.php --quiet --{{symfony_composer_channel}}"
chdir: "{{ansistrano_deploy_to}}"
when: symfony_composer_channel is defined

- name: Run composer install
shell: chdir={{ansistrano_release_path.stdout}}
export SYMFONY_ENV={{symfony_env}} APP_ENV={{symfony_env}} && {{symfony_php_path}} {{symfony_composer_path}} install {{symfony_composer_options}}
Expand Down