-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
99 additions
and
441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
### Go Windows Buildpack User Documentation | ||
|
||
### Building the Buildpack | ||
To use this buildpack, run the following command from the buildpack's directory: | ||
|
||
1. Build the buildpack | ||
```bash | ||
./scripts/build.ps1 | ||
``` | ||
|
||
1. Use [cfwindowsstager](https://github.com/dgodd/cfwindowsstager/releases) to test the buildpack | ||
```bash | ||
cfwindowsstager.exe --app .\fixtures\simple --buildpack .\go_buildpack-windows2016-v0.0.0.zip | ||
``` | ||
|
||
1. Use in Cloud Foundry | ||
Upload the buildpack to your Cloud Foundry and optionally specify it by name | ||
|
||
```bash | ||
cf create-buildpack [BUILDPACK_NAME] [BUILDPACK_ZIP_FILE_PATH] 1 | ||
cf push my_app [-b BUILDPACK_NAME] | ||
``` | ||
|
||
### Reporting Issues | ||
Open an issue on this project | ||
|
||
## Disclaimer | ||
This buildpack is intended purely for educational use and is not intended for production use. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.0.0 | ||
0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,3 @@ | ||
#!/usr/bin/env bash | ||
# This script is a deprecated but is provided for compatibility with Heroku and older versions of Cloud Foundry | ||
# It is an alternative to bin/supply and bin/finalize | ||
|
||
set -euo pipefail | ||
|
||
BUILD_DIR=$1 | ||
CACHE_DIR=$2 | ||
BUILDPACK_PATH=$(dirname $(readlink -f ${BASH_SOURCE%/*})) | ||
DEPS_DIR="$BUILD_DIR/.cloudfoundry" | ||
|
||
mkdir -p $CACHE_DIR | ||
mkdir -p "$DEPS_DIR/0" | ||
mkdir -p "$BUILD_DIR/.profile.d" | ||
|
||
echo "export DEPS_DIR=\$HOME/.cloudfoundry" > "$BUILD_DIR/.profile.d/0000_set-deps-dir.sh" | ||
|
||
$BUILDPACK_PATH/bin/supply "$BUILD_DIR" "$CACHE_DIR" "$DEPS_DIR" 0 | ||
$BUILDPACK_PATH/bin/finalize "$BUILD_DIR" "$CACHE_DIR" "$DEPS_DIR" 0 | ||
echo "bin/compile is deprecated, but is provided so that CF will accept the zip file" | ||
exit 1 |
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@ECHO OFF | ||
SET ScriptDir=%~dp0 | ||
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%ScriptDir%finalize.ps1' %1 %2 %3 %4"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[CmdletBinding()] | ||
Param( | ||
[Parameter(Mandatory=$True,Position=1)] [string]$BuildDir, | ||
[Parameter(Mandatory=$True,Position=2)] [string]$CacheDir, | ||
[Parameter(Mandatory=$True,Position=3)] [string]$DepsDir, | ||
[Parameter(Mandatory=$True,Position=4)] [string]$DepsIdx | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
$env:PATH += ";$DepsDir/$DepsIdx/bin" | ||
|
||
Write-Output "-----> Build app" | ||
Set-Location $BuildDir | ||
go build -o myapp.exe . | ||
if ($lastexitcode -ne 0) { | ||
Write-Output "ERROR building app with go" | ||
Write-Output "EXITCODE: $lastexitcode" | ||
Exit 1 | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
@echo off | ||
type c:\tmp\go-buildpack-release-step.yml | ||
echo --- | ||
echo default_process_types: | ||
echo web: .\myapp.exe |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@ECHO OFF | ||
SET ScriptDir=%~dp0 | ||
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%ScriptDir%supply.ps1' %1 %2 %3 %4"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[CmdletBinding()] | ||
Param( | ||
[Parameter(Mandatory=$True,Position=1)] [string]$BuildDir, | ||
[Parameter(Mandatory=$True,Position=2)] [string]$CacheDir, | ||
[Parameter(Mandatory=$True,Position=3)] [string]$DepsDir, | ||
[Parameter(Mandatory=$True,Position=4)] [string]$DepsIdx | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
|
||
$Version = (Get-Content "$PSScriptRoot/../VERSION" -Raw).Replace("`n","").Replace("`r","") | ||
Write-Output "-----> Go Buildpack (version $Version)" | ||
# Write-Output " BuildDir: $BuildDir" | ||
# Write-Output " CacheDir: $CacheDir" | ||
# Write-Output " DepsDir: $DepsDir" | ||
# Write-Output " DepsIdx: $DepsIdx" | ||
# Write-Output "" | ||
|
||
|
||
Write-Output "-----> Download go" | ||
$ProgressPreference = 'SilentlyContinue' | ||
(New-Object System.Net.WebClient).DownloadFile('https://dl.google.com/go/go1.11.4.windows-amd64.zip', "$DepsDir/$DepsIdx/go.zip") | ||
$ExpectedSHA = 'eeb20e21702f2b9469d9381df5de85e2f731b64a1f54effe196d0f7d0227fe14' | ||
$ActualSHA = (Get-FileHash "$DepsDir/$DepsIdx/go.zip" -Algorithm SHA256).Hash | ||
If ($ExpectedSHA -ne $ActualSHA) { | ||
Write-Output "go.zip checksum did not match. expected '$ExpectedSHA', found '$ActualSHA'" | ||
Exit 1 | ||
} | ||
|
||
Write-Output "-----> Extract go" | ||
Expand-Archive -Path "$DepsDir/$DepsIdx/go.zip" -DestinationPath "$DepsDir/$DepsIdx" -Force | ||
Move-Item -Path "$DepsDir/$DepsIdx/go/*" -Destination "$DepsDir/$DepsIdx" | ||
Remove-Item -Path "$DepsDir/$DepsIdx/go" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.