Esempio n. 1
0
 def create_git_version_tag(deploy_tag):
     if deploy_tag != '':
         deploy_tag += '-'
     return str(deploy_tag + 'v' + Version.get_version())
Esempio n. 2
0
    def handle(self, *args, **options):

        """
        Check, how much options are true.
        If option '--force', '-f' is set this part will be skipped.
        """
        if not options['force']:
            counter = 0
            for key in options:
                if options[key]:
                    counter += 1

            # If no options are set, do a normal patch
            if counter == 1:
                options['patch'] = True

            # more then one options are not enabled per default
            if counter >= 3:
                # TODO: Raise Error!
                exit('It is not recommended to use more then one parameter. Use -f to force your command.')
        ###########################################################################################

        if options['major']:
            Version.set_major()

        if options['minor']:
            Version.set_minor()

        if options['patch']:
            Version.set_patch()

        if options['dev']:
            Version.set_patch(Version.DEV)

        if options['alpha']:
            Version.set_patch(Version.ALPHA)

        if options['beta']:
            Version.set_patch(Version.BETA)

        if options['rc']:
            Version.set_patch(Version.RC)

        """
        Automatic commands.
        Depends on User Settings.
        """
        if APISettings.PATCH_AUTO_COMMIT:
            Git.add()
            Git.commit()

        if APISettings.PATCH_AUTO_TAG:
            Git.tag()
            if APISettings.PATCH_AUTO_TAG_PUSH:
                Git.push_tags()