Skip to content

Commit 0040e50

Browse files
authored
Fix ISV-2905 - enable git operations on unowned repository (#451)
* Add git config to pinning step to enable operations on unowned repo --------- Co-authored-by: Tomas Man <[email protected]>
1 parent 0def94b commit 0040e50

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

ansible/roles/operator-pipeline/templates/openshift/tasks/digest-pinning.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ spec:
7373
exit 0
7474
fi
7575
76+
# configure git to enable operations on unowned repository
77+
git config --global --add safe.directory $(workspaces.source.path)
78+
7679
cat replacements.json
7780
REPLACEMENT_COUNT=$(jq length replacements.json)
7881

docs/ci-cd.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,23 @@ ansible-pull \
4949
ansible/playbooks/operator-pipeline-integration-tests.yml
5050
```
5151

52+
To manually run the integration tests from the local environment:
53+
- prerequisites:
54+
- logged-in to OC cluster
55+
- export NAMESPACE - new is created if not exist,
56+
careful for duplicity (can override existing projects)
57+
- SSH key need to be set in GitHub account for local user
58+
(Ansible use SSH to clone/manipulate repositories)
59+
- Python dependencies (mentioned above) need to be installed globally
60+
61+
```bash
62+
ansible-playbook -v \
63+
-i "ansible/inventory/operator-pipeline-integration-tests" \
64+
-e "oc_namespace=$NAMESPACE" \
65+
--vault-password-file $VAULT_PASSWORD_PATH \
66+
ansible/playbooks/operator-pipeline-integration-tests.yml
67+
```
68+
5269
Tags can be used to run select portions of the playbook. For example, the test
5370
resources will be cleaned up at the end of every run. Skipping the `clean` tag
5471
will leave the resources behind for debugging.

docs/developer-guide.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ ansible-playbook -v \
7272
--vault-password-file $VAULT_PASSWORD_PATH \
7373
ansible/playbooks/deploy.yml
7474
```
75-
75+
#### Integration tests
76+
See [integration tests section in ci-cd.md](ci-cd.md#integration-tests)
7677
#### Install tkn
7778

7879
You should install the [tkn](https://docs.openshift.com/container-platform/4.7/cli_reference/tkn_cli/installing-tkn.html)

0 commit comments

Comments
 (0)