@@ -33,7 +33,7 @@ npm install screwdriver-executor-base
3333| config.apiUri | String | Screwdriver's API |
3434| config.buildId | String | The unique ID for a build |
3535| config.container | String | Container for the build to run in |
36- | config.token | String | JWT to act on behalf of the build |
36+ | config.token | String | Temporary JWT which Executor must exchange with API to get JWT which can act on behalf of the build |
3737
3838##### Expected Outcome
3939The start function is expected to create a [ task] in the execution engine.
@@ -71,6 +71,20 @@ A Promise that resolves with the current build status, or rejects if it fails.
7171##### Expected Outcome
7272The ` stats ` function is expected to return an object of statistics
7373
74+ #### Status
75+ ##### Required Parameters
76+ | Parameter | Type | Description |
77+ | :------------- | :---- | :-------------|
78+ | config | Object | Configuration Object |
79+ | config.token | String | Temporary JWT for a build |
80+ | buildTimeout | Number | Build timeout in minutes |
81+
82+ ##### Expected Outcome
83+ The ` exchangeTokenForBuild ` function will call API to exchange temporary build JWT with actual build JWT.
84+
85+ ##### Expected Return
86+ A Promise which resolves to actual build JWT
87+
7488## Extending
7589To make use of the validation function for start and stop, you need to
7690override the ` _start ` and ` _stop ` methods.
@@ -80,8 +94,10 @@ class MyExecutor extends Executor {
8094 // Implement the interface
8195 _start (config ) {
8296 if (config .buildId ) {
83- // do stuff here...
84- return Promise .resolve (null );
97+ return this .exchangeTokenForBuild (config .token , buildTimeout).then (buildToken => {
98+ // do stuff here...
99+ return Promise .resolve (null );
100+ });
85101 }
86102
87103 return Promise .reject (new Error (' Error starting executor' ));
0 commit comments