Skip to content

Release/2024.08.19 #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 123 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from 122 commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
b042eef
Initial commit
vbatr Jul 19, 2023
650f226
Merge branch 'main'
vbatr Jul 19, 2023
99c06e0
JSMT-24 - Create initial pipeline
vbatr Jul 19, 2023
292a045
Merged in task/JSMT-24_configure_initial_pipeline_app (pull request #2)
vbatr Jul 19, 2023
e595954
JSMT-24 - Use Tokenator in order to access private Docker image
vbatr Jul 19, 2023
cd9e8a6
JSMT-24 - make test data not dependent on the environment
vbatr Jul 20, 2023
98ec87f
JSMT-24 - make docker image build step conditional
vbatr Jul 20, 2023
3a04731
JSMT-24 - updated tests
vbatr Jul 20, 2023
e997d9b
Merged in task/JSMT-24_use_tokenator_in_pipelines (pull request #3)
vbatr Jul 20, 2023
34c1602
JSMT-24_configure_deployment_steps
vbatr Jul 20, 2023
b4b6fb6
Merged in task/JSMT-24_configure_deployment_steps (pull request #4)
vbatr Jul 21, 2023
8238e4a
JSMT-24 - fix zip script
vbatr Jul 21, 2023
6470fa0
Merged in task/JSMT-24_fix_zip_on_pipelines (pull request #5)
vbatr Jul 21, 2023
3d58f26
Merged in task/JSMT-24_add_pipeline_for_building_manifests (pull requ…
vbatr Jul 25, 2023
6367ea8
JSMT-24 - add manual pipeline step for production deployment
vbatr Jul 26, 2023
780640f
JSMT-24 - add new step for creating tag for the branch based on curre…
vbatr Jul 26, 2023
1801a1f
JSMT-24 - fix tag step
vbatr Jul 26, 2023
6fd0718
JSMT-30 Remove signout from Atlassian on disconnect
zakharlistiev Aug 1, 2023
ebd8cd4
Merged in task/JSMT-24_production_deployment (pull request #7)
vbatr Aug 2, 2023
0c38e15
Merged master into bugfix/JSMT-30-remove-sign-out-from-Atlassian-acco…
zakharlistiev Aug 2, 2023
7a68748
Merged in bugfix/JSMT-30-remove-sign-out-from-Atlassian-account-on-di…
zakharlistiev Aug 2, 2023
ae547f0
Merged in task/JSMT-26_handle_servicedesk_permissions (pull request #9)
vbatr Aug 2, 2023
419fdb7
JSMT-31 Remove connect app related code
zakharlistiev Aug 3, 2023
9745fd9
Merged in JSMT-31-remove-connect-application-relatated-code (pull req…
zakharlistiev Aug 14, 2023
8b5e0e5
Merged in task/JSMT-46_run_snyk_scan_manually (pull request #11)
vbatr Aug 14, 2023
45ca531
Merged in task/JSMT-96_github_pushback (pull request #12)
vbatr Aug 17, 2023
bdba098
JSMT-88 - update ajv package
vbatr Oct 3, 2023
106f373
JSMT-88 - update packages
vbatr Oct 3, 2023
69c6b9a
Merged in task/JSMT-88_ajv_package_update (pull request #14)
vbatr Oct 4, 2023
c4d6a5e
Merged in task/JSMT-109_sntyk_config (pull request #13)
vbatr Oct 5, 2023
90f2211
JSMT-32 remake OnTurnAsync() to handle bot requests
zakharlistiev Oct 10, 2023
40c3b07
JSMT-32 resolved PR comment
zakharlistiev Oct 10, 2023
a11a174
JSMT-32 fixed telemetry tracking
zakharlistiev Oct 11, 2023
41dbe2e
Merged in bugfix/JSMT-32-fix-bot-responses-when-action-was-triggered-…
zakharlistiev Oct 11, 2023
7b4294a
JSMT-32 - fix sign in flow to send successful message
vbatr Oct 11, 2023
9fb595e
Merged in task/JSMT-32_fix_sign_in_user_response (pull request #16)
vbatr Oct 12, 2023
482384c
JSMT-33 fixed sign-in workflow
zakharlistiev Oct 12, 2023
3532caf
Merged in bugfix/JSMT-33-fix-sign-in-flow-to-return-up-to-date-state …
zakharlistiev Oct 12, 2023
c5dc614
JSMT-75 - migrate from tslint to eslint
vbatr Oct 12, 2023
eb54ac4
Merged in task/JSMT-75_migrate_to_eslint (pull request #18)
vbatr Oct 13, 2023
d7d35d6
JSMT-117 added 'Help' adaptive card after connection to Jira
zakharlistiev Oct 13, 2023
02ffce7
JSMT-117 removed dots at the end of the cards
zakharlistiev Oct 13, 2023
569cb38
JSMT-117 fixed type in connect jira card
zakharlistiev Oct 13, 2023
155f022
JSMT-117 replaced atlas logo with high res pic
zakharlistiev Oct 16, 2023
f6f8209
JSMT-36 replaced edit dialog to task module execution
zakharlistiev Oct 16, 2023
e16e562
JSMT-36 updated application var
zakharlistiev Oct 16, 2023
396aa5e
Merged in JSMT-36-use-task-modules-on-edit-issue-from-tab (pull reque…
zakharlistiev Oct 16, 2023
30e10d9
JSMT-117 updated atlassian logo to large (high res)
zakharlistiev Oct 17, 2023
16a1d74
Merged in feature/JSMT-117-show-help-card-after-sign-in (pull request…
zakharlistiev Oct 17, 2023
4d8ac98
Merged in task/JSMT-112_copilot_changes (pull request #21)
vbatr Oct 18, 2023
6e0af4e
JSMT-119 created add comment component
zakharlistiev Oct 19, 2023
6cf5ea0
JSMDC-119 added permissions check
zakharlistiev Oct 19, 2023
a7fc7d0
JSMDC-119 fixed unit-tests
zakharlistiev Oct 19, 2023
68f1632
JSMT-119 truncate long summary
zakharlistiev Oct 20, 2023
978001e
JSMT-119 set max jira allowed comment lenght
zakharlistiev Oct 20, 2023
4e633ce
JSMT-119 issue key length/dialog auto closing
zakharlistiev Oct 20, 2023
2b328d4
JSMT-119 change issue key width from 40 -> 25%
zakharlistiev Oct 20, 2023
9fc39bb
Merged in JSMT-119-create-add-comment-component (pull request #22)
zakharlistiev Oct 20, 2023
70ea86b
JSMT-121 fixed lint erros
zakharlistiev Oct 20, 2023
b030f78
Merged in JSMT-121-build-fails-with-lint-errors (pull request #23)
zakharlistiev Oct 20, 2023
a539bd5
JSMT-112 added snack bar instead of dialogs
zakharlistiev Oct 25, 2023
aefd0a7
JSMT-112 fixed lint errors
zakharlistiev Oct 25, 2023
905b567
JSMT-122 changes based on PR comments
zakharlistiev Oct 26, 2023
1783d99
JSMT-122 fixed lint errors
zakharlistiev Oct 26, 2023
f95da5c
Merged in JSMT-122-use-notification-bar-instead-of-dialogs (pull requ…
zakharlistiev Oct 26, 2023
d33c98e
JSMT-76 - configure SonarQube static analysis
vbatr Oct 26, 2023
bb1fb58
JSMT-76 - run static analysis on master branch
vbatr Oct 26, 2023
7674d3a
JSMT-39 added detailed welcome card
zakharlistiev Oct 27, 2023
ddf5ad4
JSMT-127 disable buttons when success notification shown
zakharlistiev Oct 27, 2023
f2e740c
Merged in task/JSMT-76_sonar_config (pull request #25)
vbatr Oct 27, 2023
7fbaff0
JSMT-127 resolved pr comments
zakharlistiev Oct 27, 2023
88d251f
JSMT-128 - fix SQ bugs
vbatr Oct 27, 2023
132fc62
JSMT-127 release forms on error
zakharlistiev Oct 30, 2023
cf0bd65
Merged in JSMT-39-add-more-details-on-welcome-card (pull request #26)
zakharlistiev Oct 30, 2023
f640506
JSMT-127 release form on error #2
zakharlistiev Oct 30, 2023
8bc871d
Merged in JSMT-127-disable-components-when-confirm-dialog-shown (pull…
zakharlistiev Oct 30, 2023
9137d90
Merged in task/JSMT-128_fix_SQ_bugs (pull request #28)
vbatr Oct 30, 2023
df0db90
JMST-153 - show only available priorities on edit issue screen
vbatr Nov 7, 2023
6fdea9f
JSMT-151 fixed notification bar issues
zakharlistiev Nov 7, 2023
14281af
Merged in task/JSMT-153_use_available_priorities_on_edit (pull reques…
vbatr Nov 7, 2023
def08bf
Merged in bugfix/JSMT-151-notification-bar-issues-fix (pull request #30)
zakharlistiev Nov 7, 2023
0f68ca3
Merged in task/JSMT-152_handle_api_errors (pull request #31)
vbatr Nov 7, 2023
901d9d9
JSMT-153 - fix conditions for displaying notification error
vbatr Nov 7, 2023
6c38ec5
Merged in task/JSMT-153_fix_notification_error_display_options (pull …
vbatr Nov 7, 2023
4a97a5f
JSMT-153 - block button when notification success message is displayed
vbatr Nov 7, 2023
75f5625
Merged in task/JSMT-153_fix_notification_error_display_logic (pull re…
vbatr Nov 7, 2023
4ca26a1
Merged in release/2023.11.13 (pull request #34)
vbatr Nov 13, 2023
dcc4bfd
JSMT-162 - remove SRI hash as it causing CORS issues for some resources
vbatr Jan 2, 2024
ecf8c07
Merged in JSMT-162_CORS_js_issue (pull request #35)
vbatr Jan 2, 2024
63a9bfa
Merged in JSMT-169_update_ip_npm_package (pull request #36)
vbatr Mar 20, 2024
e20c227
JSMT-174 - update tar package
vbatr Apr 2, 2024
232de37
Merged in JSMT-174_update_tar_package (pull request #37)
vbatr Apr 4, 2024
871ef42
JSMT-170 updated libraries to fix VULN
zakharlistiev Jul 3, 2024
cdc2c22
JSMT-171 updated vulnerable libraries
zakharlistiev Jul 3, 2024
ba66e0a
JSMT-170 removed generated by rider configs
zakharlistiev Jul 3, 2024
0c7f0b4
Merged in JSMT-170-update-system.text.regularexpressions (pull reques…
zakharlistiev Jul 3, 2024
eec8315
Merge branch 'master' into JSMT-171-update-system.drawing.common
zakharlistiev Jul 3, 2024
68520c6
JSMT-172 updated vulnerable Microsoft.Azure.SignalR library
zakharlistiev Jul 3, 2024
7c38a34
JSMT-89 updated vulnerable packages
zakharlistiev Jul 3, 2024
b520c24
Merged in JSMT-171-update-system.drawing.common (pull request #39)
zakharlistiev Jul 4, 2024
5a9bb30
Merge branch 'master' into JSMT-172-update-azure.identity
zakharlistiev Jul 4, 2024
f9f76de
Merged in JSMT-172-update-azure.identity (pull request #40)
zakharlistiev Jul 4, 2024
4be6ae0
JSMT-89 updated Microsoft.AspNetCore.Authentication.JwtBearer package
zakharlistiev Jul 4, 2024
eede31c
Merged in JSMT-89-update-glob-parent (pull request #41)
zakharlistiev Jul 8, 2024
cda8e38
JSMT-192 rename all occurrences Jira Server to Jira Data Center
zakharlistiev Jul 8, 2024
17ada32
JSMT-192 renamed Data Center -> Jira Data Center in some places
zakharlistiev Jul 8, 2024
7042114
JSMT-192 rephrase upgrade message
zakharlistiev Jul 9, 2024
f2fd2d1
Merged in JSMT-192-rename-all-occurrences-in-the-source-code (pull re…
zakharlistiev Jul 9, 2024
cdad714
JSMT-201 fail build if quality gate failed
zakharlistiev Jul 9, 2024
33386ea
JSMT-201 resolved PR comments (url encode + build step)
zakharlistiev Jul 9, 2024
706904c
Merged in JSMT-201-setup-sonarqube-quality-gate (pull request #43)
zakharlistiev Jul 10, 2024
fb9530f
JDCMT-168 get tag from branch name
zakharlistiev Jul 10, 2024
392553b
Merged in JDCMT-208-resolve-security-hotspots (pull request #45)
zakharlistiev Jul 11, 2024
b18ff6f
Merged in JDCMT-168-rewrite-tag-cration-for-release (pull request #44)
zakharlistiev Jul 16, 2024
33e2d59
Merged in JDCMT-189_adjust_manifest (pull request #47)
vbatr Jul 23, 2024
245d7db
Merged in JDCMT-210-extend-welcome-message-card (pull request #46)
zakharlistiev Jul 25, 2024
57fc281
Merged in JDCMT-189_remove_website_url_for_app (pull request #48)
vbatr Jul 25, 2024
91024fd
Merged in JDCMT-210_add_links_to_welcome_message (pull request #49)
vbatr Jul 26, 2024
61a85ce
Merged in JDCMT-216_process_hidden_fields (pull request #50)
vbatr Aug 1, 2024
7f69753
JDCMT-217 - fix error while loading task module for disconnected user
vbatr Aug 2, 2024
0908019
Merged in JDCMT-217_error_on_dialog (pull request #51)
vbatr Aug 2, 2024
ccbbf8b
Merged in JDCMT-42_update_Angular_to_v_18 (pull request #52)
vbatr Aug 16, 2024
5c38093
Merge branch 'main' into release/2024.08.19
vbatr Aug 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ _TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover
dotCover.Output.html
dotCover.Output/
dotCover*/

# Visual Studio code coverage results
*.coverage
Expand Down Expand Up @@ -389,3 +392,7 @@ yarn.lock
mongo/
local.env
manifests/local
.angular/

# Snyk Configs
security-assistant.yml
3 changes: 2 additions & 1 deletion MicrosoftTeamsJiraIntegration.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution
README.md = README.md
stylecop.json = stylecop.json
StyleCop.ruleset = StyleCop.ruleset
security-assistant.yml = security-assistant.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicrosoftTeamsIntegration.Jira.Tests", "tests\MicrosoftTeamsIntegration.Jira.Tests\MicrosoftTeamsIntegration.Jira.Tests.csproj", "{ED25B1DA-5ACD-47BD-A4A7-CB38E1C006D2}"
Expand Down Expand Up @@ -76,9 +77,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "staging", "staging", "{AB3C
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "development", "development", "{0959885E-6EE5-4AF4-B996-B42F22B135E8}"
ProjectSection(SolutionItems) = preProject
manifests\server\development\color.png = manifests\server\development\color.png
manifests\server\development\manifest.json = manifests\server\development\manifest.json
manifests\server\development\outline.png = manifests\server\development\outline.png
manifests\server\development\color.png = manifests\server\development\color.png
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "production", "production", "{06AF2F23-D535-4D88-9C91-A34DEA181D40}"
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Jira Server
# Jira Data Center

[![Atlassian license](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square)](LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](CONTRIBUTING.md)

Official plugin for Jira Server that integrates with [Microsoft Teams](https://www.microsoft.com/en-ww/microsoft-teams/group-chat-software).
Official plugin for Jira Data Center that integrates with [Microsoft Teams](https://www.microsoft.com/en-ww/microsoft-teams/group-chat-software).

## Usage

Jira Server for Microsoft Teams brings your Jira Server experience into your collaboration environment, letting you and your team stay focused, communicate on issues and backlog. Interact with Jira Server bot for Microsoft Teams to: create, assign, watch, edit issues, log working time. You may also interact with the bot from your team channel. With the messaging extension, you can quickly search for a specific issue and submit it to a channel or conversation. With the actionable message, you can quickly create a new issue, pre-populated with message text as the issue description, or save the message as a comment on one of your Jira Server issues. Also, you can add your project backlog to your channel as a tab, so that your team could easily track and work on the issues within the tab.
Jira Data Center for Microsoft Teams brings your Jira Data Center experience into your collaboration environment, letting you and your team stay focused, communicate on issues and backlog. Interact with Jira Data Center bot for Microsoft Teams to: create, assign, watch, edit issues, log working time. You may also interact with the bot from your team channel. With the messaging extension, you can quickly search for a specific issue and submit it to a channel or conversation. With the actionable message, you can quickly create a new issue, pre-populated with message text as the issue description, or save the message as a comment on one of your Jira Data Center issues. Also, you can add your project backlog to your channel as a tab, so that your team could easily track and work on the issues within the tab.
Issue urls sent in a message to the group chat or team channel unfurl cards with context about the issue. The unfurl displays key information such as summary, status, priority, updated date, reporter, assignee and those values can be changed from the card directly. There are available 'Assigned to me’, ‘Reported by me’, ‘Watched by me’ and ‘My filters’ tabs by default but you also have a possibility to add a tab with a custom filter and save it.

**Important:** To use messaging extension, bot, or tabs you’ll need to install Microsoft Teams for Jira Server add-on to your Jira Server. Make sure you have admin permissions within your Jira Server to be able to install and configure the add-on. Once the add-on is installed, the add-on will generate and assign a unique Jira ID to your Jira Server instance. Share the generated Jira ID with the team so that your teammates could connect Microsoft Teams to Jira. Jira Server connector for Microsoft Teams can be set up independently and doesn’t require add-on installation. Connector is using webhooks and can be configured directly from the Teams channel. Please note, that the webhook set-up in Jira requires Jira admin permissions.
**Important:** To use messaging extension, bot, or tabs you’ll need to install Microsoft Teams for Data Center add-on to your Data Center. Make sure you have admin permissions within your Data Center to be able to install and configure the add-on. Once the add-on is installed, the add-on will generate and assign a unique Jira ID to your Data Center instance. Share the generated Jira ID with the team so that your teammates could connect Microsoft Teams to Jira. Data Center connector for Microsoft Teams can be set up independently and doesn’t require add-on installation. Connector is using webhooks and can be configured directly from the Teams channel. Please note, that the webhook set-up in Jira requires Jira admin permissions.

## Installation

Expand Down Expand Up @@ -126,11 +126,11 @@ In case you want to deploy the application later you need to do some additional
- Go to Configuration section and add all configs from **Configuring** section above. As an option you can create [App Configuration](https://learn.microsoft.com/en-us/azure/azure-app-configuration/overview) resource and set all the configs there and the app service configuration will just keep App Configuration resource connection string.
1. Deploy your application to Web App resource

### Install Jira Server app (add-on)
1. Install standalone Jira server is installed on your machine or you have installed Atlassian SDK (https://developer.atlassian.com/server/framework/atlassian-sdk/install-the-atlassian-sdk-on-a-windows-system/).
1. Create Jira Server add-on. See more details [here](https://github.com/atlassian-labs/msteams-jira-server-addon#readme).
1. Got to your local instance of Jira Server -> Settings -> Manage apps.
1. Click **Upload app** and select *.jar file of your Jira Server addon created previously.
### Install Data Center app (add-on)
1. Install standalone Data Center is installed on your machine or you have installed Atlassian SDK (https://developer.atlassian.com/server/framework/atlassian-sdk/install-the-atlassian-sdk-on-a-windows-system/).
1. Create Data Center add-on. See more details [here](https://github.com/atlassian-labs/msteams-jira-server-addon#readme).
1. Got to your local instance of Data Center -> Settings -> Manage apps.
1. Click **Upload app** and select *.jar file of your Data Center addon created previously.
1. Finish installation. Expand new app. All modules should be enabled.
1. Press **Configure** and follow steps on the page.

Expand All @@ -151,12 +151,12 @@ Please visit a [link](https://www.msteams-atlassian.com/JiraServer/) to get more

## Tests

All unit tests for Jira Server project are placed under MicrosoftTeamsIntegration.Jira.Tests. You can use Test Explorer in the Visual Studio IDE to run them and View test results. It displays the results in groups of Failed Tests, Passed Tests, Skipped Tests and Not Run Tests. The details pane at the bottom or side of the Test Explorer displays a summary of the test run.
All unit tests for Data Center project are placed under MicrosoftTeamsIntegration.Jira.Tests. You can use Test Explorer in the Visual Studio IDE to run them and View test results. It displays the results in groups of Failed Tests, Passed Tests, Skipped Tests and Not Run Tests. The details pane at the bottom or side of the Test Explorer displays a summary of the test run.
Another way to execute all tests is to run `dotnet test` command in the terminal from the project root folder.

## Contributions

Contributions to Jira Server are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.
Contributions to Data Center are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

## License

Expand Down
190 changes: 190 additions & 0 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
# Pipeline for building and publishing msteams-jira project
image: atlassian/default-image:4

options:
docker: true
size: 2x
definitions:
services:
docker:
memory: 5000
steps:
- step: &dockerImage
name: Prepare custom Docker image
services:
- docker
caches:
- docker
script:
- pipe: atlassian/artifactory-sidekick:v1
- source .artifactory/activate.sh
- export IMG_TAG=docker.atl-paas.net/atlassian/netrunners/dotnet-node
- docker build --tag="$IMG_TAG" --file docker/Dockerfile .
- docker push "$IMG_TAG"
- step: &build
name: Build and Test
image:
name: docker-proxy.services.atlassian.com/atlassian/netrunners/dotnet-node
username: netrunners
password: $PIPELINES_JWT_TOKEN
caches:
- dotnetcore
- node
script:
# change project version
- PACKAGE_VERSION=$(date +%Y.%m.%d).$BITBUCKET_BUILD_NUMBER
- xmlstarlet edit -L -u /Project/PropertyGroup/Version -v ""$PACKAGE_VERSION"" $BITBUCKET_CLONE_DIR/src/MicrosoftTeamsIntegration.Jira/MicrosoftTeamsIntegration.Jira.csproj
- echo "`xmlstarlet sel -t -v /Project/PropertyGroup/Version $BITBUCKET_CLONE_DIR/src/MicrosoftTeamsIntegration.Jira/MicrosoftTeamsIntegration.Jira.csproj`"
# build source code
- REPORTS_PATH=./test-reports/build_$BITBUCKET_BUILD_NUMBER
- dotnet build -c Release
- dotnet test --no-build -c Release --logger:"junit;LogFilePath=$REPORTS_PATH/test-result.xml"
- step: &publish
name: Publish application
image:
name: docker-proxy.services.atlassian.com/atlassian/netrunners/dotnet-node
username: netrunners
password: $PIPELINES_JWT_TOKEN
script:
- dotnet publish -c Release -o 'publish'
- pushd ./publish; zip -r ../jira-$BITBUCKET_BUILD_NUMBER.zip .; popd
artifacts:
- jira-*.zip
- step: &deploy
name: Deploy application
deployment: Integration
script:
- pipe: atlassian/azure-web-apps-deploy:1.1.0
variables:
AZURE_APP_ID: $AZURE_APP_ID
AZURE_PASSWORD: $AZURE_PASSWORD
AZURE_TENANT_ID: $AZURE_TENANT_ID
AZURE_RESOURCE_GROUP: $AZURE_RESOURCE_GROUP
AZURE_APP_NAME: $AZURE_APP_NAME
ZIP_FILE: 'jira-$BITBUCKET_BUILD_NUMBER.zip'
SLOT: $AZURE_SLOT
- step: &manifests
name: Build manifests
image:
name: docker-proxy.services.atlassian.com/atlassian/netrunners/dotnet-node
username: netrunners
password: $PIPELINES_JWT_TOKEN
script:
- MANIFEST_VERSION=$(date +%Y.%m.%d)
- MANIFEST_ZIP_VERSION=$MANIFEST_VERSION.$BITBUCKET_BUILD_NUMBER
# Change version and zip integration sideload
- echo "`jq '.version="'"$MANIFEST_VERSION"'"' manifests/server/integration/manifest.json`" > manifests/server/integration/manifest.json
- pushd ./manifests/server/integration/; zip -r ./../../../Jira.Server.Sideload.$MANIFEST_ZIP_VERSION-Integration.zip .; popd
# Change version and zip staging sideload
- echo "`jq '.version="'"$MANIFEST_VERSION"'"' manifests/server/staging/manifest.json`" > manifests/server/staging/manifest.json
- pushd ./manifests/server/staging/; zip -r ./../../../Jira.Server.Sideload.$MANIFEST_ZIP_VERSION-Staging.zip .; popd
# Change version and zip production sideload
- echo "`jq '.version="'"$MANIFEST_VERSION"'"' manifests/server/production/manifest.json`" > manifests/server/production/manifest.json
- pushd ./manifests/server/production/; zip -r ./../../../Jira.Server.Sideload.$MANIFEST_ZIP_VERSION-Production.zip .; popd
artifacts:
- Jira.Server.Sideload*.zip
- step: &createTag
name: Create tag
script:
- TAG_NAME=$(echo "$BITBUCKET_BRANCH" | sed 's/release\///')
- echo "Creating new tag ${TAG_NAME}"
- git tag -am "Tag ${TAG_NAME}" $TAG_NAME
- git push origin $TAG_NAME
- step: &snyk-scan
name: Run Snyk scan
image:
name: docker-proxy.services.atlassian.com/atlassian/netrunners/dotnet-node
username: netrunners
password: $PIPELINES_JWT_TOKEN
script:
- pipe: atlassian/artifactory-sidekick:v1
- source .artifactory/activate.sh
# restore all dependencies before scan
- dotnet publish -c Release -o 'publish'
# install Snyk
- npm install -g snyk
# run Snyk monitor
- snyk monitor --all-projects
- step: &pushToGithub
name: Push changes to Github repo
script:
- git remote add github git@github.com:atlassian-labs/msteams-jira-server.git
- git push -u github ${BITBUCKET_BRANCH}
- git push github --follow-tags
- step: &staticAnalysis
name: Static analysis
image:
name: docker-proxy.services.atlassian.com/atlassian/netrunners/dotnet-node
username: netrunners
password: $PIPELINES_JWT_TOKEN
script:
- dotnet tool install --global dotnet-sonarscanner
- dotnet tool install --global JetBrains.dotCover.GlobalTool
- export PATH="$PATH:/root/.dotnet/tools"
- dotnet sonarscanner begin /k:"$SONAR_REPOSITORY" /d:sonar.host.url="$SONAR_URL" /d:sonar.login="$SONAR_TOKEN" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html /d:sonar.coverage.exclusions=src/**/ClientApp/**/*
- dotnet build --no-incremental
- dotnet dotcover test --dcReportType=HTML
- dotnet sonarscanner end /d:sonar.login="$SONAR_TOKEN"
- |
ENCODED_BRANCH=$(echo "$BITBUCKET_BRANCH" | jq -sRr @uri)
STATUS=$(curl -s -u $SONAR_TOKEN: "https://sonar-enterprise.internal.atlassian.com/api/qualitygates/project_status?projectKey=msteams-jira-onprem&branch=$ENCODED_BRANCH" | jq -r .projectStatus.status)
if [ "$STATUS" != "OK" ]; then
echo "Quality gate failed: https://sonar-enterprise.internal.atlassian.com/dashboard?branch=$ENCODED_BRANCH&id=msteams-jira-onprem"
exit 1
fi
pipelines:
default:
- step:
<<: *dockerImage
condition:
changesets:
includePaths:
- 'docker/**'
- step: *build
- step: *staticAnalysis
custom:
buildDockerImage:
- step: *dockerImage
buildManifests:
- step: *manifests
createNewTag:
- step: *createTag
runSnyk:
- step: *snyk-scan
runSonar:
- step: *staticAnalysis
branches:
master:
- step: *build
- step: *staticAnalysis
- step: *publish
- step:
<<: *deploy
name: Deploy to integration
deployment: Integration
- step:
<<: *deploy
name: Deploy to staging
deployment: Staging
trigger: manual
release/*:
- step: *build
- step: *publish
- step:
<<: *deploy
name: Deploy to integration
deployment: Integration
- step:
<<: *deploy
name: Deploy to staging
deployment: Staging
- step:
<<: *deploy
name: Deploy to production
deployment: Production
trigger: manual
- step:
<<: *createTag
trigger: manual
- step:
<<: *pushToGithub
3 changes: 1 addition & 2 deletions build/Lifetime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ public override void Setup(Context context)
{
context.BuildNumber = "255.255.255.255";
}

var type = context.Environment.GetEnvironmentVariable("IntegrationType");

context.PackageNameFormat = $"JiraServer.{context.BuildNumber}.zip";

var artifactDirectoryPath = context.EnvironmentVariable("BUILD_ARTIFACTSTAGINGDIRECTORY");
Expand Down
12 changes: 12 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0

RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get -y install nodejs
# install zip command to compress the output of build
RUN apt-get -y install zip
# install xmlstarlet command to edit XML files
RUN apt-get -y install xmlstarlet
# install jq command for processing JSON files
RUN apt-get -y install jq
# install jdk (needed by sonarqube dotnet tool)
RUN apt-get install -y openjdk-17-jre
Loading