Skip to content

Commit 93a7bc8

Browse files
authored
Merge pull request #23 from oracle-devrel/bbcloud
thank you @ashok-cm
2 parents 41319c6 + 3f00214 commit 93a7bc8

18 files changed

+132
-1
lines changed

oci-coderepo-examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ All about OCI devops coderepo samples ..
44
<details>
55
<summary>Integration with external code repos. - click to expand</summary>
66

7+
* [Integrate Bitbucket.org repo with OCI Devops .](./oci-devops-coderepo-with-bitbucketcloud/)
78
* [Integrate GITHUB.com repo with OCI Devops .](./oci-devops-coderepo-with-github/)
89
* [Integrate GITLAB.com repo with OCI Devops .](./oci-devops-coderepo-with-gitlab/)
910

1011
</details>
1112

1213

13-
1414
### Back to examples.
1515
----
1616

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea
2+
.DS_Store
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
A sample illustration of [Bitbucket Cloud ](https://bitbucket.org/product?&aceid=&adposition=&adgroup=92542404895&campaign=1407242867&creative=544605032325&device=c&keyword=bitbucket%20cloud&matchtype=e&network=g&placement=&ds_kids=p51241240716&ds_e=GOOGLE&ds_eid=700000001551985&ds_e1=GOOGLE&gclid=EAIaIQobChMIsa_OyLy--AIV8pJmAh079go-EAAYASAAEgLsifD_BwE&gclsrc=aw.ds) code repo integration with OCI DevOps.
2+
3+
--------
4+
5+
#### Objectives
6+
7+
- Create an APP Password on Bitbucket Cloud.
8+
- Create vault, and policies accordingly.
9+
- Create a DevOps connection and integrate it with OCI.
10+
- Test and validate the integrations.
11+
12+
* Specific instruction to clone only this example.
13+
14+
```
15+
$ git init oci-devops-coderepo-with-bitbucketcloud
16+
$ cd oci-devops-coderepo-with-bitbucketcloud
17+
$ git remote add origin https://github.com/oracle-devrel/oci-devops-examples
18+
$ git config core. sparsecheckout true
19+
$ echo "oci-coderepo-examples/oci-devops-coderepo-with-bitbucketcloud/*">>.git/info/sparse-checkout
20+
$ git pull --depth=1 origin main
21+
22+
```
23+
24+
#### Procedure
25+
26+
- Follow Bitbucket Cloud documentation and do a sign-in. - https://bitbucket.org/product/guides
27+
- Click `profile` on the top right corner and click `Personal Setting`.
28+
29+
![](images/bitbucket_profile.png)
30+
31+
- User `Personal Setting` > make a note of your `user name`.
32+
33+
![](images/bitbucket_username.png)
34+
35+
- In the `left-side menu`, click `App passwords` and then click Create app password.
36+
- Enter a `Label (name)` for the password.
37+
- Select the following checkboxes for Permissions:
38+
- Account: Read
39+
- Workspace membership: Read
40+
- Projects: Read
41+
- Pull requests: Read
42+
- Webhooks: Read and write
43+
44+
![](images/bitbucketpat.png)
45+
- Click Create.
46+
- Copy the app password immediately to a secure location, because you cannot retrieve it again after you navigate away from the page.
47+
48+
- To securely store and orchestrate Gitlab Personal Access token, we will create a new OCI Vault for now.
49+
50+
- Create a new vault under the concerned compartment. - https://docs.oracle.com/en-us/iaas/Content/KeyManagement/Concepts/keyoverview.htm#Overview_of_Vault
51+
52+
![](images/new_vault.png)
53+
54+
- Create a new `Encryption Key`.
55+
56+
![](images/vault_key.png)
57+
58+
- Create a new secret and store the Bitbucket Cloud App password.
59+
60+
![](images/bb_app_password.png)
61+
62+
- Create a `Dynamic group` with the below rules.
63+
64+
```
65+
ALL {resource.type = 'devopsconnection', resource.compartment.id = 'ocid1.compartment.oc1..xxxxx'}
66+
```
67+
68+
- Create a policy (Ensure to create it under the ROOT of tenancy) for the dynamic groups with the below policy statement.
69+
70+
```
71+
Allow dynamic-group mr-devops-policy-checker-dg-connection to read secret-family in compartment <compartment name>
72+
Allow dynamic-group mr-devops-policy-checker-dg-connection to use ons-topics in compartment <compartment name>
73+
```
74+
75+
- Create a notification topic, that will be used for DevOps - https://docs.oracle.com/en-us/iaas/Content/Notification/Tasks/managingtopicsandsubscriptions.htm#createTopic
76+
77+
![](images/oci-notifications.png)
78+
79+
80+
- Create a DevOps project - https://docs.oracle.com/en-us/iaas/Content/devops/using/create_project.htm#create_a_project
81+
- Ensure to associate it with a `notification topic` created.
82+
83+
![](images/devops_project.png)
84+
85+
- Under the project click `Enable Logging` and `toggle` and enable the logs.
86+
87+
![](images/enable_logging.png)
88+
89+
- Select the logging details and enable.
90+
91+
- Create a new `external connection` - https://docs.oracle.com/en-us/iaas/Content/devops/using/create_connection.htm
92+
93+
![](images/devops_ec1.png)
94+
95+
- Select the type as `Bitbucket Cloud`.
96+
- Provide the `Bitbucket username ` as the username.
97+
- Associate with the Vault and the `Secret` created
98+
99+
![](images/devops_ec2.png)
100+
101+
- Use DevOps `Code Repositories` and mirror Bitbucket Cloud to oci DevOps. - https://docs.oracle.com/en-us/iaas/Content/devops/using/mirror_repo.htm
102+
103+
![](images/devops_mirror_repo.png)
104+
105+
106+
- Select the external connection created and select the Bitbucket Cloud repository. You may mention a custom name (as optional) which will be used when the external repo is cloned to the OCI Code repo.
107+
- You may alter the Scheduling type to a custom value if needed. The default sync is `15 minutes`.
108+
109+
![](images/create_mirror_repo.png)
110+
111+
- After a while, the repo will be available via `OCI Code Repo`
112+
113+
![](images/mirror_progress.png)
114+
115+
![](images/repo_mirror_completed.png)
116+
117+
Contributors
118+
===========
119+
120+
- Author: Rahul M R.
121+
- Collaborators: NA
122+
- Last release: June 2022
123+
124+
### Back to examples.
125+
----
126+
127+
- 🍿 [Back to OCI Devops Coderepo sample](./../README.md)
128+
- 🏝️ [Back to OCI Devops sample](./../../README.md)
129+
101 KB
Loading
26.2 KB
Loading
72.5 KB
Loading
106 KB
Loading
164 KB
Loading
148 KB
Loading
148 KB
Loading

0 commit comments

Comments
 (0)