Bulk trigger Specs Scan

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Unresolved
    • None
    • Component/s: Bamboo Specs
    • None

      Summary

      Currently, there's no option to trigger a Specs scan for all repositories which have Specs enabled.

      Suggestion

      Add a feature to bulk trigger the Specs scan for all repositories which have Specs enabled.

      Workaround

      We do have an API that can be used to trigger a scan of the specs stored in a linked repository:
      /rest/api/latest/repository/REPOSITORY_ID/scanNow

      However, it requires the ID of the repository which you want to trigger the specs scan for.

      Since it requires the ID of each repository, we can use the steps below and scripting to trigger the scan for all your globally linked repositories.

       Please note that the script is being provided on a best-effort basis, as this would be out of our scope of support. We have successfully tested it locally, however, it might need some adjustments to work on your environment.

      1. Run the following SQL query against your Bamboo database to obtain the ID of your linked repositories which have Specs enabled. Depending on the DBMS you use, you might need to change from false/true to 0/1. Please note that this includes only Global Linked Repositories:
        select vcs_location_id from vcs_location
        where is_global = true
        and parent_id is NULL
        and marked_for_deletion = false
        and xml_definition_data like '%bamboo.specs.enabled</string><string>true%'
        
      2. Copy the list of IDs returned by the query and paste it on a new file. Each ID should be in a new line. E.g.,
        file.txt
        1081348
        1081347
        1081345
        
      3. Open a terminal in the same folder you've placed your file and run the following command. Please make sure to replace the Bamboo URL, credentials, and file name with the ones from your environment. The script will read each line (which contains a repository id) and trigger the Specs scan for it through the API:
        while read line || [ -n "$line" ];
        do
           curl -u ADMIN:PASSWORD -X POST BAMBOO_URL/rest/api/latest/repository/"$line"/scanNow
        done < FILENAME
        

              Assignee:
              Unassigned
              Reporter:
              Eduardo Collaziol
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: