{
51 | @Override
52 | public String getDisplayName() {
53 | return "";
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/BuildInfoSummary/badge.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/BuildInfoSummary/summary.jelly:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 | ${it.displayName}
6 |
7 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployDeploymentRecorder/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployDeploymentRecorder/global.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployDeploymentRecorder/help-environment.html:
--------------------------------------------------------------------------------
1 |
2 | The environment to deploy to.
3 |
4 | This field is case-sensitive.
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployDeploymentRecorder/help-project.html:
--------------------------------------------------------------------------------
1 |
2 | The project name in OctopusDeploy.
3 |
4 | This field is case-sensitive.
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployDeploymentRecorder/help-releaseVersion.html:
--------------------------------------------------------------------------------
1 |
2 | The version of the release to move.
3 |
4 | This field is case-sensitive.
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployDeploymentRecorder/help-serverId.html:
--------------------------------------------------------------------------------
1 |
2 | The identifier of the OctopusDeploy server which you want to use for executing this deployment.
3 |
4 | Server Id is set in the global OctopusDeploy Plugin configuration.
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployDeploymentRecorder/help-tenant.html:
--------------------------------------------------------------------------------
1 |
2 | The tenant to deploy to.
3 |
4 | This field is case-sensitive.
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployDeploymentRecorder/help-variables.html:
--------------------------------------------------------------------------------
1 |
2 | List of variable to pass to the Depoyment process
3 |
4 | Use Java properties notation
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployDeploymentRecorder/help-waitForDeployment.html:
--------------------------------------------------------------------------------
1 |
2 | If selected, this build will wait until the deployment is complete.
3 |
4 | When this is selected, the deployment state will fail the build if the state ends as "Failed"
5 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployPlugin/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployPlugin/global.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployPlugin/help-apiKey.html:
--------------------------------------------------------------------------------
1 |
2 | The API key for a user intended to interact with the OctopusDeploy instance.
3 |
4 | This key will be used for all operations with OctopusDeploy on this server for this plugin.
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployPlugin/help-serverId.html:
--------------------------------------------------------------------------------
1 |
2 | Server Id is unique identifier given to each Octopus Deploy server. It is recommended that this is easy for users to recognize.
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployPlugin/help-url.html:
--------------------------------------------------------------------------------
1 |
2 | The OctopusDeploy host URL.
3 |
4 | For example: https://OctopusDeploy.mydomain.net
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployReleaseRecorder/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployReleaseRecorder/global.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployReleaseRecorder/help-channel.html:
--------------------------------------------------------------------------------
1 |
2 | If left empty the Default channel for the project will be used.
3 |
4 | Otherwise, specify a channel by name. The channel specified must exist for the current project.
5 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployReleaseRecorder/help-defaultPackageVersion.html:
--------------------------------------------------------------------------------
1 |
2 | The default version to use for all required packages that are not specified in Package Configurations. No default packages are used if a default version is not specified
3 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployReleaseRecorder/help-deployThisRelease.html:
--------------------------------------------------------------------------------
1 |
2 | Select this when this release should be deployed immediately after it is created.
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployReleaseRecorder/help-environment.html:
--------------------------------------------------------------------------------
1 |
2 | The environment to deploy this release into.
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployReleaseRecorder/help-jenkinsUrlLinkback.html:
--------------------------------------------------------------------------------
1 |
2 | Adds a linkback to the Jenkins build that created the release in the Octopus Deploy release notes
3 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployReleaseRecorder/help-project.html:
--------------------------------------------------------------------------------
1 |
2 | The name of the project as defined in OctopusDeploy.
3 | This field is case sensitive.
4 |
5 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployReleaseRecorder/help-releaseNotes.html:
--------------------------------------------------------------------------------
1 |
2 | Select this option when you want to include release notes in this release.
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployReleaseRecorder/help-releaseNotesFile.html:
--------------------------------------------------------------------------------
1 |
2 | Path to file, relative from workspace root, to read for release notes.
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployReleaseRecorder/help-releaseNotesFromSCM.html:
--------------------------------------------------------------------------------
1 |
2 | Get the release notes from SCM.
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployReleaseRecorder/help-releaseVersion.html:
--------------------------------------------------------------------------------
1 |
2 | The version of the release to create.
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployReleaseRecorder/help-serverId.html:
--------------------------------------------------------------------------------
1 |
2 | The identifier of the OctopusDeploy server which you want to use for creating this release.
3 |
4 | Server Id is set in the global OctopusDeploy Plugin configuration.
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployReleaseRecorder/help-tenant.html:
--------------------------------------------------------------------------------
1 |
2 | The tenant to deploy to.
3 |
4 | This field is case-sensitive.
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/OctopusDeployReleaseRecorder/help-waitForDeployment.html:
--------------------------------------------------------------------------------
1 |
2 | If selected, this build will wait until the deployment is complete.
3 |
4 | When this is selected, the deployment state will fail the build if the state ends as "Failed"
5 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/PackageConfiguration/config.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/PackageConfiguration/global.jelly:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/PackageConfiguration/help-packageName.html:
--------------------------------------------------------------------------------
1 |
2 | The step-name that requires a version for a nuget package.
3 |
4 | This field is case-sensitive.
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/PackageConfiguration/help-packageReferenceName.html:
--------------------------------------------------------------------------------
1 |
2 | The package reference name within the step. This value is required only if you are using the
package referencing feature.
3 |
4 |
This field is case-sensitive.
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/hudson/plugins/octopusdeploy/PackageConfiguration/help-packageVersion.html:
--------------------------------------------------------------------------------
1 |
2 | The package's version for this release.
3 |
4 | This field is case-sensitive.
5 |
6 |
--------------------------------------------------------------------------------
/src/main/resources/index.jelly:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | This plugin allows integration with one or more OctopusDeploy instances.
7 |
8 |
--------------------------------------------------------------------------------
/src/main/webapp/images/octopus-d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/octopusdeploy-plugin/247a2cc99fc57e3ecc6d718855a634772cb6d259/src/main/webapp/images/octopus-d.png
--------------------------------------------------------------------------------
/src/main/webapp/images/octopus-o.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/octopusdeploy-plugin/247a2cc99fc57e3ecc6d718855a634772cb6d259/src/main/webapp/images/octopus-o.png
--------------------------------------------------------------------------------
/src/main/webapp/images/octopus-r.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jenkinsci/octopusdeploy-plugin/247a2cc99fc57e3ecc6d718855a634772cb6d259/src/main/webapp/images/octopus-r.png
--------------------------------------------------------------------------------
/src/test/java/com/octopusdeploy/api/ErrorParserTest.java:
--------------------------------------------------------------------------------
1 | package com.octopusdeploy.api;
2 |
3 | import java.util.ArrayList;
4 | import java.util.HashSet;
5 | import java.util.List;
6 | import java.util.Random;
7 | import java.util.Set;
8 | import org.junit.After;
9 | import org.junit.AfterClass;
10 | import org.junit.Before;
11 | import org.junit.BeforeClass;
12 | import org.junit.Test;
13 | import static org.junit.Assert.*;
14 |
15 | /**
16 | * OctopusApi tests
17 | * @author jlabroad
18 | */
19 | public class ErrorParserTest {
20 |
21 | private Random rand = null;
22 | private Set forbiddenChars = null;
23 |
24 | public ErrorParserTest() {
25 | }
26 |
27 | @BeforeClass
28 | public static void setUpClass() {
29 | }
30 |
31 | @AfterClass
32 | public static void tearDownClass() {
33 | }
34 |
35 | @Before
36 | public void setUp() {
37 | rand = new Random();
38 |
39 | //These characters cannot be in error messages.
40 | forbiddenChars = new HashSet();
41 | forbiddenChars.add('\"');
42 | forbiddenChars.add('\\');
43 | forbiddenChars.add(']');
44 | }
45 |
46 | @After
47 | public void tearDown() {
48 | }
49 |
50 | /**
51 | * Test of getErrorsFromResponse method, of class OctopusApi. Using a single sample Octopus response
52 | */
53 | @Test
54 | public void testGetErrorsFromResponseStatic() {
55 | System.out.println("getErrorsFromResponse");
56 | String errMsg1 = "No package version was specified for the step 'test nuget'";
57 | String errMsg2 = "Error msg number 2";
58 | String response = String.format(" Octopus Deploy ",
59 | errMsg1, errMsg2);
60 | String result = ErrorParser.getErrorsFromResponse(response);
61 | assertEquals(result.contains(errMsg1), true);
62 | assertEquals(result.contains(errMsg2), true);
63 | }
64 |
65 | /**
66 | * Test of getErrorsFromResponse method, of class OctopusApi.
67 | * Using many semi-random Octopus responses
68 | */
69 | @Test
70 | public void testGetErrorsFromResponseRandom() {
71 | for (int i = 0; i < 2000; i++) {
72 | List errMsgs = new ArrayList();
73 | String response = generateRandomErrorResponse(errMsgs);
74 | String result = ErrorParser.getErrorsFromResponse(response);
75 | for (String errMsg : errMsgs) {
76 | boolean testResult = result.contains(errMsg);
77 | if (!testResult) {
78 | System.out.println(String.format("Could not find error msg: %s", errMsg));
79 | }
80 | assertEquals(testResult, true);
81 | }
82 | }
83 | }
84 |
85 | /**
86 | * Generate a random error response
87 | * @param errorMsgList
88 | * @return
89 | */
90 | private String generateRandomErrorResponse(List errorMsgList) {
91 | final int maxNumMsgs = 15;
92 | String errMsg = "";
93 | String prefix = generateRandomString();
94 | String suffix = generateRandomString();
95 |
96 | int numDetails = (int)(rand.nextDouble() * maxNumMsgs);
97 | String errorFormatPrefix = "var errorData = {\"title\":\"Bad request\",\"message\":\"There was a problem with your request.\",\"details\":{\"ErrorMessage\":\"There was a problem with your request.\",\"Errors\":[";
98 | String errorFormatSuffix = "]}};";
99 | errMsg += prefix;
100 | errMsg += errorFormatPrefix;
101 | for (int i = 0; i < numDetails; i++) {
102 | String randomErrMsg = generateRandomString();
103 | errMsg += String.format("\"%s\"", randomErrMsg);
104 | errorMsgList.add(randomErrMsg);
105 | if (i < numDetails - 1)
106 | errMsg += ", ";
107 | }
108 | errMsg += errorFormatSuffix;
109 | errMsg += suffix;
110 | return errMsg;
111 | }
112 |
113 | private String generateRandomString() {
114 | final int maxCharacters = 500;
115 | int numCharacters = (int)(rand.nextDouble()*maxCharacters);
116 |
117 | final int minAscii = 32;
118 | final int maxAscii = 126;
119 | String msg = "";
120 | for (int i = 0; i < numCharacters; i++) {
121 | int randInt = (int)(rand.nextDouble()*(maxAscii - minAscii) + minAscii + 0.5);
122 | Character randChar = (char)randInt;
123 | //Do not allow forbidden characters
124 | if (forbiddenChars.contains(randChar))
125 | continue; //Just skip it
126 |
127 | msg += (char) randInt;
128 | }
129 | return msg;
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/src/test/java/hudson/plugins/octopusdeploy/JSONSanitizerTest.java:
--------------------------------------------------------------------------------
1 | package hudson.plugins.octopusdeploy;
2 |
3 | import org.junit.After;
4 | import org.junit.AfterClass;
5 | import org.junit.Before;
6 | import org.junit.BeforeClass;
7 | import org.junit.Test;
8 | import static org.junit.Assert.*;
9 |
10 | /**
11 | * Unit tests for JSONSanitizer
12 | * @author jlabroad
13 | */
14 | public class JSONSanitizerTest {
15 |
16 | public JSONSanitizerTest() {
17 | }
18 |
19 | @BeforeClass
20 | public static void setUpClass() {
21 | }
22 |
23 | @AfterClass
24 | public static void tearDownClass() {
25 | }
26 |
27 | @Before
28 | public void setUp() {
29 | }
30 |
31 | @After
32 | public void tearDown() {
33 | }
34 |
35 | /**
36 | * Test of sanitize method, of class JSONSanitizer.
37 | */
38 | @Test
39 | public void testLargeString() {
40 | String testString = "These release notes include quotes and some special characters.\n" +
41 | "Consider this: \"I am a quote\" -anonymous, or \"\"I am a double-quote\" -anonymous\" -some other guy\n" +
42 | "Sometimes you have some \"quotes\", sometimes some other characters like ! @ # $ % ^ & * () - + = _ {} [] ~ `\n" +
43 | "Backslashes too: C:\\Program Files (x86)\\Jenkins\\workspace or \"C:\\Program Files (x86)\\Jenkins\\workspace\"\n" +
44 | "\\\\ 2 backslashes\n" +
45 | " This paragraph starts with a tab. This paragraph starts with a tab. This paragraph starts with a tab.\n" +
46 | "This paragraph starts with a tab. This paragraph starts with a tab. This paragraph starts with a tab.\n";
47 |
48 | final String answer = "These release notes include quotes and some special characters.
" +
49 | "Consider this: \\\"I am a quote\\\" -anonymous, or \\\"\\\"I am a double-quote\\\" -anonymous\\\" -some other guy
" +
50 | "Sometimes you have some \\\"quotes\\\", sometimes some other characters like ! @ # $ % ^ & * () - + = _ {} [] ~ `
" +
51 | "Backslashes too: C:\\u005CProgram Files (x86)\\u005CJenkins\\u005Cworkspace or \\\"C:\\u005CProgram Files (x86)\\u005CJenkins\\u005Cworkspace\\\"
\\u005C\\u005C 2 backslashes
" +
52 | " This paragraph starts with a tab. This paragraph starts with a tab. " +
53 | "This paragraph starts with a tab.
This paragraph starts with a tab. This paragraph starts with a tab. This paragraph starts with a tab.
";
54 |
55 | String sanitized = JSONSanitizer.getInstance().sanitize(testString);
56 | assertEquals(sanitized.equals(answer), true);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------