-
Notifications
You must be signed in to change notification settings - Fork 56
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
build content docs - in gitlab #1619
base: master
Are you sure you want to change the base?
Changes from all commits
6cf39f7
934b72f
a11a85a
fa2d74b
936a4e2
57a341b
222649d
97a8bbe
495da0a
f0ff634
aa3653a
dba1e3e
e237657
69988ac
9de50c7
eeab2eb
c69582c
1eec8f0
3d3c448
ccca6d0
10a66fd
e602588
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
variables: | ||
CURRENT_BRANCH_NAME: infra-content-docs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should it be master? |
||
|
||
include: | ||
- file: "/.gitlab/ci/content-docs/.gitlab-ci.yml" | ||
ref: infra-content-docs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same ☝️ |
||
project: "${CI_PROJECT_NAMESPACE}/infra" | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,81 @@ | ||||||||||||||||||
#!/bin/bash | ||||||||||||||||||
|
||||||||||||||||||
CYAN="\e[0;36m" | ||||||||||||||||||
CLEAR="\e[0m" | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Couldn't be in the end since we use it in line 5 |
||||||||||||||||||
SECTION_START="\e[0Ksection_start:the_time:section_id\r\e[0K${CYAN}section_header${CLEAR}" | ||||||||||||||||||
SECTION_END="\e[0Ksection_end:the_time:section_id\r\e[0K" | ||||||||||||||||||
RED='\033[0;31m' | ||||||||||||||||||
GREEN='\033[0;32m' | ||||||||||||||||||
BLUE='\033[0;34m' | ||||||||||||||||||
NC='\033[0m' | ||||||||||||||||||
|
||||||||||||||||||
section_start() { | ||||||||||||||||||
local section_header section_id start | ||||||||||||||||||
start="$SECTION_START" | ||||||||||||||||||
if [[ "$#" -eq 1 ]]; then | ||||||||||||||||||
section_header="$1" | ||||||||||||||||||
section_id="$(echo "$1" | tr -c '[:alnum:]\n\r' '_')" | ||||||||||||||||||
elif [[ "$#" -eq 2 ]]; then | ||||||||||||||||||
if [[ "$2" =~ -{0,2}collapsed ]]; then | ||||||||||||||||||
start="${start/section_id/section_id[collapsed=true]}" | ||||||||||||||||||
section_header="$1" | ||||||||||||||||||
section_id="$(echo "$1" | tr -c '[:alnum:]\n\r' '_')" | ||||||||||||||||||
else | ||||||||||||||||||
section_header="$2" | ||||||||||||||||||
section_id="$1" | ||||||||||||||||||
fi | ||||||||||||||||||
elif [[ "$#" -eq 3 && "$3" =~ /^-{0,2}collapsed$/ ]]; then | ||||||||||||||||||
start="${start/section_id/section_id[collapsed=true]}" | ||||||||||||||||||
section_header="$2" | ||||||||||||||||||
section_id="$1" | ||||||||||||||||||
else | ||||||||||||||||||
echo "section_start should be called with 1-3 args but it was called with $#" | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
echo "acceptable usages:" | ||||||||||||||||||
echo " 1. section_start \"<section-start-id>\" \"<section-header>\"" | ||||||||||||||||||
echo " 2. section_start \"<section-header>\"" | ||||||||||||||||||
echo " 3. section_start \"<section-start-id>\" \"<section-header>\" --collapse" | ||||||||||||||||||
echo " 4. section_start \"<section-header>\" --collapse" | ||||||||||||||||||
Comment on lines
+34
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest to group by functionality
Suggested change
|
||||||||||||||||||
echo "where <section-start-id> is only alphanumeric characters and underscore and" | ||||||||||||||||||
echo "--collapse indicates that you would like those log steps to be collapsed in the job log output by default" | ||||||||||||||||||
exit 9 | ||||||||||||||||||
fi | ||||||||||||||||||
start_time=$(date +%s) | ||||||||||||||||||
start="$(echo "$start" | sed -e "s/the_time/$start_time/" -e "s/section_id/$section_id/" -e "s/section_header/$section_header/")" | ||||||||||||||||||
echo -e "$start" | ||||||||||||||||||
date +"[%Y-%m-%dT%H:%M:%S.%3N] section start" | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||
} | ||||||||||||||||||
|
||||||||||||||||||
section_end() { | ||||||||||||||||||
local section_id end | ||||||||||||||||||
date +"[%Y-%m-%dT%H:%M:%S.%3N] section end" | ||||||||||||||||||
end="$SECTION_END" | ||||||||||||||||||
if [[ "$#" -eq 1 ]]; then | ||||||||||||||||||
section_id="$(echo "$1" | tr -c '[:alnum:]\n\r' '_')" | ||||||||||||||||||
else | ||||||||||||||||||
echo "section_end should be called with 1 arg but it was called with $#" | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
echo "acceptable usage:" | ||||||||||||||||||
echo " 1. section_end \"<section-start-id>\"" | ||||||||||||||||||
echo " 2. section_start \"<section-header>\"" | ||||||||||||||||||
echo "where <section-start-id> or <section-header> is that of the section this marks the end of" | ||||||||||||||||||
exit 9 | ||||||||||||||||||
fi | ||||||||||||||||||
end_time=$(date +%s) | ||||||||||||||||||
end="$(echo "$end" | sed -e "s/the_time/$end_time/" -e "s/section_id/$section_id/")" | ||||||||||||||||||
echo -e "$end" | ||||||||||||||||||
} | ||||||||||||||||||
|
||||||||||||||||||
job-done() { | ||||||||||||||||||
mkdir -p "${PIPELINE_JOBS_FOLDER}" | ||||||||||||||||||
echo "creating file ${PIPELINE_JOBS_FOLDER}/${CI_JOB_NAME}.txt" | ||||||||||||||||||
echo "done" > "${PIPELINE_JOBS_FOLDER}/${CI_JOB_NAME}.txt" | ||||||||||||||||||
echo "finished writing to file ${PIPELINE_JOBS_FOLDER}/${CI_JOB_NAME}.txt" | ||||||||||||||||||
} | ||||||||||||||||||
|
||||||||||||||||||
sleep-with-progress() { | ||||||||||||||||||
local sleep_time=${1:-10} | ||||||||||||||||||
local sleep_interval=${2:-1} | ||||||||||||||||||
local sleep_message=${3:-"Sleeping... "} | ||||||||||||||||||
local columns=${4:-$(tput cols)} | ||||||||||||||||||
local sleep_step=$((sleep_time / sleep_interval)) | ||||||||||||||||||
for ((i=0; i< sleep_step;i++)); do echo "${sleep_interval}";sleep "${sleep_interval}"; done | poetry run tqdm --total ${sleep_time} --unit seconds --leave --update --colour green -ncols ${columns} --desc "${sleep_message}" 1> /dev/null | ||||||||||||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this
YnVpbGQ
magic value?