-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apparently ran the wrong command to restore the scripts
- Loading branch information
Showing
2 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -Eeuo pipefail | ||
|
||
# Install brew locally in the project dir. Packages will also be installed here. | ||
# FIXME: Use brew in supported way. See | ||
# https://docs.brew.sh/Installation#untar-anywhere-unsupported | ||
brew_dir="${CI_PROJECT_DIR}/.brew" | ||
|
||
if [ ! -e "${brew_dir}" ]; then | ||
mkdir -p "${brew_dir}" | ||
curl --fail -L "https://github.com/Homebrew/brew/archive/refs/tags/${BREW_VERSION}.tar.gz" | tar xz --strip 1 -C "${brew_dir}" | ||
fi | ||
|
||
export PATH="${brew_dir}/bin:${brew_dir}/sbin:$PATH" | ||
|
||
# make sure to not pollute the machine with temp files etc | ||
mkdir -p $CI_PROJECT_DIR/.brew_cache | ||
export HOMEBREW_CACHE=$CI_PROJECT_DIR/.brew_cache | ||
mkdir -p $CI_PROJECT_DIR/.brew_logs | ||
export HOMEBREW_LOGS=$CI_PROJECT_DIR/.brew_logs | ||
mkdir -p /private/tmp/.brew_tmp | ||
export HOMEBREW_TEMP=/private/tmp/.brew_tmp | ||
|
||
# update and install packages | ||
brew update | ||
brew install ${1+"$@"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Common bash utilities | ||
# ---------------------- | ||
|
||
# Colors | ||
BLACK="0;30" | ||
GRAY="1;30" | ||
RED="0;31" | ||
LT_RED="1;31" | ||
BROWN="0;33" | ||
LT_BROWN="1;33" | ||
GREEN="0;32" | ||
LT_GREEN="1;32" | ||
BLUE="0;34" | ||
LT_BLUE="1;34" | ||
PURPLE="0;35" | ||
LT_PURPLE="1;35" | ||
CYAN="0;36" | ||
LT_CYAN="1;36" | ||
WHITE="1;37" | ||
LT_GRAY="0;37" | ||
|
||
# GitLab Pipelines log section delimiters | ||
# https://gitlab.com/gitlab-org/gitlab-foss/issues/14664 | ||
start_section() { | ||
name="$1" | ||
echo -e "section_start:$(date +%s):$name\015\033[0K" | ||
} | ||
|
||
end_section() { | ||
name="$1" | ||
echo -e "section_end:$(date +%s):$name\015\033[0K" | ||
} | ||
|
||
echo_color() { | ||
local color="$1" | ||
local msg="$2" | ||
echo -e "\033[${color}m${msg}\033[0m" | ||
} | ||
|
||
error() { echo_color "${RED}" "$1"; } | ||
warn() { echo_color "${LT_BROWN}" "$1"; } | ||
info() { echo_color "${LT_BLUE}" "$1"; } | ||
|
||
fail() { error "error: $1"; exit 1; } | ||
|
||
function run() { | ||
info "Running $*..." | ||
"$@" || ( error "$* failed"; return 1; ) | ||
} |