-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87a971b
commit 11a5eb8
Showing
4 changed files
with
192 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# JOB LEVEL TEMPLATE: | ||
# Used to build JavaScript | ||
# Reusable | ||
# Meant to be run from the single JavaScriptTemplate pipeline (default), or | ||
# from a multi-pipeline such as publishing (should specify alternate params) | ||
|
||
parameters: | ||
- name: ApiSpecSource | ||
displayName: ApiSpecSource | ||
type: string | ||
default: -apiSpecGitUrl https://raw.githubusercontent.com/PlayFab/API_Specs/master/ | ||
- name: CommitMessage | ||
displayName: CommitMessage | ||
type: string | ||
default: Automated build from ADO Pipeline | ||
- name: GitDestBranch | ||
displayName: GitDestBranch | ||
type: string | ||
default: doNotCommit | ||
- name: GitJSetupBranch | ||
displayName: GitJSetupBranch | ||
type: string | ||
default: master | ||
- name: GitSdkGenBranch | ||
displayName: GitSdkGenBranch | ||
type: string | ||
default: master | ||
- name: isVersioned | ||
displayName: isVersioned | ||
type: boolean | ||
default: false | ||
- name: expectedNumApiGroups | ||
displayName: expectedNumApiGroups | ||
type: number | ||
default: 14 | ||
- name: SelfTemplateResource | ||
displayName: SelfTemplateResource | ||
type: string | ||
default: self | ||
|
||
jobs: | ||
- job: JavaScriptJobTemplate | ||
steps: | ||
- bash: echo JavaScriptJobTemplate | ||
- job: JavaScriptTemplate | ||
pool: | ||
vmImage: 'windows-latest' | ||
steps: | ||
- template: JavaScriptStepTemplate.yml | ||
parameters: | ||
ApiSpecSource: ${{ parameters.ApiSpecSource }} | ||
CommitMessage: ${{ parameters.CommitMessage }} | ||
GitDestBranch: ${{ parameters.GitDestBranch }} | ||
GitJSetupBranch: ${{ parameters.GitJSetupBranch }} | ||
GitSdkGenBranch: ${{ parameters.GitSdkGenBranch }} | ||
isVersioned: ${{ parameters.isVersioned }} | ||
expectedNumApiGroups: ${{ parameters.expectedNumApiGroups }} | ||
SelfTemplateResource: ${{ parameters.SelfTemplateResource }} |
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,30 @@ | ||
# TOP LEVEL TEMPLATE: | ||
# Can only be used to run the single JavaScriptTemplate pipeline. | ||
# Why: Resources can only be defined once. | ||
# This determines the resources available to all "jobs" and "steps" no matter which templates are loaded after this | ||
# If resources is ever defined again, it'll break so badly that the pipeline won't even parse | ||
|
||
resources: | ||
repositories: | ||
- repository: JenkinsSdkSetupScripts | ||
type: github | ||
endpoint: GitHub_PlayFab | ||
name: PlayFab/JenkinsSdkSetupScripts | ||
- repository: API_Specs | ||
type: github | ||
endpoint: GitHub_PlayFab | ||
name: PlayFab/API_Specs | ||
- repository: SdkGenerator | ||
type: github | ||
endpoint: GitHub_PlayFab | ||
name: PlayFab/SdkGenerator | ||
- repository: JavaScriptSDK | ||
endpoint: GitHub_PlayFab | ||
type: github | ||
name: PlayFab/JavaScriptSDK | ||
|
||
jobs: | ||
- job: JavaScriptResourceTemplate | ||
steps: | ||
- bash: echo JavaScriptResourceTemplate | ||
- template: JavaScriptJobTemplate.yml |
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,96 @@ | ||
# STEPS LEVEL TEMPLATE: | ||
# Used to build JavaScript | ||
# Reusable | ||
# Used to "hide" the additional variables specific to this SDK which shouldn't be set from a higher level, or | ||
# shared from a multi-build pipeline like a publish | ||
|
||
parameters: | ||
- name: ApiSpecSource | ||
displayName: ApiSpecSource | ||
type: string | ||
default: -apiSpecGitUrl https://raw.githubusercontent.com/PlayFab/API_Specs/master/ | ||
- name: CommitMessage | ||
displayName: CommitMessage | ||
type: string | ||
default: Automated build from ADO Pipeline | ||
- name: GitDestBranch | ||
displayName: GitDestBranch | ||
type: string | ||
default: doNotCommit | ||
- name: SdkName | ||
displayName: SdkName | ||
type: string | ||
default: JavaScriptSDK | ||
- name: GitJSetupBranch | ||
displayName: GitJSetupBranch | ||
type: string | ||
default: master | ||
- name: GitSdkGenBranch | ||
displayName: GitSdkGenBranch | ||
type: string | ||
default: master | ||
- name: isVersioned | ||
displayName: isVersioned | ||
type: boolean | ||
default: false | ||
- name: expectedNumApiGroups | ||
displayName: expectedNumApiGroups | ||
type: number | ||
default: 14 | ||
- name: SelfTemplateResource | ||
displayName: SelfTemplateResource | ||
type: string | ||
default: self | ||
|
||
steps: | ||
- checkout: JenkinsSdkSetupScripts | ||
clean: true | ||
path: s | ||
- checkout: API_Specs | ||
clean: true | ||
path: s/API_Specs | ||
- checkout: SdkGenerator | ||
clean: true | ||
path: s/SdkGenerator | ||
- checkout: ${{ parameters.SelfTemplateResource }} | ||
clean: true | ||
submodules: true | ||
path: s/sdks/JavaScriptSDK | ||
persistCredentials: true | ||
- bash: | | ||
set -e | ||
echo alias the ADO variables into local variables | ||
ApiSpecSource="${{ parameters.ApiSpecSource }}" | ||
CommitMessage="${{ parameters.CommitMessage }}" | ||
GitDestBranch="${{ parameters.GitDestBranch }}" | ||
SdkName="${{ parameters.SdkName }}" | ||
WORKSPACE=$(pwd -W) | ||
# Hack attempt to get WORKSPACE into a sub-environment | ||
export WORKSPACE="$WORKSPACE" | ||
echo === load util.sh to find msbuild === | ||
. "$WORKSPACE/JenkinsSdkSetupScripts/JenkinsScripts/Pipeline/util.sh" | ||
. "$WORKSPACE/JenkinsSdkSetupScripts/JenkinsScripts/Pipeline/testInit.sh" | ||
cd "$WORKSPACE/SDKGenerator/SDKBuildScripts" | ||
export PF_TEST_TITLE_DATA_JSON="$WORKSPACE\JenkinsSdkSetupScripts\Creds\testTitleData.json" | ||
. ./shared_build.sh | ||
echo === Build the JavaScript Project === | ||
Find2019MsBuild || Find2017MsBuild | ||
"$MSBUILD_EXE" "$WORKSPACE\\sdks\\$SdkName\\PlayFabTestingExample\\PlayFabApiTest.sln" //restore //t:Rebuild | ||
if [ $isVersioned = true ] ; | ||
then | ||
echo === publish if necessary === | ||
cd "$WORKSPACE/sdks/$SdkName/PlayFabSdk" | ||
npm publish | ||
fi | ||
displayName: 'Build/Test/Report' | ||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFormat: 'JUnit' | ||
testResultsFiles: '*.xml' | ||
testRunTitle: JavaScriptTemplate |
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,8 @@ | ||
pool: | ||
vmImage: 'ubuntu-latest' | ||
|
||
trigger: | ||
- master | ||
|
||
extends: | ||
template: JavaScriptResourceTemplate.yml |