]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
Rename curr_commit_id to curr_commit_hexsha.
authorBenjamin Drung <benjamin.drung@profitbricks.com>
Wed, 5 Mar 2014 12:29:52 +0000 (13:29 +0100)
committerBenjamin Drung <benjamin.drung@profitbricks.com>
Wed, 5 Mar 2014 12:29:52 +0000 (13:29 +0100)
debian_build.py

index 53d1832fb89fe797eb610adb581722f4fd235c33..7dbe9baef36df044ddf237a6bb61e5153a95fb27 100755 (executable)
@@ -155,10 +155,10 @@ if __name__ == '__main__':
         curr_commit = gitrepo.commit(remote_branch)
         # id attribute used in python-git 0.3.2~RC1-1 found in wheezy
         if hasattr(curr_commit, 'hexsha'):
-            curr_commit_id = curr_commit.hexsha
+            curr_commit_hexsha = curr_commit.hexsha
         # id attribute used in python-git 0.1.6-1 found in squeeze
         elif hasattr(curr_commit, 'id'):
-            curr_commit_id = curr_commit.id
+            curr_commit_hexsha = curr_commit.id
     except Exception as error:
         logger.error('Failed to find commit for {input}'.format(input=remote_branch))
         exit_error()
@@ -211,7 +211,7 @@ if __name__ == '__main__':
                     tagged_commit_hexsha = tagged_commit.hexsha
                 else:
                     tagged_commit_hexsha = tagged_commit.id
-                if tagged_commit_hexsha == curr_commit_id:
+                if tagged_commit_hexsha == curr_commit_hexsha:
                     message = 'Tag {name} was already created for commit {sha}.'.format(
                         name=remote_tag[0].name,
                         sha=tagged_commit[0:7],
@@ -239,7 +239,7 @@ if __name__ == '__main__':
             version=curr_version,
             date=daily_date,
             build=ENV['BUILD_NUMBER'],
-            commit=curr_commit_id[0:7],
+            commit=curr_commit_hexsha[0:7],
             suffix=options.version_suffix,
         )
         pb_suite = 'develop-{dist}'.format(dist=curr_dist)
@@ -266,7 +266,7 @@ if __name__ == '__main__':
             version=curr_version,
             date=daily_date,
             build=ENV['BUILD_NUMBER'],
-            commit=curr_commit_id[0:7],
+            commit=curr_commit_hexsha[0:7],
             suffix=options.version_suffix,
         )
         reprepro_base = '/srv/dev-{dist}'.format(dist=curr_dist)
@@ -282,12 +282,13 @@ if __name__ == '__main__':
     #if GIT_REPO_PATH.startswith('/srv/git/dev/'):
     #    if ENV['GIT_BRANCH_NAME'] == 'pre-staging':
     #        version = '%s~develop%s+%s+%s' %(version, daily_date, BUILD_NUMBER,
-    #                                         curr_commit_id[0:7])
+    #                                         curr_commit_hexsha[0:7])
     #        changelog_distro = 'pre-staging'
     #    else:
     #        # use shorter date because we can
     #        daily_date = datetime.datetime.now().strftime('%Y%m%d')
-    #        version = '%s~alpha%s+%s+%s' %(version, daily_date, BUILD_NUMBER, curr_commit_id[0:7])
+    #        version = '%s~alpha%s+%s+%s' %(version, daily_date, BUILD_NUMBER,
+    #                                       curr_commit_hexsha[0:7])
     #        changelog_distro = 'unstable'
 
     # create dput object with data gathered from reprepro_base defined above
@@ -453,7 +454,7 @@ if __name__ == '__main__':
             '--no-auto-nmu',
             '--',
             'Generated by Jenkins build of commit {commit}'.format(
-                commit=curr_commit_id[0:7],
+                commit=curr_commit_hexsha[0:7],
             ),
         ]
 
@@ -509,7 +510,7 @@ if __name__ == '__main__':
         dist=curr_dist,
         arch='amd64',
         pb_suite=pb_suite,
-        git_commit_id=curr_commit_id[0:7],
+        git_commit_id=curr_commit_hexsha[0:7],
     )
     if ret == 0:
         logger.info('Current environment:\n\n{env}\n'.format(env=builder.env))