-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(artifacts): add ivy/maven artifact account support
- version-8.0.4
- version-8.0.3
- version-8.0.2
- version-8.0.1
- version-8.0.0
- version-7.3.5
- version-7.3.4
- version-7.3.3
- version-7.3.2
- version-7.3.1
- version-7.3.0
- version-7.2.3
- version-7.2.2
- version-7.2.1
- version-7.2.0
- version-7.1.2
- version-7.1.1
- version-7.1.0
- version-7.0.3
- version-7.0.2
- version-7.0.1
- version-7.0.0
- version-6.11.2
- version-6.11.1
- version-6.11.0
- version-6.10.1
- version-6.10.0
- version-6.9.3
- version-6.9.2
- version-6.9.1
- version-6.9.0
- version-6.8.2
- version-6.8.1
- version-6.8.0
- version-6.7.7
- version-6.7.6
- version-6.7.5
- version-6.7.4
- version-6.7.3
- version-6.7.2
- version-6.7.1
- version-6.7.0
- version-6.6.0
- version-6.5.7
- version-6.5.6
- version-6.5.5
- version-6.5.4
- version-6.5.3
- version-6.5.2
- version-6.5.1
- version-6.5.0
- version-6.4.8
- version-6.4.7
- version-6.4.6
- version-6.4.5
- version-6.4.4
- version-6.4.3
- version-6.4.2
- version-6.4.1
- version-6.4.0
- version-6.3.5
- version-6.3.4
- version-6.3.3
- version-6.3.2
- version-6.3.1
- version-6.3.0
- version-6.2.2
- version-6.2.1
- version-6.2.0
- version-6.1.0
- version-6.0.1
- version-6.0.0
- version-5.6.2
- version-4.7.4
- version-4.7.3
- version-4.7.2
- version-4.7.1
- version-4.7.0
- version-4.6.5
- version-4.6.4
- version-4.6.3
- version-4.6.2
- version-4.6.1
- version-4.6.0
- version-4.5.3
- version-4.5.2
- version-4.5.1
- version-4.5.0
- version-4.4.7
- version-4.4.6
- version-4.4.5
- version-4.4.4
- version-4.4.3
- version-4.4.2
- version-4.4.1
- version-4.4.0
- version-4.3.10
- version-4.3.9
- version-4.3.8
- version-4.3.7
- version-4.3.6
- version-4.3.5
- version-4.3.4
- version-4.3.3
- version-4.3.2
- version-4.3.1
- version-4.3.0
- version-4.2.9
- version-4.2.8
- version-4.2.7
- version-4.2.6
- version-4.2.5
- version-4.2.4
- version-4.2.3
- version-4.2.2
- version-4.2.1
- version-4.2.0
- version-4.1.0
- v5.91.2
- v5.91.1
- v5.91.0
- v5.90.1
- v5.90.0
- v5.89.0
- v5.88.0
- v5.87.0
- v5.86.4
- v5.86.3
- v5.86.2
- v5.86.1
- v5.86.0
- v5.85.5
- v5.85.4
- v5.85.3
- v5.85.2
- v5.85.1
- v5.85.0
- v5.84.0
- v5.83.4
- v5.83.3
- v5.83.2
- v5.83.1
- v5.83.0
- v5.82.2
- v5.82.1
- v5.82.0
- v5.81.2
- v5.81.1
- v5.81.0
- v5.80.9
- v5.80.8
- v5.80.7
- v5.80.6
- v5.80.5
- v5.80.4
- v5.80.3
- v5.80.2
- v5.80.1
- v5.80.0
- v5.79.0
- v5.78.13
- v5.78.12
- v5.78.11
- v5.78.10
- v5.78.9
- v5.78.8
- v5.78.7
- v5.78.6
- v5.78.5
- v5.78.4
- v5.78.3
- v5.78.2
- v5.78.1
- v5.78.0
- v5.77.0
- v5.76.9
- v5.76.8
- v5.76.7
- v5.76.6
- v5.76.5
- v5.76.4
- v5.76.3
- v5.76.2
- v5.76.1
- v5.76.0
- v5.75.0
- v5.74.8
- v5.74.7
- v5.74.6
- v5.74.5
- v5.74.4
- v5.74.3
- v5.74.2
- v5.74.1
- v5.74.0
- v5.73.0
- v5.72.1
- v5.72.0
- v5.71.2
- v5.71.1
- v5.71.0
- v5.70.2
- v5.70.1
- v5.70.0
- v5.69.0
- v5.68.0
- v5.67.0
- v5.66.0
- v5.65.0
- v5.64.0
- v5.63.0
- v5.62.0
- v5.61.0
- v5.60.0
- v5.59.0
- v5.58.0
- v5.57.0
- v5.56.0
- v5.55.1
- v5.55.0
- v5.54.1
- v5.54.0
- v5.53.0
- v5.52.0
- v5.51.0
- v5.50.0
- v5.49.3
- v5.49.2
- v5.49.1
- v5.49.0
- v5.48.1
- v5.48.0
- v5.47.4
- v5.47.3
- v5.47.2
- v5.47.1
- v5.47.0
- v5.46.0
- v5.45.0
- v5.44.0
- v5.43.2
- v5.43.1
- v5.43.0
- v5.42.0
- v5.41.1
- v5.41.0
- v5.40.2
- v5.40.1
- v5.40.0
- v5.39.1
- v5.39.0
- v5.38.1
- v5.38.0
- v5.37.0
- v5.36.0
- v5.35.0
- v5.34.1
- v5.34.0
- v5.33.4
- v5.33.3
- v5.33.2
- v5.33.1
- v5.33.0
- v5.32.5
- v5.32.4
- v5.32.3
- v5.32.2
- v5.32.1
- v5.32.0
- v5.31.3
- v5.31.2
- v5.31.1
- v5.31.0
- v5.30.0
- v5.29.2
- v5.29.1
- v5.29.0
- v5.28.1
- v5.28.0
- v5.27.2
- v5.27.1
- v5.27.0
- v5.26.0
- v5.25.1
- v5.25.0
- v5.24.6
- v5.24.5
- v5.24.4
- v5.24.3
- v5.24.2
- v5.24.1
- v5.24.0
- v5.23.4
- v5.23.3
- v5.23.2
- v5.23.1
- v5.23.0
- v5.22.0
- v5.21.0
- v5.20.1
- v5.20.0
- v5.19.0-rc.14+saga
- v5.19.0-rc.13+saga
- v5.19.0-rc.12+saga
- v5.19.0-rc.11+saga
- v5.19.0-rc.10+saga
- v5.19.0-rc.9+saga
- v5.19.0-rc.8+saga
- v5.19.0-rc.7+saga
- v5.19.0-rc.6+saga
- v5.19.0-rc.5+saga
- v5.19.0-rc.4+saga
- v5.19.0-rc.3+saga
- v5.19.0-rc.2+saga
- v5.19.0-rc.1+saga
- v5.19.0-rc.1-saga
- v5.18.0
- v5.17.1
- v5.17.0
- v5.16.2
- v5.16.1
- v5.16.0
- v5.15.0
- v5.14.0
- v5.13.0
- v5.13.0-rc.9+sagas
- v5.13.0-rc.8+sagas
- v5.13.0-rc.7+sagas
- v5.13.0-rc.6+sagas
- v5.13.0-rc.5+sagas
- v5.13.0-rc.4+sagas
- v5.13.0-rc.3+sagas
- v5.13.0-rc.2+sagas
- v5.13.0-rc.1+sagas
- v5.12.0
- v5.11.0
- v5.10.1
- v5.10.0
- v5.9.1
- v5.9.0
- v5.8.3
- v5.8.2
- v5.8.1
- v5.8.0
- v5.7.0
- v5.6.8
- v5.6.7
- v5.6.6
- v5.6.5
- v5.6.4
- v5.6.3
- v5.6.2
- v5.6.1
- v5.6.0
- v5.5.1
- v5.5.0
- v5.4.1
- v5.4.0
- v5.3.0
- v5.2.0
- v5.1.0
- v5.0.1
- v5.0.0
- v4.0.0-rc.8+springBoot2
- v4.0.0-rc.7+springBoot2
- v4.0.0-rc.6+springBoot2
- v4.0.0-rc.5+springBoot2
- v4.0.0-rc.4+springBoot2
- v4.0.0-rc.2+springBoot2
- v4.0.0-rc.1+springBoot2
- v3.3.2
- v3.3.1
- v3.3.0
- v3.2.4
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.0
- v3.0.1
- v3.0.0
- v3.0.0-rc.6+springBoot2
- v3.0.0-rc.5+springBoot2
- v3.0.0-rc.4+springBoot2
- v3.0.0-rc.3+springBoot2
- v3.0.0-rc.1-springBoot2
- v2.139.0
- v2.138.0
- v2.137.1
- v2.137.0
- v2.136.0
- v2.135.0
- v2.134.0
- v2.133.4
- v2.133.3
- v2.133.2
- v2.133.1
- v2.133.0
- v2.132.0
- v2.131.0
- v2.130.0
- v2.129.0
- v2.128.0
- v2.127.2
- v2.127.1
- v2.127.0
- v2.126.0
- v2.125.1
- v2.125.0
- v2.124.0
- v2.123.0
- v2.122.3
- v2.122.2
- v2.122.1
- v2.122.0
- v2.121.1
- v2.121.0
- v2.120.0
- v2.119.0
- v2.118.1
- v2.118.0
- v2.117.1
- v2.117.0
- v2.116.0
- v2.115.1
- v2.115.0
- v2.114.5
- v2.114.4
- v2.114.3
- v2.114.2
- v2.114.1
- v2.114.0
- v2.113.1
- v2.113.0
- v2.112.3
- v2.112.2
- v2.112.1
- v2.112.0
- v2.111.5
- v2.111.4
- v2.111.3
- v2.111.2
- v2.111.1
- v2.111.0
- v2.110.1
- v2.110.0
- v2.109.0
- v2.108.0
- v2.107.0
- v2.106.5
- v2.106.4
- v2.106.3
- v2.106.2
- v2.106.1
- v2.106.0
- v2.105.0
- v2.104.1
- v2.104.0
- v2.103.0
- v2.102.0
- v2.101.4
- v2.101.3
- v2.101.2
- v2.101.0
- v2.100.2
- v2.100.1
- v2.100.0
- v2.99.1
- 5.55.0
- 4.0.0-rc.3+springBoot2
1 parent
6264624
commit d24e722
Showing
31 changed files
with
1,622 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...src/main/java/com/netflix/spinnaker/clouddriver/artifacts/ivy/DiskFreeingInputStream.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright 2018 Pivotal, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.clouddriver.artifacts.ivy; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.util.Comparator; | ||
|
||
/** | ||
* An {@link java.io.InputStream} that frees local disk resources when closed. | ||
*/ | ||
public class DiskFreeingInputStream extends InputStream { | ||
private final InputStream delegate; | ||
private final Path deleteOnClose; | ||
|
||
public DiskFreeingInputStream(InputStream delegate, Path deleteOnClose) { | ||
this.delegate = delegate; | ||
this.deleteOnClose = deleteOnClose; | ||
} | ||
|
||
@Override | ||
public int read() throws IOException { | ||
return delegate.read(); | ||
} | ||
|
||
@Override | ||
public void close() throws IOException { | ||
super.close(); | ||
if (Files.exists(deleteOnClose)) { | ||
Files.walk(deleteOnClose) | ||
.map(Path::toFile) | ||
.sorted(Comparator.reverseOrder()) | ||
.forEach(File::delete); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...cts/src/main/java/com/netflix/spinnaker/clouddriver/artifacts/ivy/IvyArtifactAccount.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2018 Pivotal, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.clouddriver.artifacts.ivy; | ||
|
||
import com.netflix.spinnaker.clouddriver.artifacts.config.ArtifactAccount; | ||
import com.netflix.spinnaker.clouddriver.artifacts.ivy.settings.IvySettings; | ||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
import static java.util.Collections.singletonList; | ||
|
||
@Data | ||
public class IvyArtifactAccount implements ArtifactAccount { | ||
private String name; | ||
private IvySettings settings; | ||
private List<String> resolveConfigurations = singletonList("master"); | ||
} |
57 changes: 57 additions & 0 deletions
57
...c/main/java/com/netflix/spinnaker/clouddriver/artifacts/ivy/IvyArtifactConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright 2018 Pivotal, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.clouddriver.artifacts.ivy; | ||
|
||
import com.netflix.spinnaker.clouddriver.artifacts.ArtifactCredentialsRepository; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
import java.util.stream.Collectors; | ||
|
||
@Configuration | ||
@ConditionalOnProperty("artifacts.ivy.enabled") | ||
@EnableConfigurationProperties(IvyArtifactProviderProperties.class) | ||
@RequiredArgsConstructor | ||
@Slf4j | ||
public class IvyArtifactConfiguration { | ||
private final IvyArtifactProviderProperties ivyArtifactProviderProperties; | ||
private final ArtifactCredentialsRepository artifactCredentialsRepository; | ||
|
||
@Bean | ||
List<? extends IvyArtifactCredentials> ivyArtifactCredentials() { | ||
return ivyArtifactProviderProperties.getAccounts() | ||
.stream() | ||
.map(a -> { | ||
try { | ||
IvyArtifactCredentials c = new IvyArtifactCredentials(a); | ||
artifactCredentialsRepository.save(c); | ||
return c; | ||
} catch (Exception e) { | ||
log.warn("Failure instantiating ivy artifact account {}: ", a, e); | ||
return null; | ||
} | ||
}) | ||
.filter(Objects::nonNull) | ||
.collect(Collectors.toList()); | ||
} | ||
} |
137 changes: 137 additions & 0 deletions
137
...src/main/java/com/netflix/spinnaker/clouddriver/artifacts/ivy/IvyArtifactCredentials.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
/* | ||
* Copyright 2018 Pivotal, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.clouddriver.artifacts.ivy; | ||
|
||
import com.netflix.spinnaker.clouddriver.artifacts.config.ArtifactCredentials; | ||
import com.netflix.spinnaker.kork.artifacts.model.Artifact; | ||
import lombok.Data; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.ivy.Ivy; | ||
import org.apache.ivy.core.module.id.ModuleId; | ||
import org.apache.ivy.core.module.id.ModuleRevisionId; | ||
import org.apache.ivy.core.report.ResolveReport; | ||
import org.apache.ivy.core.resolve.ResolveOptions; | ||
import org.apache.ivy.util.AbstractMessageLogger; | ||
import org.apache.ivy.util.Message; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.io.*; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.text.ParseException; | ||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.UUID; | ||
import java.util.function.Supplier; | ||
|
||
@Slf4j | ||
@Data | ||
public class IvyArtifactCredentials implements ArtifactCredentials { | ||
private final List<String> types = Collections.singletonList("ivy/file"); | ||
private final IvyArtifactAccount account; | ||
private final Supplier<Path> cacheBuilder; | ||
|
||
public IvyArtifactCredentials(IvyArtifactAccount account) { | ||
this(account, () -> Paths.get(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString())); | ||
} | ||
|
||
public IvyArtifactCredentials(IvyArtifactAccount account, Supplier<Path> cacheBuilder) { | ||
this.cacheBuilder = cacheBuilder; | ||
redirectIvyLogsToSlf4j(); | ||
this.account = account; | ||
} | ||
|
||
private static void redirectIvyLogsToSlf4j() { | ||
Message.setDefaultLogger(new AbstractMessageLogger() { | ||
private final Logger logger = LoggerFactory.getLogger("org.apache.ivy"); | ||
|
||
@Override | ||
protected void doProgress() { | ||
} | ||
|
||
@Override | ||
protected void doEndProgress(String msg) { | ||
log(msg, Message.MSG_INFO); | ||
} | ||
|
||
@Override | ||
public void log(String msg, int level) { | ||
switch (level) { | ||
case Message.MSG_ERR: | ||
logger.error(msg); | ||
break; | ||
case Message.MSG_WARN: | ||
logger.warn(msg); | ||
break; | ||
case Message.MSG_INFO: | ||
logger.info(msg); | ||
break; | ||
case Message.MSG_DEBUG: | ||
logger.debug(msg); | ||
break; | ||
case Message.MSG_VERBOSE: | ||
logger.trace(msg); | ||
default: | ||
// do nothing | ||
} | ||
} | ||
|
||
@Override | ||
public void rawlog(String msg, int level) { | ||
log(msg, level); | ||
} | ||
}); | ||
} | ||
|
||
public InputStream download(Artifact artifact) { | ||
Path cacheDir = cacheBuilder.get(); | ||
Ivy ivy = account.getSettings().toIvy(cacheDir); | ||
|
||
String[] parts = artifact.getReference().split(":"); | ||
if (parts.length < 3) { | ||
throw new IllegalArgumentException("Ivy artifact reference must have a group, artifact, and version separated by ':'"); | ||
} | ||
|
||
ModuleRevisionId mrid = new ModuleRevisionId(new ModuleId(parts[0], parts[1]), parts[2]); | ||
|
||
try { | ||
ResolveReport report = ivy.resolve(mrid, (ResolveOptions) new ResolveOptions() | ||
.setTransitive(false) | ||
.setConfs(account.getResolveConfigurations().toArray(new String[0])) | ||
.setLog("download-only"), true); | ||
return Arrays.stream(report.getAllArtifactsReports()) | ||
.findFirst() | ||
.map(rep -> { | ||
try { | ||
return new DiskFreeingInputStream(new FileInputStream(rep.getLocalFile()), cacheDir); | ||
} catch (FileNotFoundException e) { | ||
throw new UncheckedIOException(e); | ||
} | ||
}) | ||
.orElseThrow(() -> new IllegalArgumentException("Unable to resolve artifact for reference '" + artifact.getReference() + "'")); | ||
} catch (ParseException | IOException e) { | ||
throw new IllegalArgumentException(e); | ||
} | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return account.getName(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...n/java/com/netflix/spinnaker/clouddriver/artifacts/ivy/IvyArtifactProviderProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright 2018 Pivotal, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.clouddriver.artifacts.ivy; | ||
|
||
import lombok.Data; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Data | ||
@ConfigurationProperties("artifacts.ivy") | ||
public class IvyArtifactProviderProperties { | ||
private boolean enabled; | ||
private List<IvyArtifactAccount> accounts = new ArrayList<>(); | ||
} |
49 changes: 49 additions & 0 deletions
49
...c/main/java/com/netflix/spinnaker/clouddriver/artifacts/ivy/settings/BintrayResolver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright 2018 Pivotal, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.clouddriver.artifacts.ivy.settings; | ||
|
||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
@EqualsAndHashCode(callSuper = true) | ||
@Data | ||
public class BintrayResolver extends Resolver<org.apache.ivy.plugins.resolver.BintrayResolver> { | ||
/** | ||
* Bintray username of a repository owner. | ||
*/ | ||
@JacksonXmlProperty(isAttribute = true) | ||
@Nullable | ||
private String subject; | ||
|
||
/** | ||
* User’s repository name. | ||
*/ | ||
@JacksonXmlProperty(isAttribute = true) | ||
@Nullable | ||
private String repo; | ||
|
||
@Override | ||
public org.apache.ivy.plugins.resolver.BintrayResolver toIvyModel() { | ||
org.apache.ivy.plugins.resolver.BintrayResolver bintrayResolver = new org.apache.ivy.plugins.resolver.BintrayResolver(); | ||
bintrayResolver.setRepo(repo); | ||
bintrayResolver.setSubject(subject); | ||
return super.toIvyModel(bintrayResolver); | ||
} | ||
} |
Oops, something went wrong.