final stuff

This commit is contained in:
Timo 2021-05-05 10:29:51 +03:00
parent a3f8d330e0
commit 0622cb9be4
2 changed files with 6 additions and 10 deletions

View File

@ -32,17 +32,11 @@ public class PlanSpec {
//By default credentials are read from the '.credentials' file.
BambooServer bambooServer = new BambooServer("http://localhost:8085");
Plan buildPlan = new PlanSpec().createDockerBuildPlan();
bambooServer.publish(buildPlan);
PlanPermissions buildPlanPermissions = new PlanSpec().createPlanPermission(buildPlan.getIdentifier());
bambooServer.publish(buildPlanPermissions);
// Plan testPlan = new PlanSpec().createCypressTestPlan();
// bambooServer.publish(testPlan);
// PlanPermissions testPlanPermissions = new PlanSpec().createPlanPermission(testPlan.getIdentifier());
// bambooServer.publish(testPlanPermissions);
}
private PlanPermissions createPlanPermission(PlanIdentifier planIdentifier) {
@ -77,7 +71,10 @@ public class PlanSpec {
.checkoutItems(new CheckoutItem().defaultRepository()), new ScriptTask().description("Build")
.location(ScriptTaskProperties.Location.FILE)
.fileFromPath("bamboo-specs/src/main/resources/scripts/build.sh")
.environmentVariables("PROJECT=\"" + project + "\"")
.environmentVariables(
"PROJECT=\"" + project + "\" " +
"BAMBOO_DOWNLOAD_PASS=\"${bamboo.bamboo_download_pass}\" " +
"BAMBOO_DOWNLOAD_USER=\"${bamboo.bamboo_download_user}\" ")
).dockerConfiguration(
new DockerConfiguration().image("nexus.iqser.com:5001/infra/release_build:2.9.1")
.volume("/var/run/docker.sock", "/var/run/docker.sock"))
@ -85,7 +82,6 @@ public class PlanSpec {
}
public Job createRelease() {
return new Job("Create Release", new BambooKey("CRLS"))
.tasks(

View File

@ -3,7 +3,7 @@
imageName="nexus.iqser.com:5001/red/$PROJECT"
dockerfileLocation="docker/$PROJECT/Dockerfile"
echo "Docker Variables: User: $bamboo_bamboo_download_user, Password: $bamboo_bamboo_download_pass"
echo "Docker Variables: User: $BAMBOO_DOWNLOAD_USER, Password: $BAMBOO_DOWNLOAD_PASS"
echo "On branch $bamboo_planRepository_branchName building project $PROJECT"
# shellcheck disable=SC2154
if [[ "$bamboo_planRepository_branchName" == "master" ]]
@ -29,7 +29,7 @@ then
echo "APP_VERSION=${version}" > version.properties
echo "Publishing Images with version $version"
echo "$bamboo_bamboo_download_pass" | docker login -u "$bamboo_bamboo_download_user" --password-stdin nexus.iqser.com:5001
echo "$BAMBOO_DOWNLOAD_PASS" | docker login -u "$BAMBOO_DOWNLOAD_USER" --password-stdin nexus.iqser.com:5001
docker push "$imageName:latest"
docker tag "$imageName:latest" "$imageName:$version"