Distgen generated content
This commit is contained in:
parent
92b5488cc0
commit
1357635275
24 changed files with 564 additions and 89 deletions
|
|
@ -84,11 +84,12 @@ function ct_check_envs_set {
|
|||
if [ -n "${filtered_envs##${env_format//VALUE/$value}}" ]; then
|
||||
echo " Value $value is missing from variable $var_name"
|
||||
echo "$filtered_envs"
|
||||
IFS=$old_IFS
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
IFS=$old_IFS
|
||||
done <<< "$(echo "$loop_envs" | grep "$env_filter" | grep -v "^PWD=")"
|
||||
IFS=$old_IFS
|
||||
}
|
||||
|
||||
# ct_get_cid [name]
|
||||
|
|
@ -817,7 +818,7 @@ ct_show_resources()
|
|||
echo "Memory:"
|
||||
free -h
|
||||
echo "Storage:"
|
||||
df -h
|
||||
df -h || :
|
||||
echo "CPU"
|
||||
lscpu
|
||||
}
|
||||
|
|
@ -826,7 +827,7 @@ ct_show_resources()
|
|||
# -----------------------------
|
||||
# Argument: dockerfile - path to a Dockerfile that will be used for building an image
|
||||
# (must work with an application directory called 'app-src')
|
||||
# Argument: app_url - git URI with a testing application
|
||||
# Argument: app_url - git URI with a testing application, supports "@" to indicate a different branch
|
||||
# Argument: body_regexp - PCRE regular expression that must match the response body
|
||||
# Argument: app_dir - name of the application directory that is used in the Dockerfile
|
||||
# Argument: port - Optional port number (default: 8080)
|
||||
|
|
@ -864,7 +865,17 @@ ct_test_app_dockerfile() {
|
|||
echo "Using this Dockerfile:"
|
||||
cat Dockerfile
|
||||
|
||||
if ! git clone "${app_url}" "${app_dir}" ; then
|
||||
# If app_url contains @, the string after @ is considered
|
||||
# as a name of a branch to clone instead of the main/master branch
|
||||
IFS='@' read -ra git_url_parts <<< "${app_url}"
|
||||
|
||||
if [ -n "${git_url_parts[1]}" ]; then
|
||||
git_clone_cmd="git clone --branch ${git_url_parts[1]} ${git_url_parts[0]} ${app_dir}"
|
||||
else
|
||||
git_clone_cmd="git clone ${app_url} ${app_dir}"
|
||||
fi
|
||||
|
||||
if ! $git_clone_cmd ; then
|
||||
echo "ERROR: Git repository ${app_url} cannot be cloned into ${app_dir}."
|
||||
echo "Terminating the Dockerfile build."
|
||||
return 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue