From 0e343f8c7d32ac1444bdee1fdd657a94bf53ccd2 Mon Sep 17 00:00:00 2001 From: alexandergetka Date: Thu, 8 Oct 2020 16:37:16 -0400 Subject: [PATCH 1/7] Initial commit for Azure-based docker build --- azure-pipelines.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8ace4888c..b38779491 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -560,7 +560,22 @@ jobs: continueOnError: true displayName: Uploading to NITRC condition: and( eq(variables['Build.DefinitionName'], 'CBICA.CaPTk'), or( eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'Schedule')) ) - + + - task: Docker@2 + # Docker CLI needs to be installed on this agent for this step to work. + input: + containerRegistry: 'cbicaDockerHub' + repository: 'cbica/captk' + command: buildAndPush + tags: | + latest + azure-latest + $(Build.BuildId) + Dockerfile: Dockerfile + displayName: Build and push image to Docker Hub + condition: and( eq(variables['Build.DefinitionName'], 'CBICA.CaPTk'), or( eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'Schedule')) ) + + - job: 'macOS_SelfHost_1014' displayName: "Self-hosted agent on macOS 10.14" timeoutInMinutes: 0 From 1677776178f1d21ffa1e583cded98004fbd71865 Mon Sep 17 00:00:00 2001 From: alexandergetka Date: Thu, 8 Oct 2020 16:44:29 -0400 Subject: [PATCH 2/7] comment out condition for testing via PR --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b38779491..33fc94afa 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -573,7 +573,7 @@ jobs: $(Build.BuildId) Dockerfile: Dockerfile displayName: Build and push image to Docker Hub - condition: and( eq(variables['Build.DefinitionName'], 'CBICA.CaPTk'), or( eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'Schedule')) ) + #condition: and( eq(variables['Build.DefinitionName'], 'CBICA.CaPTk'), or( eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'Schedule')) ) - job: 'macOS_SelfHost_1014' From 0520b2671d92447949417c8ed106fc3c4c76d08f Mon Sep 17 00:00:00 2001 From: alexandergetka Date: Thu, 8 Oct 2020 16:48:17 -0400 Subject: [PATCH 3/7] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 33fc94afa..40a2659c2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -563,7 +563,7 @@ jobs: - task: Docker@2 # Docker CLI needs to be installed on this agent for this step to work. - input: + inputs: containerRegistry: 'cbicaDockerHub' repository: 'cbica/captk' command: buildAndPush From c1e22b2237b22e762040a17af8ddeeb500946813 Mon Sep 17 00:00:00 2001 From: Alexander Getka <59709326+AlexanderGetka-cbica@users.noreply.github.com> Date: Tue, 13 Oct 2020 13:35:49 -0400 Subject: [PATCH 4/7] Dummy space commit to re-trigger --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 40a2659c2..21ba6126f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,4 +1,4 @@ -# Schedule a build for every midnight Eastern time. This is visible to the pipeline as Build.Reason +# Schedule a build for every midnight Eastern time. This is visible to the pipeline as Build.Reason schedules: - cron: "0 4 * * *" displayName: Daily midnight build From 7cd0c9e90476c9dbbe1a035007530b0b4be58aa0 Mon Sep 17 00:00:00 2001 From: alexandergetka Date: Tue, 13 Oct 2020 23:54:22 -0400 Subject: [PATCH 5/7] Moving docker build to MS-hosted VM --- azure-pipelines.yml | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 40a2659c2..1649dfe41 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,6 +17,29 @@ pr: include: ['master'] jobs: +- job: 'DockerImageBuild' + displayName: "Docker Image build & push to Docker Hub" + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + + pool: + vmImage: 'ubuntu-18.04' + + steps: + - task: Docker@2 + # Docker CLI needs to be installed on this agent for this step to work. + inputs: + containerRegistry: 'cbicaDockerHub' + repository: 'cbica/captk' + command: buildAndPush + tags: | + latest + azure-latest + $(Build.BuildId) + Dockerfile: Dockerfile + displayName: Build and push image to Docker Hub + #condition: and( eq(variables['Build.DefinitionName'], 'CBICA.CaPTk'), or( eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'Schedule')) ) + - job: 'WindowsBuild' displayName: "End-to-end Windows build & package" timeoutInMinutes: 0 @@ -561,21 +584,7 @@ jobs: displayName: Uploading to NITRC condition: and( eq(variables['Build.DefinitionName'], 'CBICA.CaPTk'), or( eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'Schedule')) ) - - task: Docker@2 - # Docker CLI needs to be installed on this agent for this step to work. - inputs: - containerRegistry: 'cbicaDockerHub' - repository: 'cbica/captk' - command: buildAndPush - tags: | - latest - azure-latest - $(Build.BuildId) - Dockerfile: Dockerfile - displayName: Build and push image to Docker Hub - #condition: and( eq(variables['Build.DefinitionName'], 'CBICA.CaPTk'), or( eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'Schedule')) ) - - + - job: 'macOS_SelfHost_1014' displayName: "Self-hosted agent on macOS 10.14" timeoutInMinutes: 0 From 3c31147de479d54f6bdcac389b26702fc90345a4 Mon Sep 17 00:00:00 2001 From: alexandergetka Date: Fri, 30 Oct 2020 16:00:35 -0400 Subject: [PATCH 6/7] Change pool for docker build to self-host VM --- azure-pipelines.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 84c426ea3..cea17958d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,8 +22,7 @@ jobs: timeoutInMinutes: 0 cancelTimeoutInMinutes: 300 - pool: - vmImage: 'ubuntu-18.04' + pool: 'Ubuntu_18.04' # Refers to /home/cbica-devs/Workspace/captk1-docker-build/ on crete's ubuntu18.04-selfhosting VM steps: - task: Docker@2 From 131e94c94311742745121891a7c5cebcc249b5b2 Mon Sep 17 00:00:00 2001 From: alexandergetka Date: Fri, 30 Oct 2020 23:16:04 -0400 Subject: [PATCH 7/7] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cea17958d..ec26a6bb3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -37,7 +37,7 @@ jobs: $(Build.BuildId) Dockerfile: Dockerfile displayName: Build and push image to Docker Hub - #condition: and( eq(variables['Build.DefinitionName'], 'CBICA.CaPTk'), or( eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'Schedule')) ) + condition: and( eq(variables['Build.DefinitionName'], 'CBICA.CaPTk'), or( eq(variables['Build.Reason'], 'Manual'), eq(variables['Build.Reason'], 'Schedule')) ) - job: 'WindowsBuild' displayName: "End-to-end Windows build & package"