File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ if __name__ == '__main__':
5656 if rc != 0 :
5757 raise Exception ('Could not extract git archive' )
5858 dockerfile = os .path .join (temp_dir , 'Dockerfile' )
59+ procfile = os .path .join (temp_dir , 'Procfile' )
5960 # pull config to be used during build
6061 body = {}
6162 body ['receive_user' ], body ['receive_repo' ] = user , app
@@ -113,6 +114,18 @@ if __name__ == '__main__':
113114 body ['receive_user' ] = user
114115 body ['receive_repo' ] = app
115116 body ['image' ] = target_image
117+ # use sha of master
118+ with open (os .path .join (repo_dir , 'refs/heads/master' )) as f :
119+ body ['sha' ] = f .read ().strip ('\n ' )
120+ # extract the Procfile and convert to JSON
121+ if os .path .exists (procfile ):
122+ with open (procfile ) as f :
123+ raw_procfile = f .read ()
124+ body ['procfile' ] = json .dumps (yaml .safe_load (raw_procfile ))
125+ # extract Dockerfile
126+ if os .path .exists (dockerfile ):
127+ with open (dockerfile ) as f :
128+ body ['dockerfile' ] = f .read ()
116129 # trigger build hook
117130 sys .stdout .write ('\n Launching... ' )
118131 sys .stdout .flush ()
You can’t perform that action at this time.
0 commit comments