Skip to content
This repository was archived by the owner on Jul 17, 2018. It is now read-only.

Commit 55b391c

Browse files
author
Darren Jones
authored
Merge pull request #145 from danieljamesrees/parameterise-plugins-path
Parameterise plugins path
2 parents 626dab8 + 78a4d6a commit 55b391c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

ci/tasks/test-jenkins.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ run:
2727
export JENKINS_HOST="http://localhost:8080"
2828
popd
2929
30+
export INSTALLED_PLUGINS_FILE_PATH="${PWD}/devtools-boshrelease/src/jenkins/plugins.txt"
3031
cp -R devtools-boshrelease/ci/tests/jenkinstest /go/src/
3132
sleep 10
3233
3334
pushd /go/src/jenkinstest
3435
go get github.com/DATA-DOG/godog/cmd/godog
3536
set -e
3637
godog
37-
popd
38+
popd

ci/tests/jenkinstest/plugins_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import (
1010
)
1111

1212
const (
13-
PLUGIN_MANAGER_URL string = "/pluginManager/api/json?depth=1&tree=plugins[shortName,version]"
13+
INSTALLED_PLUGINS_FILE_PATH string = "INSTALLED_PLUGINS_FILE_PATH"
14+
PLUGIN_MANAGER_URL string = "/pluginManager/api/json?depth=1&tree=plugins[shortName,version]"
1415
)
1516

1617
type Plugins struct {
@@ -55,9 +56,8 @@ func getAllInstalledPlugins() (Plugins, error) {
5556

5657
func getAllExpectedPlugins() (Plugins, error) {
5758
var plugins Plugins
58-
filePath, _ := os.Getwd()
5959

60-
p, err := ioutil.ReadFile(filePath + "/../../../src/jenkins/plugins.txt")
60+
p, err := ioutil.ReadFile(os.Getenv(INSTALLED_PLUGINS_FILE_PATH))
6161

6262
if err != nil {
6363
return Plugins{}, fmt.Errorf("%s", err)

0 commit comments

Comments
 (0)