-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/devel' into next/24.12.0
- Loading branch information
Showing
30 changed files
with
652 additions
and
260 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
npx commitlint --edit $1 | ||
commitlint --edit $1 |
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 |
---|---|---|
|
@@ -5,115 +5,27 @@ | |
*/ | ||
|
||
// git utils | ||
int getCommitParentsCount() { | ||
return Integer.parseInt( | ||
sh( | ||
script: """#!/usr/bin/env bash | ||
git cat-file -p HEAD | grep -w "parent" | wc -l | ||
""", | ||
returnStdout: true | ||
).trim() | ||
) | ||
} | ||
|
||
boolean gitIsMergeCommit() { | ||
return 2 <= getCommitParentsCount() | ||
} | ||
|
||
void gitFixConfigAndRemote() { | ||
sh( | ||
script: """#!/usr/bin/env bash | ||
git config user.email "[email protected]" | ||
git config user.name "Tarsier Bot" | ||
""" | ||
) | ||
String repoOriginUrl = sh( | ||
script: """#!/usr/bin/env bash | ||
git remote -v | head -n1 | cut -d\$'\t' -f2 | cut -d\" \" -f1 | ||
""", | ||
returnStdout: true | ||
).trim() | ||
String newOriginUrl = repoOriginUrl.replaceFirst("https://github.com/Zextras", "[email protected]:Zextras") | ||
sh( | ||
script: """#!/usr/bin/env bash | ||
git remote set-url origin ${newOriginUrl} | ||
""" | ||
) | ||
} | ||
|
||
void gitUnshallow() { | ||
sh( | ||
script: """#!/usr/bin/env bash | ||
git fetch --unshallow | ||
""" | ||
) | ||
} | ||
|
||
void gitSetup() { | ||
gitFixConfigAndRemote() | ||
gitUnshallow() | ||
} | ||
|
||
String getCommitVersion() { | ||
return sh( | ||
script: """#!/usr/bin/env bash | ||
git log -1 | grep \'version:\' | sed -n \'s/.*version:\\s*//p\' | ||
""", | ||
returnStdout: true | ||
).trim() | ||
String getRepositoryName() { | ||
return sh(script: '''#!/bin/bash | ||
git remote -v | head -n1 | cut -d$'\t' -f2 | cut -d' ' -f1 | sed -e 's!https://github.com/!!g' -e '[email protected]:!!g' -e 's!.git!!g' | ||
''', returnStdout: true).trim() | ||
} | ||
|
||
String getCommitId() { | ||
return sh( | ||
script: """#!/usr/bin/env bash | ||
git rev-parse HEAD | ||
""", | ||
returnStdout: true | ||
).trim() | ||
String getLastTag() { | ||
return sh(script: '''#!/bin/bash | ||
git describe --tags --abbrev=0 | ||
''', returnStdout: true).trim() | ||
} | ||
|
||
void gitPush(Map opts = [:]) { | ||
def gitOptions = [' '] | ||
if (opts.followTags == true) { | ||
gitOptions << '--follow-tags' | ||
} | ||
if (gitOptions.size() > 1) { | ||
gitOptions << ' ' | ||
Boolean tagExistsAtHead() { | ||
try { | ||
sh(script: '''#!/bin/bash | ||
git describe --tags --exact-match | ||
''', returnStdout: true) | ||
return true | ||
} catch (err) { | ||
return false | ||
} | ||
|
||
sh( | ||
script: """#!/usr/bin/env bash | ||
git push${gitOptions.join(' ')}origin HEAD:${opts.branch} | ||
""" | ||
) | ||
} | ||
|
||
String getOriginUrl() { | ||
return sh( | ||
script: """#!/usr/bin/env bash | ||
git remote -v | head -n1 | cut -d\$'\t' -f2 | cut -d\" \" -f1 | ||
""", | ||
returnStdout: true | ||
).trim() | ||
} | ||
|
||
void openGithubPr(Map args = [:]) { | ||
def ownerAndRepo = getOriginUrl().replaceAll("[email protected]:", "").replaceAll(".git", "") | ||
echo "Opening PR with https://api.github.com/repos/${ownerAndRepo}/pulls" | ||
sh( | ||
script: """#!/usr/bin/env bash | ||
curl --location https://api.github.com/repos/${ownerAndRepo}/pulls \ | ||
-X POST \ | ||
-H 'Accept: application/vnd.github+json' \ | ||
-H 'Authorization: Bearer ${args.TOKEN}' \ | ||
-d '{ | ||
\"title\": \"${args.title}\", | ||
\"head\": \"${args.head}\", | ||
\"base\": \"${args.base}\", | ||
\"maintainer_can_modify\": true | ||
}' | ||
""" | ||
) | ||
} | ||
|
||
// Package utils | ||
|
@@ -127,26 +39,6 @@ String getPackageName() { | |
).trim() | ||
} | ||
|
||
String getPackageDescription() { | ||
return sh( | ||
script: """#!/usr/bin/env bash | ||
cat package.json \ | ||
| jq --raw-output '.description' | ||
""", | ||
returnStdout: true | ||
).trim() | ||
} | ||
|
||
String getPackageVersion() { | ||
return sh( | ||
script: """#!/usr/bin/env bash | ||
cat package.json \ | ||
| jq --raw-output '.version' | ||
""", | ||
returnStdout: true | ||
).trim() | ||
} | ||
|
||
// node utils | ||
void nodeCmd(Map args = [:]) { | ||
final boolean install = (args.install != null) ? args.install : false | ||
|
@@ -195,14 +87,9 @@ void npmLogin(String npmAuthToken) { | |
Boolean isReleaseBranch | ||
Boolean isDevelBranch | ||
Boolean isPullRequest | ||
Boolean isMergeCommit | ||
Boolean isBumpBuild | ||
Boolean lcovIsPresent | ||
// PROJECT DETAILS | ||
String pkgName | ||
String pkgVersion | ||
String pkgVersionFull | ||
String[] pkgVersionParts | ||
|
||
pipeline { | ||
agent { | ||
|
@@ -245,18 +132,8 @@ pipeline { | |
echo "isDevelBranch: ${isDevelBranch}" | ||
isPullRequest = "${BRANCH_NAME}" ==~ /PR-\d+/ | ||
echo "isPullRequest: ${isPullRequest}" | ||
isMergeCommit = gitIsMergeCommit() | ||
echo "isMergeCommit: ${isMergeCommit}" | ||
isBumpBuild = isReleaseBranch && isMergeCommit | ||
echo "isBumpBuild: ${isBumpBuild}" | ||
isDevBuild = !isReleaseBranch | ||
echo "isDevBuild: ${isDevBuild}" | ||
pkgName = getPackageName() | ||
echo "pkgName: ${pkgName}" | ||
pkgDescription = getPackageDescription() | ||
echo "pkgDescription: ${pkgDescription}" | ||
pkgFullVersion = getPackageVersion() | ||
echo "pkgFullVersion: ${pkgFullVersion}" | ||
isSonarQubeEnabled = params.RUN_SONARQUBE == true && (isPullRequest || isDevelBranch || isReleaseBranch) | ||
echo "isSonarQubeEnabled: ${isSonarQubeEnabled}" | ||
} | ||
|
@@ -436,6 +313,39 @@ pipeline { | |
} | ||
} | ||
} | ||
stage('Open release to devel pull request') { | ||
when { | ||
beforeAgent true | ||
allOf { | ||
expression { isReleaseBranch == true } | ||
expression { tagExistsAtHead() == true } | ||
} | ||
} | ||
steps { | ||
script { | ||
catchError(buildResult: "UNSTABLE", stageResult: "FAILURE") { | ||
String versionBumperBranchName = "version-bumper/${getLastTag()}" | ||
sh(script: """#!/bin/bash | ||
git push origin HEAD:refs/heads/${versionBumperBranchName} | ||
""") | ||
withCredentials([usernamePassword(credentialsId: 'tarsier-bot-pr-token-github', usernameVariable: 'GH_USERNAME', passwordVariable: 'GH_TOKEN')]) { | ||
sh(script: """ | ||
curl https://api.github.com/repos/${getRepositoryName()}/pulls \ | ||
-X POST \ | ||
-H 'Accept: application/vnd.github.v3+json' \ | ||
-H 'Authorization: token ${GH_TOKEN}' \ | ||
-d '{ | ||
\"title\": \"chore(release): ${getLastTag()}\", | ||
\"head\": \"${versionBumperBranchName}\", | ||
\"base\": \"devel\", | ||
\"maintainer_can_modify\": true | ||
}' | ||
""") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
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
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
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
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
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
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
13 changes: 13 additions & 0 deletions
13
docs/api/carbonio-ui-preview.videopreviewprops.errorlabel.md
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,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@zextras/carbonio-ui-preview](./carbonio-ui-preview.md) > [VideoPreviewProps](./carbonio-ui-preview.videopreviewprops.md) > [errorLabel](./carbonio-ui-preview.videopreviewprops.errorlabel.md) | ||
|
||
## VideoPreviewProps.errorLabel property | ||
|
||
Label shown when the preview cannot be shown | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
errorLabel?: string; | ||
``` |
Oops, something went wrong.