Skip to content

Commit

Permalink
Merge pull request #466 from tmobile/v1.7.1
Browse files Browse the repository at this point in the history
Release v1.8
  • Loading branch information
suryajak authored Jul 28, 2018
2 parents 3c3f2d8 + 464f180 commit a758558
Show file tree
Hide file tree
Showing 1,424 changed files with 24,343 additions and 11,861 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ indent_style = space
charset = utf-8

# 4 space indentation
[*.{py}]
indent_size = 4
[*.py]
indent_size = 4
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
node_modules
.DS_Store
.vscode/
/.idea
*/.classpath
*/.project
*/.settings
Expand All @@ -12,4 +13,6 @@ node_modules
*/target/
.nyc_output/
npm-debug.log
*/package-lock.json
/.idea
package-lock.json

28 changes: 14 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ language: node_js
node_js:
- "node"
env:
- PLATFORM_SERVICE=jazz_codeq
- PLATFORM_SERVICE=jazz_create-serverless-service
- PLATFORM_SERVICE=jazz_delete-serverless-service
- PLATFORM_SERVICE=jazz_deployments
- PLATFORM_SERVICE=jazz_deployments-event-handler
- PLATFORM_SERVICE=jazz_environments
- PLATFORM_SERVICE=jazz_environment-event-handler
- PLATFORM_SERVICE=jazz_events
- PLATFORM_SERVICE=jazz_is-service-available
- PLATFORM_SERVICE=jazz_login
- PLATFORM_SERVICE=jazz_logout
- PLATFORM_SERVICE=jazz_scm-webhook
- PLATFORM_SERVICE=jazz_services
- PLATFORM_SERVICE=jazz_services-handler
- PLATFORM_SERVICE=core/jazz_codeq
- PLATFORM_SERVICE=core/jazz_create-serverless-service
- PLATFORM_SERVICE=core/jazz_delete-serverless-service
- PLATFORM_SERVICE=core/jazz_deployments
- PLATFORM_SERVICE=core/jazz_deployments-event-handler
- PLATFORM_SERVICE=core/jazz_environments
- PLATFORM_SERVICE=core/jazz_environment-event-handler
- PLATFORM_SERVICE=core/jazz_events
- PLATFORM_SERVICE=core/jazz_is-service-available
- PLATFORM_SERVICE=core/jazz_login
- PLATFORM_SERVICE=core/jazz_logout
- PLATFORM_SERVICE=core/jazz_scm-webhook
- PLATFORM_SERVICE=core/jazz_services
- PLATFORM_SERVICE=core/jazz_services-handler

before_script:
- npm prune
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![Jazz Logo](logo.png)
# Jazz Serverless Platform
# ![Jazz Logo](misc/logo.png) Jazz Serverless Platform

[![Build Status](https://travis-ci.org/tmobile/jazz.svg?branch=master)](https://travis-ci.org/tmobile/jazz)

**Seamlessly build, deploy & manage cloud-native applications.**
Expand Down
45 changes: 0 additions & 45 deletions api-template-java/Jenkinsfile

This file was deleted.

45 changes: 0 additions & 45 deletions api-template-nodejs/Jenkinsfile

This file was deleted.

31 changes: 0 additions & 31 deletions api-template-nodejs/components/config.js

This file was deleted.

45 changes: 0 additions & 45 deletions api-template-python/Jenkinsfile

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def createProject(repo_owner, repo_name){
try {
if (config_loader.SCM.TYPE == "gitlab") {

//gitlabs username is restricted to alphanumeric and . _ - characters,
//gitlabs username is restricted to alphanumeric and . _ - characters,
// so using email all email characters (except -, _) replaced with -
def gitlab_username = repo_owner.replaceAll("[^a-zA-Z0-9_-]", "-")

Expand All @@ -62,7 +62,9 @@ def createProject(repo_owner, repo_name){

transferProject(user_services_group_id, repo_id)
} else if (config_loader.SCM.TYPE == "bitbucket") {
sh "curl -X POST -k -v -u \"${config_loader.SCM.USERNAME}:${config_loader.SCM.PASSWORD}\" -H \"Content-Type: application/json\" " + scm_user_services_api_endpoint + " -d \'{\"name\":\"" + repo_name + "\", \"scmId\": \"git\", \"forkable\": \"true\"}\'"
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]) {
sh "curl -X POST -k -v -u \"${UNAME}:${PWD}\" -H \"Content-Type: application/json\" " + scm_user_services_api_endpoint + " -d \'{\"name\":\"" + repo_name + "\", \"scmId\": \"git\", \"forkable\": \"true\"}\'"
}
}
} catch (ex) {
echo "createProject failed: " + ex.toString()
Expand Down Expand Up @@ -125,7 +127,7 @@ def getGitLabsProjectId(repo_name) {

if (projectObject == null || projectObject.equals("") || projectObject[0] == null || projectObject[0].equals("")
|| projectObject[0].id == null || projectObject[0].id.equals("")) {
error "getGitLabsProjectId failed to find project with name $repo_name"
error "getGitLabsProjectId failed to find project with name $repo_name"
}

return projectObject[0].id
Expand All @@ -149,20 +151,21 @@ def setBranchPermissions(repo_name) {
sh "curl --request POST --header \"PRIVATE-TOKEN: ${config_loader.SCM.PRIVATE_TOKEN}\" \"${scm_protocol}${config_loader.REPOSITORY.BASE_URL}/api/v4/projects/$proj_id/protected_branches?name=master&push_access_level=0\""
} else if (config_loader.SCM.TYPE == "bitbucket") {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, url: serviceonboarding_repo]]])
sh "curl -X POST -k -v -u \"${config_loader.SCM.USERNAME}:${config_loader.SCM.PASSWORD}\" -H \"Content-Type: application/vnd.atl.bitbucket.bulk+json\" ${scm_branch_permission_api_endpoint}${repo_name}/restrictions -d \"@branch_permissions_payload.json\" "
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]) {
sh "curl -X POST -k -v -u \"${UNAME}:${PWD}\" -H \"Content-Type: application/vnd.atl.bitbucket.bulk+json\" ${scm_branch_permission_api_endpoint}${repo_name}/restrictions -d \"@branch_permissions_payload.json\" "
}
}
}

def setRepoPermissions(repo_owner, repo_name, admin_group) {
if (config_loader.SCM.TYPE == "gitlab") {

} else if (config_loader.SCM.TYPE == "bitbucket") {
sh "curl -X PUT -G -k -v -u \"${config_loader.SCM.USERNAME}:${config_loader.SCM.PASSWORD}\" -d \"name=$admin_group\" \"${scm_user_services_api_endpoint}/${repo_name}/permissions/groups?permission=REPO_ADMIN&\""


def encoded_creator = URLEncoder.encode(repo_owner, "utf-8")

sh "curl -X PUT -G -k -v -u \"${config_loader.SCM.USERNAME}:${config_loader.SCM.PASSWORD}\" -d \"name=$encoded_creator\" \"${scm_user_services_api_endpoint}/${repo_name}/permissions/users?permission=REPO_ADMIN\""
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]) {
sh "curl -X PUT -G -k -v -u \"${UNAME}:${PWD}\" -d \"name=$admin_group\" \"${scm_user_services_api_endpoint}/${repo_name}/permissions/groups?permission=REPO_ADMIN&\""
def encoded_creator = URLEncoder.encode(repo_owner, "utf-8")
sh "curl -X PUT -G -k -v -u \"${UNAME}:${PWD}\" -d \"name=$encoded_creator\" \"${scm_user_services_api_endpoint}/${repo_name}/permissions/users?permission=REPO_ADMIN\""
}
}
}

Expand All @@ -173,7 +176,9 @@ def addWebhook(repo_name, webhookName, scm_webhook_target_url) {
sh "curl --header \"Private-Token: ${config_loader.SCM.PRIVATE_TOKEN}\" -X POST \"${scm_webhook_api}$scm_webhook_target_url\""
} else if (config_loader.SCM.TYPE == "bitbucket") {
def scm_webhook_api = "${scm_protocol}${config_loader.REPOSITORY.BASE_URL}/rest/webhook/1.0/projects/${config_loader.REPOSITORY.REPO_BASE_SERVICES}/repos/"
sh "curl -X PUT -k -v -u \"${config_loader.SCM.USERNAME}:${config_loader.SCM.PASSWORD}\" -H \"Content-Type: application/json\" ${scm_webhook_api}${repo_name}/configurations -d \'{\"title\": \"${webhookName}\", \"url\": \"${scm_webhook_target_url}\" , \"enabled\": true}\'"
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]) {
sh "curl -X PUT -k -v -u \"${UNAME}:${PWD}\" -H \"Content-Type: application/json\" ${scm_webhook_api}${repo_name}/configurations -d \'{\"title\": \"${webhookName}\", \"url\": \"${scm_webhook_target_url}\" , \"enabled\": true}\'"
}
}
}

Expand All @@ -185,10 +190,12 @@ def deleteProject(repo_name) {
returnStdout: true
).trim()
} else if (config_loader.SCM.TYPE == "bitbucket") {
def outputStr = sh(
script: "curl -X DELETE -k -u \"${config_loader.SCM.USERNAME}:${config_loader.SCM.PASSWORD}\" '" + scm_user_services_api_endpoint + repo_name + "'",
returnStdout: true
).trim()
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]) {
def outputStr = sh(
script: "curl -X DELETE -k -u \"${UNAME}:${PWD}\" '" + scm_user_services_api_endpoint + repo_name + "'",
returnStdout: true
).trim()
}
}
}

Expand Down Expand Up @@ -307,7 +314,7 @@ def getRepoCommitterInfo(commitHash) {
def scm_commit_api = "http://${config_loader.REPOSITORY.BASE_URL}/rest/api/1.0/projects/${repoBase}/repos/${getRepoName()}"
def repoUrl = "${scm_commit_api}/commits/${commitHash}"
echo "[Metadata] Repository URL: $repoUrl"
def scmCommitResponse
def scmCommitResponse
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]) {
scmCommitResponse = sh(script: "curl -k -v -u \"$UNAME:$PWD\" -H \"Content-Type: application/json\" $repoUrl", returnStdout: true).trim()
}
Expand Down
Loading

0 comments on commit a758558

Please sign in to comment.