Created
          December 19, 2024 10:08 
        
      - 
      
- 
        Save danielmfern/f96dfe0d5077d170fb96df90dc55c099 to your computer and use it in GitHub Desktop. 
  
    
      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
    
  
  
    
  | wfs = [["ac", nil], | |
| ["bk", | |
| [{"workflow_id"=>"image-generate-widths", "conditions"=>{"m"=>"and", "g"=>[{"file_type_in"=>["jpg", "JPG", "jpeg", "JPEG", "png", "PNG"]}]}}, | |
| {"workflow_id"=>"image-generate-marketplaces-bk", | |
| "conditions"=> | |
| {"m"=>"and", | |
| "g"=> | |
| [{"file_type_in"=>["jpg", "JPG", "jpeg", "JPEG", "png", "PNG"]}, | |
| {"filename_does_not_match"=>"M[0-9]{10}-[a-zA-Z]{1,3}[0-9]{0,2}?[a-zA-Z]?_[a-zA-Z]{2}.(jpg|JPG|png|PNG|gif|GIF|webm|WEBM|mp4|MP4|zip|ZIP)"}]}}, | |
| {"workflow_id"=>"video-transcoder", "conditions"=>{"m"=>"and", "g"=>[{"file_type_in"=>["mov", "MOV", "MP4", "mp4"]}]}}]], | |
| ["md", | |
| [{"workflow_id"=>"image-generate-widths", "conditions"=>{"m"=>"and", "g"=>[{"file_type_in"=>["jpg", "JPG", "jpeg", "JPEG", "png", "PNG"]}]}}, | |
| {"workflow_id"=>"image-generate-marketplaces-md", | |
| "conditions"=> | |
| {"m"=>"and", | |
| "g"=> | |
| [{"file_type_in"=>["jpg", "JPG", "jpeg", "JPEG", "png", "PNG"]}, | |
| {"filename_does_not_match"=>"M[0-9]{10}-[a-zA-Z]{1,3}[0-9]{0,2}?[a-zA-Z]?_[a-zA-Z]{2}.(jpg|JPG|png|PNG|gif|GIF|webm|WEBM|mp4|MP4|zip|ZIP)"}]}}, | |
| {"workflow_id"=>"video-transcoder", "conditions"=>{"m"=>"and", "g"=>[{"file_type_in"=>["mov", "MOV", "MP4", "mp4"]}]}}]], | |
| ["lf", | |
| [{"workflow_id"=>"image-generate-widths", "conditions"=>{"m"=>"and", "g"=>[{"file_type_in"=>["jpg", "JPG", "jpeg", "JPEG", "png", "PNG"]}]}}, | |
| {"workflow_id"=>"video-transcoder", "conditions"=>{"m"=>"and", "g"=>[{"file_type_in"=>["mov", "MOV", "MP4", "mp4"]}]}}]], | |
| ["oy", | |
| [{"workflow_id"=>"image-generate-widths", "conditions"=>{"m"=>"and", "g"=>[{"file_type_in"=>["jpg", "JPG", "jpeg", "JPEG", "png", "PNG"]}]}}, | |
| {"workflow_id"=>"image-generate-marketplaces-oy", | |
| "conditions"=> | |
| {"m"=>"and", | |
| "g"=> | |
| [{"file_type_in"=>["jpg", "JPG", "jpeg", "JPEG", "png", "PNG"]}, | |
| {"filename_does_not_match"=>"M[0-9]{10}-[a-zA-Z]{1,3}[0-9]{0,2}?[a-zA-Z]?_[a-zA-Z]{2}.(jpg|JPG|png|PNG|gif|GIF|webm|WEBM|mp4|MP4|zip|ZIP)"}]}}, | |
| {"workflow_id"=>"video-transcoder", "conditions"=>{"m"=>"and", "g"=>[{"file_type_in"=>["mov", "MOV", "MP4", "mp4"]}]}}]], | |
| ["pb", | |
| [{"workflow_id"=>"image-generate-widths", | |
| "conditions"=> | |
| {"m"=>"and", | |
| "g"=>[{"file_type_in"=>["jpg", "JPG", "jpeg", "JPEG", "png", "PNG"]}, {"filename_does_not_match"=>".*.-[aA]19[mM].(mov|MOV|mp4|MP4|jpg|JPG|jpeg|JPEG)"}]}}, | |
| {"workflow_id"=>"image-generate-marketplaces-pb", | |
| "conditions"=> | |
| {"m"=>"and", | |
| "g"=> | |
| [{"file_type_in"=>["jpg", "JPG", "jpeg", "JPEG", "png", "PNG"]}, | |
| {"filename_does_not_match"=>".*.-[aA]19[mM].(mov|MOV|mp4|MP4|jpg|JPG|jpeg|JPEG)"}, | |
| {"filename_does_not_match"=>"M[0-9]{10}-[a-zA-Z]{1,3}[0-9]{0,2}?[a-zA-Z]?_[a-zA-Z]{2}.(jpg|JPG|png|PNG|gif|GIF|webm|WEBM|mp4|MP4|zip|ZIP)"}]}}, | |
| {"workflow_id"=>"image-remove-background", "conditions"=>{"m"=>"and", "g"=>[{"filename_matches"=>".*.-[aA]19[mM].(jpg|jpeg|JPG|JPEG)"}]}}, | |
| {"workflow_id"=>"video-transcoder", "conditions"=>{"m"=>"and", "g"=>[{"file_type_in"=>["mov", "MOV", "MP4", "mp4"]}]}}]], | |
| ["st", | |
| [{"workflow_id"=>"image-generate-widths", "conditions"=>{"m"=>"and", "g"=>[{"file_type_in"=>["jpg", "JPG", "jpeg", "JPEG", "png", "PNG"]}]}}, | |
| {"workflow_id"=>"image-generate-marketplaces-st", | |
| "conditions"=> | |
| {"m"=>"and", | |
| "g"=> | |
| [{"file_type_in"=>["jpg", "JPG", "jpeg", "JPEG", "png", "PNG"]}, | |
| {"filename_does_not_match"=>"M[0-9]{10}-[a-zA-Z]{1,3}[0-9]{0,2}?[a-zA-Z]?_[a-zA-Z]{2}.(jpg|JPG|png|PNG|gif|GIF|webm|WEBM|mp4|MP4|zip|ZIP)"}]}}, | |
| {"workflow_id"=>"video-transcoder", "conditions"=>{"m"=>"and", "g"=>[{"file_type_in"=>["mov", "MOV", "MP4", "mp4"]}]}}]], | |
| ["zh", | |
| [{"workflow_id"=>"image-generate-widths", "conditions"=>{"m"=>"and", "g"=>[{"file_type_in"=>["jpg", "JPG", "jpeg", "JPEG", "png", "PNG"]}]}}, | |
| {"workflow_id"=>"image-generate-marketplaces-zh", | |
| "conditions"=> | |
| {"m"=>"and", | |
| "g"=> | |
| [{"file_type_in"=>["jpg", "JPG", "jpeg", "JPEG", "png", "PNG"]}, | |
| {"filename_does_not_match"=>"M[0-9]{10}-[a-zA-Z]{1,3}[0-9]{0,2}?[a-zA-Z]?_[a-zA-Z]{2}.(jpg|JPG|png|PNG|gif|GIF|webm|WEBM|mp4|MP4|zip|ZIP)"}]}}, | |
| {"workflow_id"=>"video-transcoder", "conditions"=>{"m"=>"and", "g"=>[{"file_type_in"=>["mov", "MOV", "MP4", "mp4"]}]}}]], | |
| ["za", []]] | |
| Current.user = User.first; | |
| wfs.each do |code, wf| | |
| Current.account = Account.find_by(code: code); | |
| Setting.create!(key: 'workflows', value: wf, notes: 'Workflows to be executed on Amanda') | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment