-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
1. add the number of commits from the master 2. handle two calls after deployment for each repo. 3. releases from the no-master branch won’t be taken to beta/latest release. 4. curl request check failure. 5. don't stop the release after conventional-github-releaser failed
- Loading branch information
Showing
3 changed files
with
59 additions
and
18 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
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,2 +1,38 @@ | ||
#!/bin/bash | ||
curl -k -d "{'name':$1, 'version':$2, 'source':'npm'}" -H "Content-Type: application/json" -X POST https://jenkins.ovp.kaltura.com/generic-webhook-trigger/invoke?token=$3 | ||
set -x | ||
curl ifconfig.me | ||
|
||
#!/bin/bash | ||
REPO_PREFIX="@playkit-js/playkit-js-" | ||
HTTP_SUCCESS=false | ||
|
||
currentVersion=$(npx -c 'echo "$npm_package_version"') | ||
repoName=$(npx -c 'echo "$npm_package_name"') | ||
packageName="playkit-${repoName#$REPO_PREFIX}" | ||
echo "$packageName" | ||
echo "$currentVersion" | ||
|
||
TAGGED_BRANCH=$(git ls-remote origin | sed -n "\|$TRAVIS_COMMIT\s\+refs/heads/|{s///p}") | ||
UPDATE_SCHEMA=true | ||
if [ "$TAGGED_BRANCH" != "master" ]; then | ||
UPDATE_SCHEMA=false | ||
fi | ||
|
||
for i in {1..3}; do | ||
echo "Try number $i for pinging Jenkins...\n" | ||
HTTP_CODE=$(curl -k -d "{'name': $packageName, 'version':$currentVersion, 'source':'npm', 'schema_type': 'playerV3Versions', 'update_schema': $UPDATE_SCHEMA}" -H "Content-Type: application/json" --silent --output /dev/stderr --write-out "%{http_code}" --fail -X POST https://jenkins-central.prod.ovp.kaltura.com/generic-webhook-trigger/invoke?token=$1) | ||
STATUS_CODE=$? | ||
echo "Request return with http code $HTTP_CODE and curl finished with status code $STATUS_CODE" | ||
if [ "$HTTP_CODE" -eq 200 ] && [ "$STATUS_CODE" -eq 0 ]; then | ||
HTTP_SUCCESS=true | ||
break | ||
fi | ||
done | ||
|
||
echo "Jenkins ping success status - $HTTP_SUCCESS" | ||
|
||
if [ "$HTTP_SUCCESS" = true ]; then | ||
exit 0 | ||
else | ||
exit 1 | ||
fi |
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