Commit 53296cd1 authored by Phillip Webb's avatar Phillip Webb

Backport build script updates

parent c043701d
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.RELEASE</version> <version>2.2.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
<groupId>io.spring.concourse.releasescripts</groupId> <groupId>io.spring.concourse.releasescripts</groupId>
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
@SpringBootApplication @SpringBootApplication
@ConfigurationPropertiesScan
public class Application { public class Application {
public static void main(String[] args) { public static void main(String[] args) {
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 @Test
void promoteWhenSuccessful() { void promoteWhenSuccessful() {
this.server this.server.expect(requestTo("https://repo.spring.io/api/build/promote/example-build/example-build-1"))
.expect(requestTo(
"https://repo.spring.io/api/build/promote/" + "example-build" + "/" + "example-build-1"))
.andExpect(method(HttpMethod.POST)) .andExpect(method(HttpMethod.POST))
.andExpect(content().json( .andExpect(content().json(
"{\"status\": \"staged\", \"sourceRepo\": \"libs-staging-local\", \"targetRepo\": \"libs-milestone-local\"}")) "{\"status\": \"staged\", \"sourceRepo\": \"libs-staging-local\", \"targetRepo\": \"libs-milestone-local\"}"))
...@@ -99,11 +97,9 @@ class ArtifactoryServiceTests { ...@@ -99,11 +97,9 @@ class ArtifactoryServiceTests {
@Test @Test
void promoteWhenArtifactsAlreadyPromoted() { void promoteWhenArtifactsAlreadyPromoted() {
this.server this.server.expect(requestTo("https://repo.spring.io/api/build/promote/example-build/example-build-1"))
.expect(requestTo(
"https://repo.spring.io/api/build/promote/" + "example-build" + "/" + "example-build-1"))
.andRespond(withStatus(HttpStatus.CONFLICT)); .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")); .andRespond(withJsonFrom("build-info-response.json"));
this.service.promote("libs-release-local", getReleaseInfo()); this.service.promote("libs-release-local", getReleaseInfo());
this.server.verify(); this.server.verify();
...@@ -111,11 +107,9 @@ class ArtifactoryServiceTests { ...@@ -111,11 +107,9 @@ class ArtifactoryServiceTests {
@Test @Test
void promoteWhenCheckForArtifactsAlreadyPromotedFails() { void promoteWhenCheckForArtifactsAlreadyPromotedFails() {
this.server this.server.expect(requestTo("https://repo.spring.io/api/build/promote/example-build/example-build-1"))
.expect(requestTo(
"https://repo.spring.io/api/build/promote/" + "example-build" + "/" + "example-build-1"))
.andRespond(withStatus(HttpStatus.CONFLICT)); .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)); .andRespond(withStatus(HttpStatus.FORBIDDEN));
assertThatExceptionOfType(HttpClientErrorException.class) assertThatExceptionOfType(HttpClientErrorException.class)
.isThrownBy(() -> this.service.promote("libs-release-local", getReleaseInfo())); .isThrownBy(() -> this.service.promote("libs-release-local", getReleaseInfo()));
...@@ -124,11 +118,9 @@ class ArtifactoryServiceTests { ...@@ -124,11 +118,9 @@ class ArtifactoryServiceTests {
@Test @Test
void promoteWhenPromotionFails() { void promoteWhenPromotionFails() {
this.server this.server.expect(requestTo("https://repo.spring.io/api/build/promote/example-build/example-build-1"))
.expect(requestTo(
"https://repo.spring.io/api/build/promote/" + "example-build" + "/" + "example-build-1"))
.andRespond(withStatus(HttpStatus.CONFLICT)); .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")); .andRespond(withJsonFrom("staged-build-info-response.json"));
assertThatExceptionOfType(HttpClientErrorException.class) assertThatExceptionOfType(HttpClientErrorException.class)
.isThrownBy(() -> this.service.promote("libs-release-local", getReleaseInfo())); .isThrownBy(() -> this.service.promote("libs-release-local", getReleaseInfo()));
...@@ -158,9 +150,7 @@ class ArtifactoryServiceTests { ...@@ -158,9 +150,7 @@ class ArtifactoryServiceTests {
@Test @Test
void distributeWhenFailure() throws Exception { void distributeWhenFailure() throws Exception {
ReleaseInfo releaseInfo = getReleaseInfo(); ReleaseInfo releaseInfo = getReleaseInfo();
this.server this.server.expect(requestTo("https://repo.spring.io/api/build/distribute/example-build/example-build-1"))
.expect(requestTo(
"https://repo.spring.io/api/build/distribute/" + "example-build" + "/" + "example-build-1"))
.andExpect(method(HttpMethod.POST)) .andExpect(method(HttpMethod.POST))
.andExpect(content().json( .andExpect(content().json(
"{\"sourceRepos\": [\"libs-release-local\"], \"targetRepo\" : \"spring-distributions\", \"async\":\"true\"}")) "{\"sourceRepos\": [\"libs-release-local\"], \"targetRepo\" : \"spring-distributions\", \"async\":\"true\"}"))
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment