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

dev-config.sh: install developer tools #76

Merged
merged 2 commits into from
May 23, 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Currently only Ubuntu is supported.
After installation, CiviCRM is ready to use (mostly in a CI environment).
However if you plan to use it for development, there are several utility scripts to help work:

- `bin/dev-config.sh`: Configure CiviCRM for development.
- `bin/dev-config.sh`: Configure CiviCRM for development. Install some development tools.

```
dev-config.sh [INSTALL_DIR]
Expand Down
18 changes: 18 additions & 0 deletions bin/dev-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@ install_dir="${1:-${base_dir}}"
install_dir=$(realpath "${install_dir}")
cv_params=(--no-interaction "--cwd=${install_dir}")

print-status Install developer tools...
tmp_file=$(mktemp)
curl -LsS -o "${tmp_file}" "${url_php_cs_fixer}"
echo "${sha_php_cs_fixer} ${tmp_file}" | sha256sum --check --strict --status -
sudo cp --no-preserve=mode "${tmp_file}" "${local_bin}/php-cs-fixer"
sudo curl -LsS -o "${local_bin}/civix" "${url_civix}"
sudo curl -LsS -o "${local_bin}/civistrings" "${url_civistrings}"
sudo chmod +x "${local_bin}/php-cs-fixer"
sudo chmod +x "${local_bin}/civix"
sudo chmod +x "${local_bin}/civistrings"
print-finish

print-header Verify developer tools version...
php-cs-fixer --version
civix --version
civistrings --version
print-finish

print-status Update civicrm.settings.php...
sed -i \
-e "/(\!defined('CIVICRM_TEMPLATE_COMPILE_CHECK'))/,+2 s@^//@@" \
Expand Down
9 changes: 6 additions & 3 deletions bin/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ print-finish

print-header Install MariaDB...
curl -LsS -O https://r.mariadb.com/downloads/mariadb_repo_setup
echo "${mariadb_repo_setup_checksum} mariadb_repo_setup" | sha256sum --check --strict -
echo "${mariadb_repo_setup_checksum} mariadb_repo_setup" | sha256sum --check --strict --status -
sudo bash mariadb_repo_setup --mariadb-server-version="${mariadb_version}"
sudo apt-get --quiet install --yes --no-install-recommends --no-upgrade mariadb-server mariadb-client
sudo mysql_install_db --user=mysql
Expand Down Expand Up @@ -67,13 +67,16 @@ php --version
print-finish

print-status Install PHP tools...
sudo curl -LsS -o "${local_bin}/composer" "${url_composer}"
tmp_file=$(mktemp)
curl -LsS -o "${tmp_file}" "${url_composer}"
echo "${sha_composer} ${tmp_file}" | sha256sum --check --strict --status -
sudo cp --no-preserve=mode "${tmp_file}" "${local_bin}/composer"
sudo curl -LsS -o "${local_bin}/cv" "${url_cv}"
sudo chmod +x "${local_bin}/composer"
sudo chmod +x "${local_bin}/cv"
print-finish

print-header PHP tools version...
print-header Verify PHP tools version...
composer --version
cv --version
print-finish
Expand Down
10 changes: 9 additions & 1 deletion cfg/install.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,17 @@ php_xdebug_mode=coverage
# Downloaded binaries location
local_bin=/usr/local/bin
# Composer URL
url_composer=https://getcomposer.org/download/2.5.5/composer.phar
url_composer=https://getcomposer.org/download/2.7.6/composer.phar
sha_composer=29dc9a19ef33535db061b31180b2a833a7cf8d2cf4145b33a2f83504877bba08
# CV url
url_cv=https://download.civicrm.org/cv/cv.phar
# civix url
url_civix=https://download.civicrm.org/civix/civix.phar
# civistrings url
url_civistrings=https://download.civicrm.org/civistrings/civistrings.phar
# php-cs-fixer url
url_php_cs_fixer=https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/download/v3.38.2/php-cs-fixer.phar
sha_php_cs_fixer=cb839aee98c0f8928a5449a921c3e70b5b3fea3f15cda5e8f736da32a6b99ddd

## CiviCRM
##########
Expand Down
Loading