|
| 1 | +# SPDX-License-Identifier: Apache-2.0 |
| 2 | +# |
| 3 | +# http://nexb.com and https://github.com/aboutcode-org/scancode.io |
| 4 | +# The ScanCode.io software is licensed under the Apache License version 2.0. |
| 5 | +# Data generated with ScanCode.io is provided as-is without warranties. |
| 6 | +# ScanCode is a trademark of nexB Inc. |
| 7 | +# |
| 8 | +# You may not use this software except in compliance with the License. |
| 9 | +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 |
| 10 | +# Unless required by applicable law or agreed to in writing, software distributed |
| 11 | +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR |
| 12 | +# CONDITIONS OF ANY KIND, either express or implied. See the License for the |
| 13 | +# specific language governing permissions and limitations under the License. |
| 14 | +# |
| 15 | +# Data Generated with ScanCode.io is provided on an "AS IS" BASIS, WITHOUT WARRANTIES |
| 16 | +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from |
| 17 | +# ScanCode.io should be considered or used as legal advice. Consult an Attorney |
| 18 | +# for any legal advice. |
| 19 | +# |
| 20 | +# ScanCode.io is a free software code scanning tool from nexB Inc. and others. |
| 21 | +# Visit https://github.com/aboutcode-org/scancode.io for support and download. |
| 22 | + |
| 23 | +from scanpipe.pipelines import Pipeline |
| 24 | +from scanpipe.pipes import federatedcode |
| 25 | + |
| 26 | +from minecode_pipelines import pipes |
| 27 | +from minecode_pipelines.pipes import alpine |
| 28 | + |
| 29 | + |
| 30 | +class MineAlpine(Pipeline): |
| 31 | + """ |
| 32 | + Mine all packageURLs from an alpine index and publish them to |
| 33 | + a FederatedCode repo. |
| 34 | + """ |
| 35 | + |
| 36 | + @classmethod |
| 37 | + def steps(cls): |
| 38 | + return ( |
| 39 | + cls.check_federatedcode_eligibility, |
| 40 | + cls.collect_packages_from_alpine, |
| 41 | + cls.delete_cloned_repos, |
| 42 | + ) |
| 43 | + |
| 44 | + def check_federatedcode_eligibility(self): |
| 45 | + """ |
| 46 | + Check if the project fulfills the following criteria for |
| 47 | + pushing the project result to FederatedCode. |
| 48 | + """ |
| 49 | + federatedcode.check_federatedcode_configured_and_available(logger=self.log) |
| 50 | + |
| 51 | + def collect_packages_from_alpine(self): |
| 52 | + self.repos = alpine.collect_packages_from_alpine(logger=self.log) |
| 53 | + |
| 54 | + def delete_cloned_repos(self): |
| 55 | + pipes.delete_cloned_repos(repos=self.repos, logger=self.log) |
0 commit comments