Created
          November 15, 2015 21:32 
        
      - 
      
- 
        Save ViktorOgnev/c5701b0109649e3eccac to your computer and use it in GitHub Desktop. 
    python cleanup gcs repository
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | def cleanup_gcs(): | |
| branches = _get_git_branches() | |
| project_bucket = '{}/{}'.format(env.ci.bucket, env.ci.project) | |
| for obj in local( | |
| 'gsutil ls -R {}'.format(project_bucket), capture=True): | |
| if any([branch in obj for branch in branches]): | |
| continue | |
| else: | |
| local('gsutil -m rm -R {}'.format(obj)) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment