Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "2.0.0",
"version": "4.1.0",
"commands": [
"dotnet-cake"
]
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 99designs
Copyright (c) 2015 ByteNess

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![GitHub latest release](https://img.shields.io/github/release/gusztavvargadr/aws-vault-chocolatey.svg)](https://github.com/gusztavvargadr/aws-vault-chocolatey/releases/latest/)
[![Chocolatey downloads](https://img.shields.io/chocolatey/dt/aws-vault.svg)](https://chocolatey.org/packages/aws-vault/)

This repository contains the source of the [Chocolatey package] for [AWS Vault] by [99designs].
This repository contains the source of the [Chocolatey package] for [AWS Vault] by [ByteNess].

### Overview

Expand All @@ -15,5 +15,5 @@ This repository contains the source of the [Chocolatey package] for [AWS Vault]
For more information please see [the original repository][AWS Vault].

[Chocolatey package]: https://chocolatey.org/packages/aws-vault/
[AWS Vault]: https://github.com/99designs/aws-vault/
[99designs]: https://99designs.com/
[AWS Vault]: https://github.com/ByteNess/aws-vault/
[ByteNess]: https://github.com/ByteNess/
12 changes: 9 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
parameters:
- name: release
displayName: Release
type: boolean
default: false

trigger:
branches:
include:
Expand All @@ -6,8 +12,8 @@ pr: none

variables:
- group: pipeline
- name: branch
value: $[ replace(replace(variables['Build.SourceBranch'], 'refs/heads/', ''), 'refs/tags/', '') ]
- name: isReleaseEnabled
value: ${{ parameters.release }}

stages:
- stage: commit
Expand All @@ -30,7 +36,7 @@ stages:

- stage: release
displayName: Release
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
condition: eq(variables.isReleaseEnabled, true)

variables:
- group: stage-release
Expand Down
16 changes: 2 additions & 14 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,7 @@
Task("Build")
.IsDependentOn("Version")
.Does(() => {
var settings = new DockerComposeRunSettings {
Entrypoint = "powershell -File ./build/docker/chef-client.cookbook.run.ps1",
Environment = new [] {
$"CHOCOLATEY_PROJECT_VERSION={projectVersion}",
$"CHOCOLATEY_PACKAGE_VERSION={packageVersion}"
}
};
var service = "chef-client";
DockerComposeRun(settings, service);
StartProcess("docker", $"compose run --env \"CHOCOLATEY_PROJECT_VERSION={projectVersion}\" --env \"CHOCOLATEY_PACKAGE_VERSION={packageVersion}\" --entrypoint \"powershell -File ./build/docker/chef-client.cookbook.run.ps1\" chef-client");
});

Task("Test")
Expand Down Expand Up @@ -44,11 +36,7 @@ Task("Test")
Task("Package")
.IsDependentOn("Test")
.Does(() => {
var settings = new DockerComposeRunSettings {
Entrypoint = "powershell -File ./build/docker/chocolatey.package.pack.ps1",
};
var service = "chocolatey";
DockerComposeRun(settings, service);
StartProcess("docker", $"compose run --entrypoint \"powershell -File ./build/docker/chocolatey.package.pack.ps1\" chocolatey");
});

Task("Publish")
Expand Down
2 changes: 1 addition & 1 deletion build/azp/azure-pipelines.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
pool:
name: Default
demands:
- VSTS_AGENT_CAP_OS -equals windows
- Agent.OS -equals Windows_NT

workspace:
clean: all
Expand Down
4 changes: 0 additions & 4 deletions build/azp/azure-pipelines.core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ steps:
- checkout: self
submodules: recursive

- script: |
git checkout $(branch)
displayName: Init Git

- script: |
dotnet --info

Expand Down
2 changes: 1 addition & 1 deletion build/azp/azure-pipelines.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
pool:
name: Default
demands:
- VSTS_AGENT_CAP_OS -equals windows
- Agent.OS -equals Windows_NT

workspace:
clean: all
Expand Down
58 changes: 7 additions & 51 deletions build/cake/core.cake
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
#addin nuget:?package=Cake.Docker&version=1.1.2
#addin nuget:?package=Cake.SemVer&version=4.0.0
#addin nuget:?package=semver&version=2.0.4

var target = Argument("target", "Publish");
var packageName = "aws-vault";

var sourceVersion = Argument("source-version", "7.2.0");
Semver.SemVersion sourceSemVer;
var sourceVersion = Argument("source-version", "7.5.0");
var buildVersion = Argument("build-version", string.Empty);
var projectVersion = Argument("project-version", string.Empty);
var packageVersion = Argument("package-version", string.Empty);
Expand All @@ -16,7 +11,7 @@ var chocolateyServer = EnvironmentVariable("CHOCOLATEY_SERVER", string.Empty);
Task("Init")
.Does(() => {
StartProcess("docker", "--version");
StartProcess("docker-compose", "--version");
StartProcess("docker", "compose version");

StartProcess("docker", "system df");
StartProcess("docker", "container ls -a");
Expand All @@ -26,57 +21,22 @@ Task("Init")
Task("Restore")
.IsDependentOn("Init")
.Does(() => {
var settings = new DockerComposeBuildSettings {
};
var services = new [] { "chef-client", "chocolatey" };
if (string.IsNullOrEmpty(sourceVersion)) {
services = (new [] { "gitversion" }).Concat(services).ToArray();
}
DockerComposeBuild(settings, services);
StartProcess("docker", "compose build chef-client chocolatey");
});

Task("Version")
.IsDependentOn("Restore")
.Does((context) => {
if (string.IsNullOrEmpty(sourceVersion)) {
{
var settings = new DockerComposeUpSettings {
};
var services = new [] { "gitversion" };
DockerComposeUp(settings, services);
}

{
var runner = new GenericDockerComposeRunner<DockerComposeLogsSettings>(
context.FileSystem,
context.Environment,
context.ProcessRunner,
context.Tools
);
var settings = new DockerComposeLogsSettings {
NoColor = true
};
var service = "gitversion";
var output = runner.RunWithResult(
"logs",
settings,
(items) => items.Where(item => item.Contains('|')).ToArray(),
service
).Last();

sourceVersion = output.Split('|')[1].Trim();
}
}
Information($"Source version: '{sourceVersion}'.");
sourceSemVer = ParseSemVer(sourceVersion);

if (string.IsNullOrEmpty(buildVersion)) {
buildVersion = $"{DateTimeOffset.UtcNow.ToUnixTimeSeconds()}";
}
Information($"Build version: '{buildVersion}'.");

if (string.IsNullOrEmpty(projectVersion)) {
projectVersion = new Semver.SemVersion(sourceSemVer.Major, sourceSemVer.Minor, sourceSemVer.Patch).ToString();
if (string.IsNullOrEmpty(projectVersion))
{
projectVersion = sourceVersion;
}
Information($"Project version: '{projectVersion}'.");

Expand All @@ -91,11 +51,7 @@ Task("Clean")
.Does(() => {
StartProcess("docker", "container prune -f");

var settings = new DockerComposeDownSettings {
Rmi = "local",
Volumes = true,
};
DockerComposeDown(settings);
StartProcess("docker", "compose down --rmi local --volumes");

StartProcess("docker", "image prune -f");
StartProcess("docker", "builder prune -af");
Expand Down
2 changes: 1 addition & 1 deletion build/docker/chef-client.Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM gusztavvargadr/chef-client:latest
FROM gusztavvargadr/chef-client:windows-servercore-ltsc2022
2 changes: 1 addition & 1 deletion build/docker/chocolatey.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM gusztavvargadr/chef-core:latest
FROM gusztavvargadr/chef-core:windows-servercore-ltsc2022

WORKDIR C:/opt/docker/work/
9 changes: 0 additions & 9 deletions build/docker/gitversion.Dockerfile

This file was deleted.

16 changes: 2 additions & 14 deletions deploy.cake
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@ Task("Build")
Task("Test")
.IsDependentOn("Build")
.Does(() => {
{
var settings = new DockerComposeRunSettings {
Entrypoint = "powershell -File ./build/docker/chocolatey.package.install.ps1",
};
var service = "chocolatey";
var command = $"{packageVersion}";
DockerComposeRun(settings, service, command);
}
StartProcess("docker", $"compose run --entrypoint \"powershell -File ./build/docker/chocolatey.package.install.ps1\" chocolatey {packageVersion}");
});

Task("Package")
Expand All @@ -30,12 +23,7 @@ Task("Publish")
return;
}

var settings = new DockerComposeRunSettings {
Entrypoint = "powershell -File ./build/docker/chocolatey.package.push.ps1",
};
var service = "chocolatey";
var command = $"{packageVersion}";
DockerComposeRun(settings, service, command);
StartProcess("docker", $"compose run --entrypoint \"powershell -File ./build/docker/chocolatey.package.push.ps1\" chocolatey {packageVersion}");
});

RunTarget(target);
12 changes: 0 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
version: "3"

services:
gitversion:
build:
context: ./build/docker/
dockerfile: ./gitversion.Dockerfile

volumes:
- ${REPO_DIR}:C:/opt/docker/work/

command: /showvariable NuGetVersionV2

chef-client:
build:
context: ./build/docker/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
default['chocolatey-package'] = {
'id' => 'aws-vault',
'title' => 'AWS Vault',
'project-source-url' => 'https://github.com/99designs/aws-vault/',
'project-source-url' => 'https://github.com/ByteNess/aws-vault/',
'project-version' => ENV['CHOCOLATEY_PROJECT_VERSION'],
'package-source-url' => 'https://github.com/gusztavvargadr/aws-vault-chocolatey/',
'package-version' => ENV['CHOCOLATEY_PACKAGE_VERSION'],
Expand Down
2 changes: 1 addition & 1 deletion src/chef/cookbooks/chocolatey-package/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package_version = node['chocolatey-package']['package-version']
directory_path = "#{node['chocolatey-package']['directory-path']}#{id}/"

project_download_url = "#{project_source_url}releases/download/v#{project_version}/#{id}-windows-386.exe"
project_download_url = "#{project_source_url}releases/download/v#{project_version}/#{id}-windows-amd64.exe"
project_download_path = "#{directory_path}tools/#{id}.exe"
project_download_hash_md5 = ''
project_download_hash_sha256 = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
<packageSourceUrl><%= @package_source_url %></packageSourceUrl>
<owners>Gusztav Varga</owners>
<title><%= @title %></title>
<authors>99designs</authors>
<projectUrl>https://99designs.com.au/tech-blog/blog/2015/10/26/aws-vault/</projectUrl>
<iconUrl>https://99designs.com/og-image.png</iconUrl>
<copyright>2015 99designs</copyright>
<authors>ByteNess</authors>
<projectUrl><%= @package_source_url %></projectUrl>
<iconUrl>https://avatars.githubusercontent.com/u/212586818</iconUrl>
<copyright>2015 ByteNess</copyright>
<licenseUrl><%= @project_license_url %></licenseUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<projectSourceUrl><%= @project_source_url %></projectSourceUrl>
<docsUrl><%= @project_source_url %>blob/v<%= @project_version %>/README.md</docsUrl>
<bugTrackerUrl><%= @project_source_url %>issues/</bugTrackerUrl>
<tags>aws-vault 99designs aws</tags>
<tags>aws-vault ByteNess aws</tags>
<summary>A tool to securely store and access AWS credentials in a development environment</summary>
<description>
AWS Vault is a tool to securely store and access AWS credentials in a development environment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LICENSE

The MIT License (MIT)

Copyright (c) 2015 99designs
Copyright (c) 2015 ByteNess

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down