Backport build script updates
This commit is contained in:
parent
c043701dc0
commit
53296cd161
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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");
|
* 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;
|
||||||
|
|
||||||
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) {
|
||||||
|
|
|
||||||
|
|
@ -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");
|
* 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.
|
||||||
|
|
|
||||||
|
|
@ -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");
|
* 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.
|
||||||
|
|
|
||||||
|
|
@ -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");
|
* 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.
|
||||||
|
|
|
||||||
|
|
@ -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");
|
* 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.
|
||||||
|
|
|
||||||
|
|
@ -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");
|
* 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.
|
||||||
|
|
|
||||||
|
|
@ -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");
|
* 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.
|
||||||
|
|
|
||||||
|
|
@ -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");
|
* 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.
|
||||||
|
|
|
||||||
|
|
@ -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");
|
* 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.
|
||||||
|
|
|
||||||
|
|
@ -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");
|
* 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.
|
||||||
|
|
|
||||||
|
|
@ -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");
|
* 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.
|
||||||
|
|
|
||||||
|
|
@ -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");
|
* 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 {
|
||||||
|
|
||||||
@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 {
|
||||||
|
|
||||||
@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 {
|
||||||
|
|
||||||
@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 {
|
||||||
|
|
||||||
@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 {
|
||||||
@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\"}"))
|
||||||
|
|
|
||||||
|
|
@ -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");
|
* 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.
|
||||||
|
|
|
||||||
|
|
@ -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");
|
* 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.
|
||||||
|
|
|
||||||
|
|
@ -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");
|
* 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.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue