Skip to content

Commit 7bc6fc6

Browse files
committed
ref(release): return earlier if build pack or dockerfile app is being used
1 parent a6719c4 commit 7bc6fc6

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

rootfs/api/models/release.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ def publish(self, source_version='latest'):
8989
if self.build is None:
9090
raise EnvironmentError('No build associated with this release to publish')
9191

92+
# If the build has a SHA, assume it's from deis-builder and in the deis-registry already
93+
if self.build.dockerfile or self.build.sha:
94+
return
95+
9296
source_image = self.build.image
9397
# return image if it is already in the registry, test host and then host + port
9498
if (
@@ -103,19 +107,17 @@ def publish(self, source_version='latest'):
103107
source_tag = 'git-{}'.format(self.build.sha) if self.build.sha else source_version
104108
source_image = "{}:{}".format(source_image, source_tag)
105109

106-
# If the build has a SHA, assume it's from deis-builder and in the deis-registry already
107-
if not self.build.dockerfile and not self.build.sha:
108-
# gather custom login information for registry if needed
109-
auth = None
110-
if self.config.registry.get('username', None):
111-
auth = {
112-
'username': self.config.registry.get('username', None),
113-
'password': self.config.registry.get('password', None),
114-
'email': self.owner.email
115-
}
116-
117-
deis_registry = bool(self.build.sha)
118-
publish_release(source_image, self.image, deis_registry, auth)
110+
# gather custom login information for registry if needed
111+
auth = None
112+
if self.config.registry.get('username', None):
113+
auth = {
114+
'username': self.config.registry.get('username', None),
115+
'password': self.config.registry.get('password', None),
116+
'email': self.owner.email
117+
}
118+
119+
deis_registry = bool(self.build.sha)
120+
publish_release(source_image, self.image, deis_registry, auth)
119121

120122
def previous(self):
121123
"""

0 commit comments

Comments
 (0)