def check_existens_of_staging_tag_in_remote_repo():
        """
        This method will check, if the given tag exists as a staging tag in the remote repository.

        The intention is, that every tag, which should be deployed on a production envirnment,
        has to be deployed on a staging environment before.
        """
        staging_tag = Git.create_git_version_tag(APISettings.GIT_STAGING_PRE_TAG)

        command_git = 'git ls-remote -t'
        command_awk = 'awk \'{print $2}\''
        command_cut_1 = 'cut -d \'/\' -f 3'
        command_cut_2 = 'cut -d \'^\' -f 1'
        command_sort = 'sort -b -t . -k 1,1nr -k 2,2nr -k 3,3r -k 4,4r -k 5,5r'
        command_uniq = 'uniq'

        command = command_git + ' | ' + command_awk + ' | ' + command_cut_1 + ' | ' + \
                  command_cut_2 + ' | ' + command_sort + ' | ' + command_uniq

        list_of_tags = str(check_output(command, shell=True))

        if staging_tag in list_of_tags:
            return True
        return False
def check_existens_of_staging_tag_in_remote_repo ( ) : staging_tag = Git . create_git_version_tag ( APISettings . GIT_STAGING_PRE_TAG ) command_git = 'git ls-remote -t' command_awk = 'awk \'{print $2}\'' command_cut_1 = 'cut -d \'/\' -f 3' command_cut_2 = 'cut -d \'^\' -f 1' command_sort = 'sort -b -t . -k 1,1nr -k 2,2nr -k 3,3r -k 4,4r -k 5,5r' command_uniq = 'uniq' command = command_git + ' | ' + command_awk + ' | ' + command_cut_1 + ' | ' + command_cut_2 + ' | ' + command_sort + ' | ' + command_uniq list_of_tags = str ( check_output ( command , shell = True ) ) if staging_tag in list_of_tags : return True return False
This method will check, if the given tag exists as a staging tag in the remote repository.

        The intention is, that every tag, which should be deployed on a production envirnment,
        has to be deployed on a staging environment before.