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

Rename local config file to install.local.cfg #75

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
4 changes: 2 additions & 2 deletions .github/workflows/shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ jobs:

- name: Set local config
run: |
cp cfg/install.cfg cfg/install.local
cp cfg/install.cfg cfg/install.local.cfg
sed -ri \
-e 's@^(civi_db_user_name)=.*$@\1=db_admin@' \
-e 's@^(civi_db_user_pass)=.*$@\1=admin@' \
-e 's@^(civi_domain)=.*$@\1=civi.local.com@' \
cfg/install.local
cfg/install.local.cfg

- name: Setup environment
run: ./bin/prepare.sh
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
/web/

# Local configs
/cfg/install.local
/cfg/install.local.cfg
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Currently only Ubuntu is supported.
1. Check out repo
1. Config installer
1. Check `cfg/install.cfg` for defaults
1. Duplicate `cfg/install.cfg` and rename to `cfg/install.local`
1. Change relevant configs in `cfg/install.local`
1. Duplicate `cfg/install.cfg` and rename to `cfg/install.local.cfg`
1. Change relevant configs in `cfg/install.local.cfg`
1. Run `bin/prepare.sh`
1. Run `bin/install.sh`, usage:

Expand Down
2 changes: 1 addition & 1 deletion bin/clear-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ base_dir=$(builtin cd "$(dirname "${0}")/.." >/dev/null 2>&1 && pwd)
# shellcheck source=cfg/install.cfg
. "${base_dir}/cfg/install.cfg"
# shellcheck disable=SC1091
[[ -r "${base_dir}/cfg/install.local" ]] && . "${base_dir}/cfg/install.local"
[[ -r "${base_dir}/cfg/install.local.cfg" ]] && . "${base_dir}/cfg/install.local.cfg"

# Parse options
install_dir="${1:-${base_dir}}"
Expand Down
2 changes: 1 addition & 1 deletion bin/dev-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ base_dir=$(builtin cd "$(dirname "${0}")/.." >/dev/null 2>&1 && pwd)
# shellcheck source=cfg/install.cfg
. "${base_dir}/cfg/install.cfg"
# shellcheck disable=SC1091
[[ -r "${base_dir}/cfg/install.local" ]] && . "${base_dir}/cfg/install.local"
[[ -r "${base_dir}/cfg/install.local.cfg" ]] && . "${base_dir}/cfg/install.local.cfg"

# Parse options
install_dir="${1:-${base_dir}}"
Expand Down
2 changes: 1 addition & 1 deletion bin/extension.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ base_dir=$(builtin cd "$(dirname "${0}")/.." >/dev/null 2>&1 && pwd)
# shellcheck source=cfg/install.cfg
. "${base_dir}/cfg/install.cfg"
# shellcheck disable=SC1091
[[ -r "${base_dir}/cfg/install.local" ]] && . "${base_dir}/cfg/install.local"
[[ -r "${base_dir}/cfg/install.local.cfg" ]] && . "${base_dir}/cfg/install.local.cfg"

# Parse options
install_dir="${1?:Install dir missing}"
Expand Down
2 changes: 1 addition & 1 deletion bin/init-test-DB.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ base_dir=$(builtin cd "$(dirname "${0}")/.." >/dev/null 2>&1 && pwd)
# shellcheck source=cfg/install.cfg
. "${base_dir}/cfg/install.cfg"
# shellcheck disable=SC1091
[[ -r "${base_dir}/cfg/install.local" ]] && . "${base_dir}/cfg/install.local"
[[ -r "${base_dir}/cfg/install.local.cfg" ]] && . "${base_dir}/cfg/install.local.cfg"

# Parse options
install_dir="${1:-${base_dir}}"
Expand Down
2 changes: 1 addition & 1 deletion bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ base_dir=$(builtin cd "$(dirname "${0}")/.." >/dev/null 2>&1 && pwd)
# shellcheck source=cfg/install.cfg
. "${base_dir}/cfg/install.cfg"
# shellcheck disable=SC1091
[[ -r "${base_dir}/cfg/install.local" ]] && . "${base_dir}/cfg/install.local"
[[ -r "${base_dir}/cfg/install.local.cfg" ]] && . "${base_dir}/cfg/install.local.cfg"

# Parse options
install_dir="${1:-${base_dir}}"
Expand Down
15 changes: 14 additions & 1 deletion bin/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ base_dir=$(builtin cd "$(dirname "${0}")/.." >/dev/null 2>&1 && pwd)
# shellcheck source=cfg/install.cfg
. "${base_dir}/cfg/install.cfg"
# shellcheck disable=SC1091
[[ -r "${base_dir}/cfg/install.local" ]] && . "${base_dir}/cfg/install.local"
[[ -r "${base_dir}/cfg/install.local.cfg" ]] && . "${base_dir}/cfg/install.local.cfg"

print-header Install Apache...
sudo apt-get --quiet install --yes --no-install-recommends --no-upgrade apache2
Expand All @@ -29,6 +29,10 @@ sudo systemctl enable apache2.service
sudo systemctl restart apache2.service
print-finish

print-header Verify Apache version...
apachectl -V
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 -
Expand Down Expand Up @@ -58,11 +62,20 @@ sudo sed -i \
"/etc/php/${php_version}/mods-available/civi.php.ini"
print-finish

print-header Verify PHP version...
php --version
print-finish

print-status Install PHP tools...
sudo curl -LsS -o "${local_bin}/composer" "${url_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...
composer --version
cv --version
print-finish

exit 0
2 changes: 1 addition & 1 deletion bin/reinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ base_dir=$(builtin cd "$(dirname "${0}")/.." >/dev/null 2>&1 && pwd)
# shellcheck source=cfg/install.cfg
. "${base_dir}/cfg/install.cfg"
# shellcheck disable=SC1091
[[ -r "${base_dir}/cfg/install.local" ]] && . "${base_dir}/cfg/install.local"
[[ -r "${base_dir}/cfg/install.local.cfg" ]] && . "${base_dir}/cfg/install.local.cfg"

# Parse options
install_dir="${1:-${base_dir}}"
Expand Down
2 changes: 1 addition & 1 deletion bin/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ base_dir=$(builtin cd "$(dirname "${0}")/.." >/dev/null 2>&1 && pwd)
# shellcheck source=cfg/install.cfg
. "${base_dir}/cfg/install.cfg"
# shellcheck disable=SC1091
[[ -r "${base_dir}/cfg/install.local" ]] && . "${base_dir}/cfg/install.local"
[[ -r "${base_dir}/cfg/install.local.cfg" ]] && . "${base_dir}/cfg/install.local.cfg"

# Parse options
install_dir="${1?:Install dir missing}"
Expand Down
4 changes: 2 additions & 2 deletions cfg/install.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## ##
## Default configs ##
## All of these options ##
## can be overriden ##
## in install.local ##
## can be overridden ##
## in install.local.cfg ##
##########################

## Services
Expand Down
Loading