Skip to content

Commit

Permalink
Merge pull request #153 from gusztavvargadr/feature/consolidate-box-v…
Browse files Browse the repository at this point in the history
…ersions-visual-studio-professional-139

Revert back to box publishing via the hosted agent #139
  • Loading branch information
gusztavvargadr authored Oct 7, 2019
2 parents c21b37d + e45515b commit 767b8e0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 49 deletions.
39 changes: 12 additions & 27 deletions src/core/azp/cd-stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ stages:
jobs:
- job: cd_publish
displayName: CD - Publish
# pool:
# vmImage: ubuntu-16.04
pool:
name: Default
demands:
- AZP_AGENT_VAGRANT -equals ${{ parameters.provider }}
vmImage: ubuntu-16.04
workspace:
clean: all
timeoutInMinutes: 120
Expand All @@ -27,16 +23,16 @@ stages:
steps:
- checkout: self
submodules: recursive

# - script: |
# dotnet tool install Cake.Tool --global --version 0.33.0
# displayName: Init - .NET

# - script: |
# wget -q https://releases.hashicorp.com/vagrant/2.2.5/vagrant_2.2.5_x86_64.deb
# sudo dpkg -i vagrant_2.2.5_x86_64.deb
# vagrant --version
# displayName: Init - Vagrant
- script: |
dotnet tool install Cake.Tool --global --version 0.33.0
displayName: Init - .NET
- script: |
wget -q https://releases.hashicorp.com/vagrant/2.2.5/vagrant_2.2.5_x86_64.deb
sudo dpkg -i vagrant_2.2.5_x86_64.deb
vagrant --version
displayName: Init - Vagrant
- ${{ if parameters.parent }}:
- task: DownloadPipelineArtifact@2
Expand All @@ -51,25 +47,14 @@ stages:
runBranch: $(Build.SourceBranch)
displayName: Artifacts - Download

# - script: |
# ~/.dotnet/tools/dotnet-cake build.cake --target=publish --configuration=${{ parameters.image }}-${{ parameters.provider }}-${{ parameters.configuration }}
# displayName: Build - Publish
# env:
# VAGRANT_CLOUD_TOKEN: $(environment-vagrant-cloud-token)

# - script: |
# ~/.dotnet/tools/dotnet-cake build.cake --target=clean
# displayName: Build - Clean
# condition: always()

- script: |
dotnet cake build.cake --target=publish --configuration=${{ parameters.image }}-${{ parameters.provider }}-${{ parameters.configuration }}
~/.dotnet/tools/dotnet-cake build.cake --target=publish --configuration=${{ parameters.image }}-${{ parameters.provider }}-${{ parameters.configuration }}
displayName: Build - Publish
env:
VAGRANT_CLOUD_TOKEN: $(environment-vagrant-cloud-token)
- script: |
dotnet cake build.cake --target=clean
~/.dotnet/tools/dotnet-cake build.cake --target=clean
displayName: Build - Clean
condition: always()
Expand Down
2 changes: 1 addition & 1 deletion src/core/azp/ci-stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ stages:
- AZP_AGENT_VAGRANT -equals ${{ parameters.provider }}
workspace:
clean: all
timeoutInMinutes: 360
timeoutInMinutes: 240
variables:
- group: pipeline

Expand Down
27 changes: 6 additions & 21 deletions src/core/cake/template.cake
Original file line number Diff line number Diff line change
Expand Up @@ -139,27 +139,12 @@ void PackerTemplate_Publish(PackerTemplate template) {

var provider = template.Type.Split('-')[0];

try {
PackerTemplate_Vagrant(template, "box add"
+ $" https://vagrantcloud.com/gusztavvargadr/boxes/{template.GroupName}/versions/{template.GroupVersion}/providers/{provider}.box"
+ $" --name local/gusztavvargadr/{template.Name}-deploy"
+ $" --provider {provider}"
);

PackerTemplate_Vagrant(template, "box remove"
+ $" local/gusztavvargadr/{template.Name}-deploy"
+ $" --provider {provider}"
);
} catch (Exception ex) {
PackerTemplate_Log(template, $"Error downloading box, trying uploading: {ex.Message}");

PackerTemplate_Vagrant(template, "cloud publish --force"
+ $" gusztavvargadr/{template.GroupName}"
+ $" {template.GroupVersion}"
+ $" {provider}"
+ $" {template.GetBuildDirectory()}/output/package/vagrant.box"
);
}
PackerTemplate_Vagrant(template, "cloud publish --force"
+ $" gusztavvargadr/{template.GroupName}"
+ $" {template.GroupVersion}"
+ $" {provider}"
+ $" {template.GetBuildDirectory()}/output/package/vagrant.box"
);
}

void PackerTemplate_Download(PackerTemplate template) {
Expand Down

0 comments on commit 767b8e0

Please sign in to comment.