generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update already present repositories (#949)
Signed-off-by: Ben Selwyn-Smith <benselwynsmith@googlemail.com>
- Loading branch information
Showing
4 changed files
with
82 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
6 changes: 6 additions & 0 deletions
6
tests/integration/cases/update_local_repositories/modify_clone.sh
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2024 - 2024, Oracle and/or its affiliates. All rights reserved. | ||
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. | ||
|
||
cd output/git_repos/github_com/avaje/avaje-prisms | ||
git tag --delete avaje-prisms-1.1 |
11 changes: 11 additions & 0 deletions
11
tests/integration/cases/update_local_repositories/policy.dl
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* Copyright (c) 2024 - 2024, Oracle and/or its affiliates. All rights reserved. */ | ||
/* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. */ | ||
|
||
#include "prelude.dl" | ||
|
||
Policy("test_policy", component_id, "") :- | ||
check_passed(component_id, "mcn_version_control_system_1"), | ||
is_repo_url(component_id, "https://github.com/avaje/avaje-prisms"). | ||
|
||
apply_policy_to("test_policy", component_id) :- | ||
is_component(component_id, "pkg:maven/io.avaje/avaje-prisms@1.1"). |
31 changes: 31 additions & 0 deletions
31
tests/integration/cases/update_local_repositories/test.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright (c) 2024 - 2024, Oracle and/or its affiliates. All rights reserved. | ||
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. | ||
|
||
description: | | ||
Ensuring previously cloned repositories are updated when newer changes are available at their remote origins. | ||
tags: | ||
- macaron-python-package | ||
- macaron-docker-image | ||
|
||
steps: | ||
- name: Analyze a repository | ||
kind: analyze | ||
options: | ||
command_args: | ||
- -purl | ||
- pkg:maven/io.avaje/avaje-prisms@1.1 | ||
- name: Delete the chosen tag from the repository | ||
kind: shell | ||
options: | ||
cmd: ./modify_clone.sh | ||
- name: Analyze the repository again | ||
kind: analyze | ||
options: | ||
command_args: | ||
- -purl | ||
- pkg:maven/io.avaje/avaje-prisms@1.1 | ||
- name: Run macaron verify-policy to verify version control check which will only pass if the tag is found | ||
kind: verify | ||
options: | ||
policy: policy.dl |