Commit dab33c11 authored by Jyotish P's avatar Jyotish P
Browse files

Update submission utlity script

parent 57961dc6
#!/bin/bash
log_info() {
echo -e "\033[0;36m$@\033[0m"
}
log_success() {
echo -e "\033[0;32m$@\033[0m"
}
log_normal() {
echo -e "$@"
}
log_error() {
echo -e "\033[0;31m$@\033[0m"
}
...@@ -53,7 +53,7 @@ setup_commits() { ...@@ -53,7 +53,7 @@ setup_commits() {
REMOTE=$(git remote -v | grep gitlab.aicrowd.com | head -1 | awk '{print $1}') REMOTE=$(git remote -v | grep gitlab.aicrowd.com | head -1 | awk '{print $1}')
TAG=$(echo "$@" | sed 's/ /-/g') TAG=$(echo "$@" | sed 's/ /-/g')
git add --all git add --all
git commit -m "Changes for submission-$TAG" git commit -m "Changes for submission-$TAG" || true # don't exit when no new commits are there
git tag -am "submission-$TAG" "submission-$TAG" || (log_error "There is another submission with the same description. Please give a different description." && exit 1) git tag -am "submission-$TAG" "submission-$TAG" || (log_error "There is another submission with the same description. Please give a different description." && exit 1)
git push -f $REMOTE master git push -f $REMOTE master
git push -f $REMOTE "submission-$TAG" git push -f $REMOTE "submission-$TAG"
...@@ -62,8 +62,8 @@ setup_commits() { ...@@ -62,8 +62,8 @@ setup_commits() {
submit() { submit() {
check_remote check_remote
setup_lfs setup_lfs "$@"
setup_commits setup_commits "$@"
} }
...@@ -74,3 +74,4 @@ if [[ $# -lt 1 ]]; then ...@@ -74,3 +74,4 @@ if [[ $# -lt 1 ]]; then
fi fi
submit "$@" submit "$@"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment