Skip to content

Commit

Permalink
Add go1.12, remove go1.10
Browse files Browse the repository at this point in the history
[#164408493](https://www.pivotaltracker.com/story/show/164408493)

Co-authored-by: Danny Berger <dberger@pivotal.io>
  • Loading branch information
mrosecrance and dpb587-pivotal committed Mar 15, 2019
1 parent d2012a8 commit ee2dd31
Show file tree
Hide file tree
Showing 63 changed files with 191 additions and 203 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
# golang

Note: requires bosh-cli version `v2.0.36` to `vendor-package` and `create-release`.
Note: requires bosh-cli version `v2.0.36`+ to `vendor-package` and `create-release`.

To vendor golang package into your release, run:

```
$ git clone https://github.com/bosh-packages/golang-release
$ cd ~/workspace/your-release
$ bosh vendor-package golang-1.11-linux ~/workspace/golang-release
$ bosh vendor-package golang-1.12-linux ~/workspace/golang-release
```

Included packages:

- `golang-1-{linux,darwin,windows}`: updated with latest version of go 1.x
- `golang-1.12-{linux,darwin,windows}`: updated with latest version of go 1.12.x
- `golang-1.11-{linux,darwin,windows}`: updated with latest version of go 1.11.x
- `golang-1.10-{linux,darwin,windows}`: updated with latest version of go 1.10.x

To use `golang-*` package for compilation in your packaging script:

```bash
#!/bin/bash -eu
source /var/vcap/packages/golang-1.11-linux/bosh/compile.env
source /var/vcap/packages/golang-1.12-linux/bosh/compile.env
go build ...
```
or on Windows:

```powershell
. C:\var\vcap\packages\golang-1.11-windows\bosh\compile.ps1
. C:\var\vcap\packages\golang-1.12-windows\bosh\compile.ps1
go build ...
```
[advanced use] To use `golang-*` package at runtime in your job scripts:

```bash
#!/bin/bash -eu
source /var/vcap/packages/golang-1.11-linux/bosh/runtime.env
source /var/vcap/packages/golang-1.12-linux/bosh/runtime.env
go run ...
```
or on Windows:

```powershell
. C:\var\vcap\packages\golang-1.11-windows\bosh\runtime.ps1
. C:\var\vcap\packages\golang-1.12-windows\bosh\runtime.ps1
go build ...
```

Expand Down
6 changes: 3 additions & 3 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- aggregate:
- get: golang-1.11
trigger: true
- get: golang-1.10
- get: golang-1.12
trigger: true
- get: golang-release
- get: bosh-src
Expand Down Expand Up @@ -102,10 +102,10 @@ resources:
- go*.windows-amd64.zip
- go*.darwin-amd64.tar.gz

- name: golang-1.10
- name: golang-1.12
type: dynamic-metalink
source:
version: 1.10.x
version: 1.12.x
version_check: |
curl -s https://golang.org/dl/?mode=json | jq -r '.[].version[2:]'
metalink_get: |
Expand Down
8 changes: 4 additions & 4 deletions ci/tasks/bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ set -x
git config user.name "CI Bot"
git config user.email "cf-bosh-eng@pivotal.io"

replace_if_necessary 1.10 linux
replace_if_necessary 1.10 darwin
replace_if_necessary 1.10 windows
replace_if_necessary 1.12 linux
replace_if_necessary 1.12 darwin
replace_if_necessary 1.12 windows

if [[ "$( git status --porcelain )" != "" ]]; then
git commit -am "Bump golang 1.10"
git commit -am "Bump golang 1.12"
fi

replace_if_necessary 1.11 linux
Expand Down
2 changes: 1 addition & 1 deletion ci/tasks/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ image_resource:

inputs:
- name: golang-1.11
- name: golang-1.10
- name: golang-1.12
- name: golang-release
- name: stemcell

Expand Down
12 changes: 0 additions & 12 deletions config/blobs.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
go1.10.8.darwin-amd64.tar.gz:
size: 87999054
object_id: 3cddbbd8-26c2-4d3f-43d8-65e220c7fff0
sha: sha256:f41bc914a721ac98a187df824b3b40f0a7f35bfb3c6d31221bdd940d537d3c28
go1.10.8.linux-amd64.tar.gz:
size: 102184719
object_id: e1c735c8-e3c6-45f4-66bc-a75cdae5a015
sha: sha256:d8626fb6f9a3ab397d88c483b576be41fa81eefcec2fd18562c87626dbb3c39e
go1.10.8.windows-amd64.zip:
size: 97535083
object_id: a0857e82-b2b4-44e9-74fc-c1a8de8a4810
sha: sha256:ab63b55c349f75cce4b93aefa9b52828f50ebafb302da5057db0e686d7873d7a
go1.11.5.darwin-amd64.tar.gz:
size: 120402712
object_id: 64c747b6-8f50-441e-6a0f-a9b264c3be8b
Expand Down
11 changes: 0 additions & 11 deletions jobs/golang-1.10-test-windows/spec

This file was deleted.

13 changes: 0 additions & 13 deletions jobs/golang-1.10-test-windows/templates/run.ps1

This file was deleted.

12 changes: 0 additions & 12 deletions jobs/golang-1.10-test/spec

This file was deleted.

10 changes: 0 additions & 10 deletions jobs/golang-1.10-test/templates/run

This file was deleted.

File renamed without changes.
11 changes: 11 additions & 0 deletions jobs/golang-1.12-test-windows/spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: golang-1.12-test-windows

templates:
run.ps1: bin/run.ps1

packages:
- golang-1.12-windows
- golang-1.12-windows-test

properties: {}
13 changes: 13 additions & 0 deletions jobs/golang-1.12-test-windows/templates/run.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
try {
Write-Host "Testing compile compatibility"
& "C:\var\vcap\packages\golang-1.12-windows-test\bin\test.exe"

Write-Host "Testing runtime compatibility"
. C:\var\vcap\packages\golang-1.12-windows\bosh\runtime.ps1
go run C:\var\vcap\packages\golang-1.12-windows-test\test.go
} catch {
Write-Host "$_.Exception.Message"
Exit 1
}

Exit 0
File renamed without changes.
12 changes: 12 additions & 0 deletions jobs/golang-1.12-test/spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: golang-1.12-test

templates:
run: bin/run

packages:
- golang-1.12-linux
- golang-1.12-linux-test
- golang-1.12-darwin-test

properties: {}
10 changes: 10 additions & 0 deletions jobs/golang-1.12-test/templates/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -eux

echo "Testing compile compability"
/var/vcap/packages/golang-1.12-linux-test/bin/test

echo "Testing runtime compability"
source /var/vcap/packages/golang-1.12-linux/bosh/runtime.env
go run /var/vcap/packages/golang-1.12-linux-test/test.go
4 changes: 2 additions & 2 deletions manifests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ instance_groups:
networks:
- name: default

- name: golang-1.10-test
- name: golang-1.12-test
azs: [z1]
instances: 1
jobs:
- name: golang-1.10-((job-name))
- name: golang-1.12-((job-name))
release: golang
properties: {}
vm_type: default
Expand Down
2 changes: 1 addition & 1 deletion packages/golang-1-darwin/spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ name: golang-1-darwin
files:
- 1/compile.env.darwin
- 1/compile.env.generic
- go1.11*.darwin-amd64.tar.gz
- go1.12*.darwin-amd64.tar.gz
2 changes: 1 addition & 1 deletion packages/golang-1-linux/spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ files:
- 1/runtime.env.linux
- 1/compile.env.linux
- 1/compile.env.generic
- go1.11*.linux-amd64.tar.gz
- go1.12*.linux-amd64.tar.gz
2 changes: 1 addition & 1 deletion packages/golang-1-windows/spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ files:
- 1/compile.env.windows
- 1/runtime.env.windows
- exiter.ps1
- go1.11*.windows-amd64.zip
- go1.12*.windows-amd64.zip
7 changes: 0 additions & 7 deletions packages/golang-1.10-darwin-test/packaging

This file was deleted.

8 changes: 0 additions & 8 deletions packages/golang-1.10-darwin-test/spec

This file was deleted.

7 changes: 0 additions & 7 deletions packages/golang-1.10-darwin/spec

This file was deleted.

8 changes: 0 additions & 8 deletions packages/golang-1.10-linux-test/spec

This file was deleted.

10 changes: 0 additions & 10 deletions packages/golang-1.10-linux/packaging

This file was deleted.

8 changes: 0 additions & 8 deletions packages/golang-1.10-linux/spec

This file was deleted.

9 changes: 0 additions & 9 deletions packages/golang-1.10-windows-test/spec

This file was deleted.

8 changes: 0 additions & 8 deletions packages/golang-1.10-windows/spec

This file was deleted.

7 changes: 7 additions & 0 deletions packages/golang-1.12-darwin-test/packaging
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -eux

source /var/vcap/packages/golang-1.12-darwin/bosh/compile.env

which go
8 changes: 8 additions & 0 deletions packages/golang-1.12-darwin-test/spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: golang-1.12-darwin-test

dependencies:
- golang-1.12-darwin

files:
- test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ tar xzf go*.darwin-amd64.tar.gz
cp -R go/* ${BOSH_INSTALL_TARGET}

mkdir ${BOSH_INSTALL_TARGET}/bosh
cp 1.10/compile.env.darwin ${BOSH_INSTALL_TARGET}/bosh/compile.env
cp 1.10/compile.env.generic ${BOSH_INSTALL_TARGET}/bosh/compile.env.generic
cp 1.12/compile.env.darwin ${BOSH_INSTALL_TARGET}/bosh/compile.env
cp 1.12/compile.env.generic ${BOSH_INSTALL_TARGET}/bosh/compile.env.generic
7 changes: 7 additions & 0 deletions packages/golang-1.12-darwin/spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: golang-1.12-darwin

files:
- 1.12/compile.env.darwin
- 1.12/compile.env.generic
- go1.12*.darwin-amd64.tar.gz
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eux

source /var/vcap/packages/golang-1.10-linux/bosh/compile.env
source /var/vcap/packages/golang-1.12-linux/bosh/compile.env

cp test.go ${BOSH_INSTALL_TARGET}/

Expand Down
8 changes: 8 additions & 0 deletions packages/golang-1.12-linux-test/spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: golang-1.12-linux-test

dependencies:
- golang-1.12-linux

files:
- test.go
10 changes: 10 additions & 0 deletions packages/golang-1.12-linux/packaging
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set -e -x -u

tar xzf go*.linux-amd64.tar.gz

cp -R go/* ${BOSH_INSTALL_TARGET}

mkdir ${BOSH_INSTALL_TARGET}/bosh
cp 1.12/runtime.env.linux ${BOSH_INSTALL_TARGET}/bosh/runtime.env
cp 1.12/compile.env.linux ${BOSH_INSTALL_TARGET}/bosh/compile.env
cp 1.12/compile.env.generic ${BOSH_INSTALL_TARGET}/bosh/compile.env.generic
8 changes: 8 additions & 0 deletions packages/golang-1.12-linux/spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: golang-1.12-linux

files:
- 1.12/runtime.env.linux
- 1.12/compile.env.linux
- 1.12/compile.env.generic
- go1.12*.linux-amd64.tar.gz
Loading

0 comments on commit ee2dd31

Please sign in to comment.