cleanup
This commit is contained in:
parent
883e7c2877
commit
fbba5afbbd
@ -62,8 +62,6 @@ public class PlanSpec {
|
|||||||
return new Plan(project(), "Redaction UI", new BambooKey("UI"))
|
return new Plan(project(), "Redaction UI", new BambooKey("UI"))
|
||||||
.description("Docker build for Redaction UI.")
|
.description("Docker build for Redaction UI.")
|
||||||
.stages(new Stage("Build Stage").jobs(creatGinCloudPlatformImagesJob("red-ui")))
|
.stages(new Stage("Build Stage").jobs(creatGinCloudPlatformImagesJob("red-ui")))
|
||||||
.stages(new Stage("Upstream Push Stage")
|
|
||||||
.jobs(creatGinCloudPlatformUpstreamJob()))
|
|
||||||
.stages(new Stage("Release")
|
.stages(new Stage("Release")
|
||||||
.manual(true)
|
.manual(true)
|
||||||
.jobs(createRelease()))
|
.jobs(createRelease()))
|
||||||
@ -79,48 +77,15 @@ public class PlanSpec {
|
|||||||
.checkoutItems(new CheckoutItem().defaultRepository()), new ScriptTask().description("Build")
|
.checkoutItems(new CheckoutItem().defaultRepository()), new ScriptTask().description("Build")
|
||||||
.location(ScriptTaskProperties.Location.FILE)
|
.location(ScriptTaskProperties.Location.FILE)
|
||||||
.fileFromPath("bamboo-specs/src/main/resources/scripts/build.sh")
|
.fileFromPath("bamboo-specs/src/main/resources/scripts/build.sh")
|
||||||
.environmentVariables("BRANCH_NAME=\"${bamboo.planRepository.branchName}\"")
|
|
||||||
.environmentVariables("PROJECT=\"" + project + "\"")
|
.environmentVariables("PROJECT=\"" + project + "\"")
|
||||||
).dockerConfiguration(
|
).dockerConfiguration(
|
||||||
new DockerConfiguration().image("nexus.iqser.com:5001/infra/release_build:2.9.1")
|
new DockerConfiguration().image("nexus.iqser.com:5001/infra/release_build:2.9.1")
|
||||||
.volume("/var/run/docker.sock", "/var/run/docker.sock"));
|
.volume("/var/run/docker.sock", "/var/run/docker.sock"))
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Job creatGinCloudPlatformUpstreamJob() {
|
|
||||||
return new Job("Upstream Push", new BambooKey("USPSH"))
|
|
||||||
.tasks(
|
|
||||||
new VcsCheckoutTask().description("Checkout Default Repository")
|
|
||||||
.checkoutItems(new CheckoutItem().defaultRepository()),
|
|
||||||
|
|
||||||
// update versions
|
|
||||||
new ScriptTask().description("Build")
|
|
||||||
.location(ScriptTaskProperties.Location.FILE)
|
|
||||||
.fileFromPath("bamboo-specs/src/main/resources/scripts/update-version.sh")
|
|
||||||
.environmentVariables("BRANCH_NAME=\"${bamboo.planRepository.branchName}\""),
|
|
||||||
|
|
||||||
// create version.properties file
|
|
||||||
new ScriptTask().description("Set Version Properties")
|
|
||||||
.location(ScriptTaskProperties.Location.FILE)
|
|
||||||
.fileFromPath("bamboo-specs/src/main/resources/scripts/set-version.properties.sh")
|
|
||||||
.environmentVariables("BRANCH_NAME=\"${bamboo.planRepository.branchName}\""),
|
|
||||||
// read version from created file
|
|
||||||
new InjectVariablesTask().path("version.properties"),
|
|
||||||
// commit release
|
|
||||||
new VcsCommitTask().commitMessage("chore(release)").repository("RED / ui"),
|
|
||||||
// create tag with this version
|
|
||||||
|
|
||||||
|
|
||||||
new VcsTagTask().tagName("${bamboo.inject.APP_VERSION}").repository("RED / ui"))
|
|
||||||
|
|
||||||
.dockerConfiguration(new DockerConfiguration().image("nexus.iqser.com:5001/infra/release_build:2.9.1")
|
|
||||||
.volume("/var/run/docker.sock", "/var/run/docker.sock"))
|
|
||||||
|
|
||||||
// publish artifact with this version
|
|
||||||
.artifacts(new Artifact("version").location(".").copyPattern("**/version.properties").shared(true));
|
.artifacts(new Artifact("version").location(".").copyPattern("**/version.properties").shared(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Job createRelease() {
|
public Job createRelease() {
|
||||||
return new Job("Create Release", new BambooKey("CRLS"))
|
return new Job("Create Release", new BambooKey("CRLS"))
|
||||||
.tasks(
|
.tasks(
|
||||||
|
|||||||
@ -18,6 +18,7 @@ then
|
|||||||
version=$(jq -r '.version' < package.json)
|
version=$(jq -r '.version' < package.json)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo "Building version $version"
|
echo "Building version $version"
|
||||||
docker build -t "$imageName":latest -f "$dockerfileLocation" .
|
docker build -t "$imageName":latest -f "$dockerfileLocation" .
|
||||||
|
|
||||||
@ -25,11 +26,11 @@ if [[ -n ${version+z} ]]
|
|||||||
then
|
then
|
||||||
|
|
||||||
echo "Publishing Images with version $version"
|
echo "Publishing Images with version $version"
|
||||||
echo "${BAMBOO_DOWNLOAD_PASS} | docker login -u $BAMBOO_DOWNLOAD_USER --password-stdin nexus.iqser.com:5001"
|
echo "$bamboo_bamboo_download_pass | docker login -u $bamboo_bamboo_download_user --password-stdin nexus.iqser.com:5001"
|
||||||
|
|
||||||
docker push "$imageName}:latest"
|
docker push "$imageName:latest"
|
||||||
docker tag "$imageName:latest" "$imageName:$version"
|
docker tag "$imageName:latest" "$imageName:$version"
|
||||||
docker push "$imageName}:$version"
|
docker push "$imageName:$version"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Not on a relevant branch $BRANCH_NAME ... skipping."
|
echo "Not on a relevant branch $BRANCH_NAME ... skipping."
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
version=$(jq -r '.version' < package.json)
|
|
||||||
echo "Preparing release properties for version ${version}"
|
|
||||||
echo "APP_VERSION=${version}" > version.properties
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [[ "${BRANCH_NAME}" == "master" ]]
|
|
||||||
then
|
|
||||||
./versions.sh minor
|
|
||||||
echo "Updating minor version ... "
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [[ "${BRANCH_NAME}" == release* ]]
|
|
||||||
then
|
|
||||||
./versions.sh patch
|
|
||||||
echo "Updating patch version ... "
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
version=$(jq -r '.version' < package.json)
|
|
||||||
|
|
||||||
echo "At version ${version}"
|
|
||||||
Loading…
x
Reference in New Issue
Block a user