• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jreleaser / jreleaser / #512

27 Jul 2025 05:51PM UTC coverage: 45.153% (-0.7%) from 45.803%
#512

push

github

aalmiray
feat(core): Add a --deploy flag to config

Closes #1946

3 of 11 new or added lines in 4 files covered. (27.27%)

845 existing lines in 34 files now uncovered.

23625 of 52322 relevant lines covered (45.15%)

0.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.32
/api/jreleaser-model-api/src/main/java/org/jreleaser/model/api/JReleaserContext.java
1
/*
2
 * SPDX-License-Identifier: Apache-2.0
3
 *
4
 * Copyright 2020-2025 The JReleaser authors.
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     https://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
package org.jreleaser.model.api;
19

20
import org.jreleaser.logging.JReleaserLogger;
21
import org.jreleaser.model.api.signing.Keyring;
22
import org.jreleaser.model.api.signing.SigningException;
23
import org.jreleaser.mustache.TemplateContext;
24

25
import java.io.Serializable;
26
import java.nio.file.Path;
27
import java.util.List;
28
import java.util.Map;
29

30
import static org.jreleaser.model.Constants.KEY_CHANGELOG;
31
import static org.jreleaser.model.Constants.KEY_CHANGELOG_CHANGES;
32
import static org.jreleaser.model.Constants.KEY_CHANGELOG_CONTRIBUTORS;
33
import static org.jreleaser.mustache.MustacheUtils.passThrough;
34

35
/**
36
 * @author Andres Almiray
37
 * @since 0.1.0
38
 */
39
public interface JReleaserContext extends Serializable {
40
    String BASEDIR = "BASEDIR";
41
    String YOLO = "YOLO";
42
    String DRY_RUN = "DRY_RUN";
43
    String GIT_ROOT_SEARCH = "GIT_ROOT_SEARCH";
44
    String STRICT = "STRICT";
45
    String SELECT_CURRENT_PLATFORM = "SELECT_CURRENT_PLATFORM";
46
    String SELECT_PLATFORMS = "SELECT_PLATFORMS";
47
    String REJECT_PLATFORMS = "REJECT_PLATFORMS";
48

49
    Path relativize(Path basedir, Path other);
50

51
    Path relativizeToBasedir(Path other);
52

53
    JReleaserLogger getLogger();
54

55
    Mode getMode();
56

57
    JReleaserModel getModel();
58

59
    Path getBasedir();
60

61
    Path getSettings();
62

63
    Path getOutputDirectory();
64

65
    Path getChecksumsDirectory();
66

67
    Path getCatalogsDirectory();
68

69
    Path getSignaturesDirectory();
70

71
    Path getPrepareDirectory();
72

73
    Path getPackageDirectory();
74

75
    Path getPublishDirectory();
76

77
    Path getAssembleDirectory();
78

79
    Path getDownloadDirectory();
80

81
    Path getArtifactsDirectory();
82

83
    Path getDeployDirectory();
84

85
    boolean isYolo();
86

87
    boolean isDryrun();
88

89
    boolean isGitRootSearch();
90

91
    boolean isStrict();
92

93
    List<String> getIncludedAnnouncers();
94

95
    List<String> getIncludedAssemblers();
96

97
    List<String> getIncludedDistributions();
98

99
    List<String> getIncludedPackagers();
100

101
    List<String> getIncludedDownloaderTypes();
102

103
    List<String> getIncludedDownloaderNames();
104

105
    List<String> getIncludedDeployerTypes();
106

107
    List<String> getIncludedDeployerNames();
108

109
    List<String> getIncludedUploaderTypes();
110

111
    List<String> getIncludedUploaderNames();
112

113
    List<String> getExcludedAnnouncers();
114

115
    List<String> getExcludedAssemblers();
116

117
    List<String> getExcludedDistributions();
118

119
    List<String> getExcludedPackagers();
120

121
    List<String> getExcludedDownloaderTypes();
122

123
    List<String> getExcludedDownloaderNames();
124

125
    List<String> getExcludedDeployerTypes();
126

127
    List<String> getExcludedDeployerNames();
128

129
    List<String> getExcludedUploaderTypes();
130

131
    List<String> getExcludedUploaderNames();
132

133
    JReleaserCommand getCommand();
134

135
    TemplateContext props();
136

137
    TemplateContext fullProps();
138

139
    void nag(String version, String message);
140

141
    Keyring createKeyring() throws SigningException;
142

143
    Changelog getChangelog();
144

145
    Map<String, Object> getAdditionalProperties();
146

147
    class Changelog implements Serializable {
1✔
148
        private static final long serialVersionUID = -7619174395858420344L;
149

150
        private String resolvedChangelog;
151
        private String formattedChanges;
152
        private String formattedContributors;
153

154
        public String getResolvedChangelog() {
155
            return resolvedChangelog;
1✔
156
        }
157

158
        public void setResolvedChangelog(String resolvedChangelog) {
159
            this.resolvedChangelog = resolvedChangelog;
1✔
160
        }
1✔
161

162
        public String getFormattedChanges() {
UNCOV
163
            return formattedChanges;
×
164
        }
165

166
        public void setFormattedChanges(String formattedChanges) {
167
            this.formattedChanges = formattedChanges;
1✔
168
        }
1✔
169

170
        public String getFormattedContributors() {
UNCOV
171
            return formattedContributors;
×
172
        }
173

174
        public void setFormattedContributors(String formattedContributors) {
175
            this.formattedContributors = formattedContributors;
1✔
176
        }
1✔
177

178
        public void apply(TemplateContext props) {
179
            if (!props.contains(KEY_CHANGELOG)) props.set(KEY_CHANGELOG, passThrough(resolvedChangelog));
1✔
180
            if (!props.contains(KEY_CHANGELOG_CHANGES)) props.set(KEY_CHANGELOG_CHANGES, passThrough(formattedChanges));
1✔
181
            if (!props.contains(KEY_CHANGELOG_CONTRIBUTORS)) {
1✔
182
                props.set(KEY_CHANGELOG_CONTRIBUTORS, passThrough(formattedContributors));
1✔
183
            }
184
        }
1✔
185
    }
186

187
    enum Mode {
1✔
188
        CONFIG,
1✔
189
        DOWNLOAD,
1✔
190
        ASSEMBLE,
1✔
191
        DEPLOY,
1✔
192
        FULL,
1✔
193
        CHANGELOG,
1✔
194
        ANNOUNCE;
1✔
195

196
        public boolean validateChangelog() {
UNCOV
197
            return this == CHANGELOG;
×
198
        }
199

200
        public boolean validateAnnounce() {
201
            return this == ANNOUNCE;
1✔
202
        }
203

204
        public boolean validateDeploy() {
205
            return this == DEPLOY;
1✔
206
        }
207

208
        public boolean validateDownload() {
209
            return this == DOWNLOAD;
1✔
210
        }
211

212
        public boolean validateAssembly() {
213
            return this == ASSEMBLE;
1✔
214
        }
215

216
        public boolean validateStandalone() {
217
            return validateAssembly() || validateDownload() || validateDeploy();
1✔
218
        }
219

220
        public boolean validateConfig() {
221
            return this == CONFIG || this == FULL;
1✔
222
        }
223

224
        public boolean validatePaths() {
225
            return this == FULL;
1✔
226
        }
227
    }
228
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc