Skip to content

Commit

Permalink
Merge pull request #1357 from habitat-sh/win_build
Browse files Browse the repository at this point in the history
Approved by: @nobody from Nowhere
Merged by: The Sentinels
  • Loading branch information
thesentinels authored Oct 14, 2016
2 parents b276a96 + 6c207c3 commit a4389c3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 12 deletions.
5 changes: 3 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,11 @@ target component.
```
$ cd ~/code/habitat/components/hab/win
$ vagrant destroy
$ export ORIGIN_KEY=hab origin key export core --type secret
$ vagrant up
```
The script provisioner in the Vagrantfile will pull down all dependencies and build the windows hab binary.
The script provisioner in the Vagrantfile will extract the core origin key from your environment and feed it to a powershell script on the Windows machine for import. It will also pull down all dependencies and build the windows hab binary.
# How-To: Release to Bintray
Expand Down Expand Up @@ -243,7 +244,7 @@ The script provisioner in the Vagrantfile will pull down all dependencies and bu
$ hab pkg exec core/hab-bintray-publish publish-hab \
./habitat/components/hab/mac/results/core-hab-0.10.2-20160930230245-x86_64-darwin.hart
$ hab pkg exec core/hab-bintray-publish publish-hab \
./habitat/components/hab/win/results/core-hab-0.10.2-20160930230245-x86_64-windows.zip
./habitat/components/hab/win/results/core-hab-0.10.2-20160930230245-x86_64-windows.hart
```
More documentation for the Bintray releasing software can be found in the component's [Readme](components/bintray-publish/README.md).
9 changes: 2 additions & 7 deletions components/bintray-publish/bin/publish-hab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,7 @@ _build_slim_release() {
rm -fv "$pkg_artifact"
$_gzip_cmd -9 -c "$tarball" > "$pkg_artifact"
;;
*-darwin)
pkg_artifact="$start_dir/results/${archive_name}.zip"
rm -fv "$pkg_artifact"
$_zip_cmd -9 -r "$pkg_artifact" "$(basename $pkg_dir)"
;;
*-windows)
*-darwin | *-windows)
pkg_artifact="$start_dir/results/${archive_name}.zip"
rm -fv "$pkg_artifact"
$_zip_cmd -9 -r "$pkg_artifact" "$(basename $pkg_dir)"
Expand Down Expand Up @@ -282,7 +277,7 @@ _publish_slim_release() {
_main() {

_build_slim_release
# _publish_slim_release
_publish_slim_release

cat <<-EOF > $start_dir/results/last_build.env
pkg_origin=$pkg_origin
Expand Down
1 change: 1 addition & 0 deletions components/hab/win/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
$script = <<SCRIPT
cd /src/components/hab/win
$env:ORIGIN_KEY = "#{ENV['ORIGIN_KEY']}"
./win-build.ps1
SCRIPT

Expand Down
12 changes: 10 additions & 2 deletions components/hab/win/win-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if (-not (Test-AppVeyor)) {
# We need the Visual C++ tools to build Rust crates (provides a compiler and linker)
choco install 'visualcppbuildtools' --version '14.0.25123' --confirm --allowemptychecksum

choco install 7zip
choco install 7zip --version '16.02.0.20160811' --confirm
}

# Install Rust Nightly (since there aren't MSVC nightly cargo builds)
Expand Down Expand Up @@ -114,6 +114,14 @@ invoke-expression "$cargo clean"
Invoke-Expression "$cargo build --release"
Pop-Location

# Import origin key
if (!(Test-Path "/hab/cache/keys/core-*.sig.key")) {
if(!$env:ORIGIN_KEY) {
throw "You do not have the core origin key imported on this machine. Please ensure the key is exported to the ORIGIN_KEY environment variable."
}
$env:ORIGIN_KEY | & '..\..\..\target\Release\hab.exe' origin key import
}

# Create the archive
$pkgRoot = "results"
New-Item -ItemType Directory -Path $pkgRoot -ErrorAction SilentlyContinue -Force
Expand Down Expand Up @@ -143,7 +151,7 @@ Copy-Item $pkgFiles -Destination $pkgBinDir
"x86_64-windows" | out-file "$pkgTempDir/TARGET" -Encoding ascii
7z.exe a -ttar "$pkgArtifact.tar" ./hab
7z.exe a -txz "$pkgArtifact.tar.xz" "$pkgArtifact.tar"
hab pkg sign --origin $pkgOrigin "$pkgArtifact.tar.xz" "$pkgArtifact.hart"
..\..\..\target\Release\hab.exe pkg sign --origin $pkgOrigin "$pkgArtifact.tar.xz" "$pkgArtifact.hart"
rm "$pkgArtifact.tar", "$pkgArtifact.tar.xz", "./hab" -Recurse -force

exit $LASTEXITCODE
9 changes: 8 additions & 1 deletion www/source/docs/get-habitat.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ _Habitat for Linux requires a 64-bit processor with a kernel greater than 2.6.32
<a class="button" href="https://api.bintray.com/content/habitat/stable/linux/x86_64/hab-%24latest-x86_64-linux.tar.gz?bt_package=hab-x86_64-linux">Download Habitat for Linux</a>

### For Windows
Habitat currently runs on Mac and Linux operating systems only. Windows support is coming soon.
To start using Habitat on Windows, download the following binary.
If you intend to build Habitat packages on your Windows PC, you will also need to install [Docker for Windows](https://docs.docker.com/docker-for-windows/).
_Habitat for Windows requires 64bit Windows 10 Pro, Enterprise and Education (1511 November update, Build 10586 or later) and Microsoft Hyper-V.

> Note: Currently Habitat can only build and manage linux based packages. Support for Windows based applications is coming.
<a class="button" href="https://api.bintray.com/content/habitat/stable/windows/x86_64/hab-%24latest-x86_64-windows.zip?bt_package=hab-x86_64-windows">Download Habitat for Windows</a>
<a class="button secondary" href="https://download.docker.com/win/stable/InstallDocker.msi">Download Docker for Windows</a>

<hr>

Expand Down

0 comments on commit a4389c3

Please sign in to comment.