Browse Source

Backport build script updates

pull/22550/head
Phillip Webb 5 years ago
parent
commit
53296cd161
  1. 2
      ci/images/releasescripts/pom.xml
  2. 4
      ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/Application.java
  3. 2
      ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/artifactory/ArtifactoryService.java
  4. 2
      ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/artifactory/payload/BuildInfoResponse.java
  5. 2
      ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/bintray/BintrayService.java
  6. 2
      ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/bintray/PackageFile.java
  7. 2
      ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/command/CommandProcessor.java
  8. 2
      ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/command/DistributeCommand.java
  9. 2
      ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/command/PromoteCommand.java
  10. 2
      ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/command/PublishGradlePlugin.java
  11. 2
      ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/command/SyncToCentralCommand.java
  12. 2
      ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/sonatype/SonatypeService.java
  13. 28
      ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/artifactory/ArtifactoryServiceTests.java
  14. 2
      ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/bintray/BintrayServiceTests.java
  15. 2
      ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/command/DistributeCommandTests.java
  16. 2
      ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/sonatype/SonatypeServiceTests.java

2
ci/images/releasescripts/pom.xml

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.RELEASE</version>
<version>2.2.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>io.spring.concourse.releasescripts</groupId>

4
ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/Application.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -18,8 +18,10 @@ package io.spring.concourse.releasescripts; @@ -18,8 +18,10 @@ package io.spring.concourse.releasescripts;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
@SpringBootApplication
@ConfigurationPropertiesScan
public class Application {
public static void main(String[] args) {

2
ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/artifactory/ArtifactoryService.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/artifactory/payload/BuildInfoResponse.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/bintray/BintrayService.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/bintray/PackageFile.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/command/CommandProcessor.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/command/DistributeCommand.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/command/PromoteCommand.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/command/PublishGradlePlugin.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/command/SyncToCentralCommand.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/sonatype/SonatypeService.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

28
ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/artifactory/ArtifactoryServiceTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -84,9 +84,7 @@ class ArtifactoryServiceTests { @@ -84,9 +84,7 @@ class ArtifactoryServiceTests {
@Test
void promoteWhenSuccessful() {
this.server
.expect(requestTo(
"https://repo.spring.io/api/build/promote/" + "example-build" + "/" + "example-build-1"))
this.server.expect(requestTo("https://repo.spring.io/api/build/promote/example-build/example-build-1"))
.andExpect(method(HttpMethod.POST))
.andExpect(content().json(
"{\"status\": \"staged\", \"sourceRepo\": \"libs-staging-local\", \"targetRepo\": \"libs-milestone-local\"}"))
@ -99,11 +97,9 @@ class ArtifactoryServiceTests { @@ -99,11 +97,9 @@ class ArtifactoryServiceTests {
@Test
void promoteWhenArtifactsAlreadyPromoted() {
this.server
.expect(requestTo(
"https://repo.spring.io/api/build/promote/" + "example-build" + "/" + "example-build-1"))
this.server.expect(requestTo("https://repo.spring.io/api/build/promote/example-build/example-build-1"))
.andRespond(withStatus(HttpStatus.CONFLICT));
this.server.expect(requestTo("https://repo.spring.io/api/build/" + "example-build" + "/" + "example-build-1"))
this.server.expect(requestTo("https://repo.spring.io/api/build/example-build/example-build-1"))
.andRespond(withJsonFrom("build-info-response.json"));
this.service.promote("libs-release-local", getReleaseInfo());
this.server.verify();
@ -111,11 +107,9 @@ class ArtifactoryServiceTests { @@ -111,11 +107,9 @@ class ArtifactoryServiceTests {
@Test
void promoteWhenCheckForArtifactsAlreadyPromotedFails() {
this.server
.expect(requestTo(
"https://repo.spring.io/api/build/promote/" + "example-build" + "/" + "example-build-1"))
this.server.expect(requestTo("https://repo.spring.io/api/build/promote/example-build/example-build-1"))
.andRespond(withStatus(HttpStatus.CONFLICT));
this.server.expect(requestTo("https://repo.spring.io/api/build/" + "example-build" + "/" + "example-build-1"))
this.server.expect(requestTo("https://repo.spring.io/api/build/example-build/example-build-1"))
.andRespond(withStatus(HttpStatus.FORBIDDEN));
assertThatExceptionOfType(HttpClientErrorException.class)
.isThrownBy(() -> this.service.promote("libs-release-local", getReleaseInfo()));
@ -124,11 +118,9 @@ class ArtifactoryServiceTests { @@ -124,11 +118,9 @@ class ArtifactoryServiceTests {
@Test
void promoteWhenPromotionFails() {
this.server
.expect(requestTo(
"https://repo.spring.io/api/build/promote/" + "example-build" + "/" + "example-build-1"))
this.server.expect(requestTo("https://repo.spring.io/api/build/promote/example-build/example-build-1"))
.andRespond(withStatus(HttpStatus.CONFLICT));
this.server.expect(requestTo("https://repo.spring.io/api/build/" + "example-build" + "/" + "example-build-1"))
this.server.expect(requestTo("https://repo.spring.io/api/build/example-build/example-build-1"))
.andRespond(withJsonFrom("staged-build-info-response.json"));
assertThatExceptionOfType(HttpClientErrorException.class)
.isThrownBy(() -> this.service.promote("libs-release-local", getReleaseInfo()));
@ -158,9 +150,7 @@ class ArtifactoryServiceTests { @@ -158,9 +150,7 @@ class ArtifactoryServiceTests {
@Test
void distributeWhenFailure() throws Exception {
ReleaseInfo releaseInfo = getReleaseInfo();
this.server
.expect(requestTo(
"https://repo.spring.io/api/build/distribute/" + "example-build" + "/" + "example-build-1"))
this.server.expect(requestTo("https://repo.spring.io/api/build/distribute/example-build/example-build-1"))
.andExpect(method(HttpMethod.POST))
.andExpect(content().json(
"{\"sourceRepos\": [\"libs-release-local\"], \"targetRepo\" : \"spring-distributions\", \"async\":\"true\"}"))

2
ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/bintray/BintrayServiceTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/command/DistributeCommandTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

2
ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/sonatype/SonatypeServiceTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

Loading…
Cancel
Save