Skip to content

Commit

Permalink
Merge pull request #849 from vdice/ref/no-acr
Browse files Browse the repository at this point in the history
ref(brigade.js): remove acr publishing
  • Loading branch information
vdice committed Mar 28, 2019
2 parents d2f2714 + 29a93fe commit 719005a
Showing 1 changed file with 6 additions and 39 deletions.
45 changes: 6 additions & 39 deletions brigade.js
Expand Up @@ -189,7 +189,7 @@ function release(p, tag) {
}

// Separate docker build stage as there may be multiple consumers/publishers,
// For example, publishing to Dockerhub and ACR below
// For example, publishing to Dockerhub below
function goDockerBuild(e, p) {
// We build in a separate pod b/c AKS's Docker is too old to do multi-stage builds.
const builder = new Job(`${projectName}-docker-build`, goImg);
Expand Down Expand Up @@ -238,34 +238,6 @@ function dockerhubPublish(project, tag) {
return publisher;
}

function acrBuild(project, tag) {
const acrImagePrefix = "public/deis/";

let registry = project.secrets.acrRegistry || projectName;
var acrBuilder = new Job("az-build", "microsoft/azure-cli:latest");

acrBuilder.imageForcePull = true;
acrBuilder.storage.enabled = true;

acrBuilder.tasks = [
addMake,
// Create a service principal and assign it proper perms on the ACR.
`az login --service-principal -u ${project.secrets.acrName} -p '${project.secrets.acrToken}' --tenant ${project.secrets.acrTenant}`,
`cd /src`,
`mkdir -p ./bin`,
"for i in $(make echo-images); do \
cd ${i} ; \
echo '========> Building ${i}' ; \
cp -av " + sharedMountPrefix + "${i}/rootfs ./ ; \
az acr build -r " + registry + " -t " + acrImagePrefix + "${i}:" + tag + " . ; \
echo '<======== Finished ${i}' ; \
cd .. ; \
done"
];

return acrBuilder;
}

function slackNotify(title, msg, project) {
if (project.secrets.SLACK_WEBHOOK) {
var slack = new Job(`${projectName}-slack-notify`, "technosophos/slack-notify:latest");
Expand Down Expand Up @@ -314,8 +286,7 @@ events.on("push", (e, p) => {
if (doPublish) {
jobs.push(
goDockerBuild(e, p),
dockerhubPublish(p, tag),
acrBuild(p, tag)
dockerhubPublish(p, tag)
);
}

Expand Down Expand Up @@ -360,12 +331,8 @@ events.on("publish", (e, p) => {
throw error("No tag specified");
}

goDockerBuild(e, p)
.run()
.then(() => {
Group.runAll([
acrBuild(p, payload.tag),
dockerhubPublish(p, payload.tag)
]);
});
Group.runEach([
goDockerBuild(e, p),
dockerhubPublish(p, payload.tag)
]);
});

0 comments on commit 719005a

Please sign in to comment.