<commit_before>#!/bin/bash

timestamp() {
  echo $(date +%b\ %d\ %T) $*
}

setup_git() {
  timestamp Setting up git config...
  git config --global push.default matching
  git config --global user.email "<EMAIL>"
  git config --global user.name "<NAME>"
}

update_ice_version() {
  timestamp Updating Dockerfile and commiting...
  sed -i "/ENV\ ICE_VERSION/c\ENV\ ICE_VERSION\ $NEW_VERSION" ice/Dockerfile
  git commit ice/Dockerfile -m "Created new release: $NEW_VERSION"
}

push_to_git() {
  timestamp Commiting to master
  git checkout -b temp
  git branch -f master temp
  git branch -d temp
  git push origin master

  timestamp Creating release tag...
  git tag -m "New version of ICE" "$NEW_VERSION.0"
  git remote rm origin
  git remote add origin https://$GH_TOKEN@github.com/jonbrouse/docker-ice.git > /dev/null 2>&1
  git push --quiet --set-upstream origin
  git push --quiet --set-upstream origin master
  git push --tags
}

setup_git
update_ice_version
push_to_git<commit_msg>Cleaned up build script<commit_after>#!/bin/bash

timestamp() {
  echo $(date +%b\ %d\ %T) $*
}

setup_git() {
  timestamp Setting up git config...
  git config --global push.default matching
  git config --global user.email "<EMAIL>"
  git config --global user.name "<NAME>"
}

update_ice_version() {
  timestamp Updating Dockerfile and commiting...
  sed -i "/ENV\ ICE_VERSION/c\ENV\ ICE_VERSION\ $NEW_VERSION" ice/Dockerfile
  git commit ice/Dockerfile -m "Created new release: $NEW_VERSION"
}

update_master() {
  timestamp Committing to master...
  git checkout -b temp
  git branch -f master temp
  git push origin master
}

create_new_tag() {
  timestamp Creating release tag...
  git tag -m "New version of ICE" "$NEW_VERSION.0"
  git remote rm origin
  git remote add origin https://$GH_TOKEN@github.com/jonbrouse/docker-ice.git > /dev/null 2>&1
  git push --quiet --set-upstream origin
  git push --tags
}

setup_git
update_ice_version
update_master
create_new_tag
{'fraction_non_alphanumeric': 0.11665817626082527, 'fraction_numerical': 0.003056546102903719, 'mean_word_length': 3.4738041002277904, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '186299', 'n_tokens_mistral': 671, 'n_tokens_neox': 644, 'n_words': 216}