Skip to content

Commit 433ec0c

Browse files
committed
chore: minor script tidies
1 parent 1003b30 commit 433ec0c

3 files changed

Lines changed: 26 additions & 20 deletions

File tree

provision/provision-common.sh

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env bash
22

3-
set -e
4-
53
#####################################################################
64
# These are functions shared by both CentOS and Ubuntu provisioners #
75
#####################################################################
@@ -21,7 +19,7 @@ function add_gocd_user() {
2119
}
2220

2321
function setup_nexus_configs() {
24-
if [ "${SKIP_INTERNAL_CONFIG}" != "yes" ]; then
22+
if [ "${SKIP_INTERNAL_CONFIG:-}" != "yes" ]; then
2523
copy_to_home_dir init.gradle .gradle/init.gradle
2624
copy_to_home_dir settings.xml .m2/settings.xml
2725
copy_to_home_dir bundle-config .bundle/config
@@ -31,7 +29,7 @@ function setup_nexus_configs() {
3129
}
3230

3331
function setup_git_config() {
34-
if [ "${SKIP_INTERNAL_CONFIG}" != "yes" ]; then
32+
if [ "${SKIP_INTERNAL_CONFIG:-}" != "yes" ]; then
3533
copy_to_home_dir gitconfig .gitconfig
3634
fi
3735
}
@@ -40,42 +38,49 @@ function setup_git_config() {
4038
function install_mise_tools() {
4139
copy_to_home_dir "${1}" .config/mise/config.toml
4240
try su - "${PRIMARY_USER}" -c "curl https://mise.run | sh"
43-
try su - "${PRIMARY_USER}" -c "mise settings ruby.compile=false && GITHUB_TOKEN=\$(cat /run/secrets/github_token) mise install"
44-
try su - "${PRIMARY_USER}" -c "echo 'export PATH=\"\$HOME/.local/share/mise/shims:\$PATH\"' >> ~/.bashrc"
41+
try su - "${PRIMARY_USER}" -c "mise settings ruby.compile=false && GITHUB_TOKEN=\$(cat /run/secrets/github_token) CLICOLOR_FORCE=1 mise install"
42+
try su - "${PRIMARY_USER}" -c "echo 'export PATH=\"\$HOME/.local/share/mise/shims:\$PATH\"' | tee -a ~/.bashrc ~/.profile"
4543
try su - "${PRIMARY_USER}" -c "ln -s ~/.local/share/mise ~/.asdf" # Workaround lack of Gradle support for discovering mise toolchains https://github.com/gradle/gradle/issues/29355
4644
}
4745

4846
# helpers
4947

5048
function print_versions_summary() {
51-
try su - "${PRIMARY_USER}" -c "mise ls"
5249
green "$(try su - "${PRIMARY_USER}" <<-EOF
5350
printf "\n"
5451
printf "//////////////////////////////\n"
5552
printf "// Package versions summary //\n"
5653
printf "//////////////////////////////\n"
5754
printf "\n"
5855
59-
printf "git version:\n"
60-
git --version | pr -to 2
56+
printf "mise summary:\n"
57+
mise list | pr -to 2
6158
printf "\n"
6259
63-
printf "ruby version:\n"
64-
ruby --version | pr -to 2
65-
printf "\n"
66-
67-
printf "node version:\n"
68-
node --version | pr -to 2
60+
printf "git version:\n"
61+
git --version | pr -to 2
6962
printf "\n"
7063
7164
printf "aws version:\n"
7265
aws --version | pr -to 2
7366
printf "\n"
7467
75-
printf "Installed JDKs:\n"
76-
mise list java
68+
printf "ruby version:\n"
69+
ruby --version | pr -to 2
7770
printf "\n"
7871
72+
if type node &> /dev/null; then
73+
printf "node version:\n"
74+
node --version | pr -to 2
75+
printf "\n"
76+
fi
77+
78+
if type yarn &> /dev/null; then
79+
printf "yarn version:\n"
80+
yarn --version | pr -to 2
81+
printf "\n"
82+
fi
83+
7984
if type gauge &> /dev/null; then
8085
printf "gauge version:\n"
8186
gauge -v | pr -to 2

provision/provision-rhelcompat.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/usr/bin/env bash
2+
set -euo pipefail
23

34
PRIMARY_USER="go"
45
GRADLE_OPTIONS="--stacktrace --no-daemon"
56

67
for arg in $@; do
78
case $arg in
89
--contrib)
9-
PRIMARY_USER="dojo"
1010
SKIP_INTERNAL_CONFIG="yes"
1111
shift
1212
;;
@@ -45,11 +45,11 @@ function provision() {
4545

4646
step install_installer_tools
4747

48+
# For functional tests
4849
step install_postgresql "15" "16" "17" "18"
49-
5050
step install_firefox
5151

52-
if [ "${SKIP_INTERNAL_CONFIG}" != "yes" ]; then
52+
if [ "${SKIP_INTERNAL_CONFIG:-}" != "yes" ]; then
5353
step install_docker
5454
fi
5555

provision/provision-ubuntu.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
set -euo pipefail
23

34
PRIMARY_USER="go"
45

0 commit comments

Comments
 (0)