diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..7026bdb096f878178bf8f8a5bb8d5a4a37d802a3 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,14 @@ +before_script: + - echo "Before script section" + +after_script: + - echo "After script section" + +build: + stage: build + script: + - cd scripts + - bash ./archive_all_files.sh + artifacts: + paths: + - scripts/archive.tar.* diff --git a/scripts/archive_all_files.sh b/scripts/archive_all_files.sh new file mode 100644 index 0000000000000000000000000000000000000000..8adc1cc2bfc90af31ac5929e1ea9cec4e5a73827 --- /dev/null +++ b/scripts/archive_all_files.sh @@ -0,0 +1,29 @@ +#!/bin/bash +CHARACTER_LIMIT=80000 + +file_number=1 +total_chars=0 +rm -f archive.tar.part* +for line in $(find `pwd` -name "*.*" | grep -v '/archives/' | grep -v *.md | grep -v *.sh); do + input_file_name=$(echo "$line" | sed -E 's/^.*\/scripts\///') + chars=$(wc -c $line | cut -d' ' -f 1) + archive_header='"#archive '$input_file_name'"' + archive_header_character_count=$(echo $archive_header | wc -c) + if (( $total_chars + $archive_header_character_count + $chars > $CHARACTER_LIMIT )); then + file_number=$(( $file_number + 1 )) + total_chars=0 + else + total_chars=$(( $total_chars + $chars + $archive_header_character_count + 1 )) + fi + + output_file_name=archive.tar.part$file_number + echo -e $archive_header >> $output_file_name + cat $line >> $output_file_name + echo -e "\n" >> $output_file_name +done + + + + + +