Skip to content

Commit

Permalink
Merge branch 'develop' into feature/removable/link-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
pellumbbaboci authored Oct 8, 2023
2 parents db894ac + d32f834 commit df1c5d6
Show file tree
Hide file tree
Showing 40 changed files with 325 additions and 389 deletions.
1 change: 1 addition & 0 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
<property name="allowedAnnotations" value="Override,Test,ParameterizedTest,BeforeEach,AfterEach,BeforeAll,AfterAll"/>
</module>
<module name="ModifierOrder"/>
<module name="NeedBracesCheck"/>
</module>
</module>
235 changes: 4 additions & 231 deletions docker/atlassian/atlassian-setup.sh
Original file line number Diff line number Diff line change
@@ -1,52 +1,12 @@
#!/bin/bash
# for configuring instance over script
jira_internal_port=8080
jira_external_port=8081
bamboo_port=8085
bitbucket_port=7990

same_credentials=false

set -e

while true; do
read -p $'Are you using the same Username + Password on all three systems (Jira, Bamboo, Bitbucket)? \n' yn
case $yn in
[Yy]* ) same_credentials=true; break;;
[Nn]* ) same_credentials=false; break;;
* ) echo "Please answer yes or no.";;
esac
done

if [ "$same_credentials" = true ] ; then
echo In order to work, you need to provide the Username and Password of an admin account for Jira, Bamboo and Bitbucket
echo Admin Account for ALL Systems
read -p 'Username: ' all_uservar
read -sp 'Password: ' all_passvar
echo
jira_uservar=$all_uservar
jira_passvar=$all_passvar
bamboo_uservar=$all_uservar
bamboo_passvar=$all_passvar
bitbucket_uservar=$all_uservar
bitbucket_passvar=$all_passvar
else
echo In order to work, you need to provide the Username and Password of an admin account for Jira, Bamboo and Bitbucket
echo Jira Admin Account
read -p 'Username: ' jira_uservar
read -sp 'Password: ' jira_passvar
echo

echo Bamboo Admin Account
read -p 'Username: ' bamboo_uservar
read -sp 'Password: ' bamboo_passvar
echo

echo Bitbucket Admin Account
read -p 'Username: ' bitbucket_uservar
read -sp 'Password: ' bitbucket_passvar
echo
fi
echo In order to work, you need to provide the Username and Password of an admin account for Jira
echo Jira Admin Account
read -p 'Username: ' jira_uservar
read -sp 'Password: ' jira_passvar

# create groups

Expand Down Expand Up @@ -113,190 +73,3 @@ for i in {1..20}; do
}" \
"$jira_group_add_url$group"
done

# Application Links

jira_url="http://localhost:$jira_external_port/rest/applinks/latest/applicationlinkForm/createAppLink"
bamboo_url="http://localhost:$bamboo_port/rest/applinks/latest/applicationlinkForm/createAppLink"
bitbucket_url="http://localhost:$bitbucket_port/rest/applinks/latest/applicationlinkForm/createAppLink"

internal_jira_url="http://jira:$jira_internal_port"
internal_bamboo_url="http://bamboo:$bamboo_port"
internal_bitbucket_url="http://bitbucket:$bitbucket_port"

echo $'\nConfiguring ApplicationLinks'
# Jira
# add link from jira to bitbucket
curl -u "$jira_uservar":"$jira_passvar" \
-s \
--fail \
--show-error \
--header "Content-Type: application/json" \
--request POST \
--data "{
\"applicationLink\": {
\"typeId\": \"stash\",
\"name\": \"LS1 Bitbucket Server\",
\"displayUrl\": \"$internal_bitbucket_url\",
\"rpcUrl\": \"$internal_bitbucket_url\",
\"isPrimary\": true,
\"isSystem\": true
},
\"username\": \"$bitbucket_uservar\",
\"password\": \"$bitbucket_passvar\",
\"customRpcURL\": false,
\"rpcUrl\": \"$internal_jira_url\",
\"createTwoWayLink\": false,
\"configFormValues\": {
\"trustEachOther\": true,
\"shareUserbase\": true
}
}" \
$jira_url
# add link from jira to bamboo
curl -u "$jira_uservar":"$jira_passvar" \
--fail \
--show-error \
--header "Content-Type: application/json" \
--request POST \
--data "{
\"applicationLink\": {
\"typeId\": \"bamboo\",
\"name\": \"LS1 Bamboo Server\",
\"displayUrl\": \"$internal_bamboo_url\",
\"rpcUrl\": \"$internal_bamboo_url\",
\"isPrimary\": true,
\"isSystem\": true
},
\"username\": \"$bamboo_uservar\",
\"password\": \"$bamboo_passvar\",
\"customRpcURL\": false,
\"rpcUrl\": \"$internal_jira_url\",
\"createTwoWayLink\": false,
\"configFormValues\": {
\"trustEachOther\": true,
\"shareUserbase\": true
}
}" \
$jira_url
# Bamboo
# add link from bamboo to bitbucket
curl -u "$bamboo_uservar":"$bamboo_passvar" \
--fail \
--show-error \
--header "Content-Type: application/json" \
--request POST \
--data "{
\"applicationLink\": {
\"typeId\": \"stash\",
\"name\": \"LS1 Bitbucket Server\",
\"displayUrl\": \"$internal_bitbucket_url\",
\"rpcUrl\": \"$internal_bitbucket_url\",
\"isPrimary\": true,
\"isSystem\": true
},
\"username\": \"$bitbucket_uservar\",
\"password\": \"$bitbucket_passvar\",
\"customRpcURL\": false,
\"rpcUrl\": \"$internal_bamboo_url\",
\"createTwoWayLink\": false,
\"configFormValues\": {
\"trustEachOther\": true,
\"shareUserbase\": true
}
}" \
$bamboo_url
# add link from bamboo to jira
curl -u "$bamboo_uservar":"$bamboo_passvar" \
--fail \
--show-error \
--header "Content-Type: application/json" \
--request POST \
--data "{
\"applicationLink\": {
\"typeId\": \"jira\",
\"name\": \"LS1 Jira Server\",
\"displayUrl\": \"$internal_jira_url\",
\"rpcUrl\": \"$internal_jira_url\",
\"isPrimary\": true,
\"isSystem\": true
},
\"username\": \"$jira_uservar\",
\"password\": \"$jira_passvar\",
\"customRpcURL\": false,
\"rpcUrl\": \"$internal_bamboo_url\",
\"createTwoWayLink\": false,
\"configFormValues\": {
\"trustEachOther\": true,
\"shareUserbase\": true
}
}" \
$bamboo_url
#Bitbucket
# add link from bitbucket to jira
curl -u "$bitbucket_uservar":"$bitbucket_passvar" \
--fail \
--show-error \
--header "Content-Type: application/json" \
--request POST \
--data "{
\"applicationLink\": {
\"typeId\": \"jira\",
\"name\": \"LS1 Jira Server\",
\"displayUrl\": \"$internal_jira_url\",
\"rpcUrl\": \"$internal_jira_url\",
\"isPrimary\": true,
\"isSystem\": true
},
\"username\": \"$jira_uservar\",
\"password\": \"$jira_passvar\",
\"customRpcURL\": false,
\"rpcUrl\": \"$internal_bitbucket_url\",
\"createTwoWayLink\": false,
\"configFormValues\": {
\"trustEachOther\": true,
\"shareUserbase\": true
}
}" \
$bitbucket_url
# add link from bitbucket to bamboo
curl -u "$bitbucket_uservar":"$bitbucket_passvar" \
--fail \
--show-error \
--header "Content-Type: application/json" \
--request POST \
--data "{
\"applicationLink\": {
\"typeId\": \"bamboo\",
\"name\": \"LS1 Bamboo Server\",
\"displayUrl\": \"$internal_bamboo_url\",
\"rpcUrl\": \"$internal_bamboo_url\",
\"isPrimary\": true,
\"isSystem\": true
},
\"username\": \"$bamboo_uservar\",
\"password\": \"$bamboo_passvar\",
\"customRpcURL\": false,
\"rpcUrl\": \"$internal_bitbucket_url\",
\"createTwoWayLink\": false,
\"configFormValues\": {
\"trustEachOther\": true,
\"shareUserbase\": true
}
}" \
$bitbucket_url
echo ApplicationLinks created
echo Please finish configuration of ApplicationLinks in browser

jira_application_links_url="http://localhost:$jira_external_port/plugins/servlet/applinks/listApplicationLinks"
bamboo_application_links_url="http://localhost:$bamboo_port/plugins/servlet/applinks/listApplicationLinks"
bitbucket_application_links_url="http://localhost:$bitbucket_port/plugins/servlet/applinks/listApplicationLinks"

if [ "$(uname)" == "Darwin" ]
then
open $jira_application_links_url $bamboo_application_links_url $bitbucket_application_links_url
else
xdg-open $jira_application_links_url
xdg-open $bamboo_application_links_url
xdg-open $bitbucket_application_links_url
fi
68 changes: 0 additions & 68 deletions docs/dev/setup/bamboo-bitbucket-jira.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,78 +90,10 @@ under ``localhost:7990``.

#. Make sure that Jira, Bitbucket and Bamboo have finished starting up.

(Only Linux & Windows) Make sure that `xdg-utils <https://www.howtoinstall.me/ubuntu/18-04/xdg-utils/>`__
is installed before running the following script.

.. raw:: html

<details>
<summary>xdg-utils for Windows users</summary>
An easy way to use the xdg-utils on Windows would be to install them on the linux-subsystem,
which should be activated anyways when running Docker on Windows.
For the installation on the subsystem the above linked explanation can be used.
<br>
Make sure to execute the script from the subsystem.
</details>


Execute the shell script ``atlassian-setup.sh`` in the
``docker/atlassian`` directory (e.g. with
``./docker/atlassian/atlassian-setup.sh``). This script creates
groups, users and assigns the user to their respective group.
In addition, it configures disabled application links between the 3 applications.


#. Enable the created `application
links <https://confluence.atlassian.com/doc/linking-to-another-application-360677690.html>`__
between all 3 application (OAuth Impersonate). The links should open automatically after the shell script
has finished. If not open them manually:

- Bitbucket: http://localhost:7990/plugins/servlet/applinks/listApplicationLinks
- Bamboo: http://localhost:8085/plugins/servlet/applinks/listApplicationLinks
- Jira: http://localhost:8081/plugins/servlet/applinks/listApplicationLinks

**You manually have to adjust the Display URL for the Bamboo → Bitbucket AND
Bitbucket → Bamboo URl to** ``http://localhost:7990`` **and**
``http://localhost:8085`` **.**

.. list-table::
:widths: 33 33 33
:header-rows: 1

* - **Bamboo:**
- **Bitbucket:**
- **Jira:**
* - .. figure:: setup/bamboo-bitbucket-jira/bamboo_bitbucket_applicationLink.png
:align: center
:target: ../_images/bamboo_bitbucket_applicationLink.png

Bamboo → Bitbucket
- .. figure:: setup/bamboo-bitbucket-jira/bitbucket_bamboo_applicationLink.png
:align: center
:target: ../_images/bitbucket_bamboo_applicationLink.png

Bitbucket → Bamboo
- .. figure:: setup/bamboo-bitbucket-jira/jira_bamboo_applicationLink.png
:align: center
:target: ../_images/jira_bamboo_applicationLink.png

Jira → Bamboo
* - .. figure:: setup/bamboo-bitbucket-jira/bamboo_jira_applicationLink.png
:align: center
:target: ../_images/bamboo_jira_applicationLink.png

Bamboo → Jira
- .. figure:: setup/bamboo-bitbucket-jira/bitbucket_jira_applicationLink.png
:align: center
:target: ../_images/bitbucket_jira_applicationLink.png

Bitbucket → Jira
- .. figure:: setup/bamboo-bitbucket-jira/jira_bitbucket_applicationLink.png
:align: center
:target: ../_images/jira_bitbucket_applicationLink.png

Jira → Bitbucket

#. The script *(step 3)* has already created the required users and assigned them to their respective group in Jira.
Now, make sure that they are assigned correctly according to the following test setup:
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ All these exercises are supposed to be run either live in the lecture with insta
user/markdown-support
user/exports
user/mobile-applications
user/lti


.. toctree::
Expand Down
Loading

0 comments on commit df1c5d6

Please sign in to comment.