Skip to content

Commit

Permalink
feat(1555): Pass in extra var UI URI to launcher (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkyi authored Mar 19, 2019
1 parent 3289bed commit d3007fe
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 37 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ npm-debug.log
.*.swp
demo.js
.nyc_output/
package-lock.json
33 changes: 2 additions & 31 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,3 @@
# Contributing
# Contributing to Screwdriver

Thank you for considering contributing! There are many ways you can help.

## Issues

File an issue if you think you've found a bug. Be sure to describe

1. How can it be reproduced?
2. What did you expect?
3. What actually occurred?
4. Version, platform, etc. if possibly relevant.

## Docs

Documentation, READMEs, and examples are extremely important. Please help improve them and if you find a typo or notice a problem, please send a fix or say something.

## Submitting Patches

Patches for fixes, features, and improvements are accepted through pull requests.

* Write good commit messages, in the present tense! (Add X, not Added X). Short title, blank line, bullet points if needed. Capitalize the first letter of the title or bullet item. No punctuation in the title.
* Code must pass lint and style checks.
* All external methods must be documented.
* Include tests to improve coverage and prevent regressions.
* Squash changes into a single commit per feature/fix. Ask if you're unsure how to discretize your work.

Please ask before embarking on a large improvement so you're not disappointed if it does not align with the goals of the project or owner(s).

## Feature Requests

Make the case for a feature via an issue with a good title. The feature should be discussed and given a target inclusion milestone or closed.
Have a look at our guidelines, as well as pointers on where to start making changes, in our official [documentation](https://docs.screwdriver.cd/about/contributing).
2 changes: 1 addition & 1 deletion config/docker-compose.yml.tim
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ services:
- "/bin/sh"
- "-c"
- |
/opt/sd/run.sh "{{token}}" "{{api_uri}}" "{{store_uri}}" "$SD_BUILD_TIMEOUT" "{{build_id}}"
/opt/sd/run.sh "{{token}}" "{{api_uri}}" "{{store_uri}}" "$SD_BUILD_TIMEOUT" "{{build_id}}" "{{ui_uri}}"
5 changes: 5 additions & 0 deletions config/job.xml.tim
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
<description/>
<defaultValue/>
</hudson.model.TextParameterDefinition>
<hudson.model.TextParameterDefinition>
<name>SD_UI</name>
<description/>
<defaultValue/>
</hudson.model.TextParameterDefinition>
<hudson.model.PasswordParameterDefinition>
<name>SD_TOKEN</name>
<description/>
Expand Down
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ class JenkinsExecutor extends Executor {
memory: this.memory,
memory_swap: this.memoryLimit,
api_uri: this.ecosystem.api,
store_uri: this.ecosystem.store
store_uri: this.ecosystem.store,
ui_uri: this.ecosystem.ui
};

const templateFile = path.resolve(__dirname, './config/docker-compose.yml.tim');
Expand Down Expand Up @@ -209,6 +210,7 @@ class JenkinsExecutor extends Executor {
* @param {Object} options.ecosystem Screwdriver Ecosystem
* @param {Object} options.ecosystem.api Routable URI to Screwdriver API
* @param {Object} options.ecosystem.store Routable URI to Screwdriver Store
* @param {Object} options.ecosystem.ui Routable URI to Screwdriver UI
* @param {String} options.jenkins.host Jenkins hostname to make requests to
* @param {Number} [options.jenkins.port=8080] Jenkins port to make requests to
* @param {String} [options.jenkins.username='screwdriver'] Jenkins username
Expand Down Expand Up @@ -292,6 +294,7 @@ class JenkinsExecutor extends Executor {
SD_CONTAINER: config.container,
SD_API: this.ecosystem.api,
SD_STORE: this.ecosystem.store,
SD_UI: this.ecosystem.ui,
SD_BUILD_TIMEOUT: buildTimeout
}
}]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"chai": "^4.2.0",
"eslint": "^4.19.0",
"eslint-config-screwdriver": "^4.0.0",
"jenkins-mocha": "^6.0.0",
"jenkins-mocha": "^7.0.0",
"mockery": "^2.0.0",
"sinon": "^7.1.0"
},
Expand Down
9 changes: 6 additions & 3 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ services:
- "-c"
- |
/opt/sd/run.sh "{{token}}" "{{api_uri}}" `
+ `"{{store_uri}}" "$SD_BUILD_TIMEOUT" "{{build_id}}"
+ `"{{store_uri}}" "$SD_BUILD_TIMEOUT" "{{build_id}}" "{{ui_uri}}"
`;

describe('index', () => {
Expand Down Expand Up @@ -95,6 +95,7 @@ describe('index', () => {
SD_CONTAINER: config.container,
SD_API: ecosystem.api,
SD_STORE: ecosystem.store,
SD_UI: ecosystem.ui,
SD_BUILD_TIMEOUT: DEFAULT_BUILD_TIMEOUT
};

Expand Down Expand Up @@ -519,7 +520,8 @@ describe('index', () => {
memory: '4g',
memory_swap: '6g',
api_uri: ecosystem.api,
store_uri: ecosystem.store
store_uri: ecosystem.store,
ui_uri: ecosystem.ui
});

executor = new Executor({
Expand Down Expand Up @@ -594,7 +596,8 @@ rm -f docker-compose.yml
memory,
memory_swap: memoryLimit,
api_uri: ecosystem.api,
store_uri: ecosystem.store
store_uri: ecosystem.store,
ui_uri: ecosystem.ui
});

const buildScriptTim = `
Expand Down

0 comments on commit d3007fe

Please sign in to comment.