Giter Club home page Giter Club logo

bosh-package-golang-release's Introduction

golang

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/cloudfoundry/bosh-package-golang-release
$ cd ~/workspace/your-release
$ bosh vendor-package golang-1.22-linux ~/workspace/bosh-package-golang-release

Included packages:

  • golang-1-{linux,darwin,windows}: updated with latest version of go 1.x
  • golang-1.21-{linux,darwin,windows}: updated with latest version of go 1.21.x
  • golang-1.22-{linux,darwin,windows}: updated with latest version of go 1.22.x

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

#!/bin/bash -eu
source /var/vcap/packages/golang-1.22-linux/bosh/compile.env
go build ...

or on Windows:

. C:\var\vcap\packages\golang-1.22-windows\bosh\compile.ps1
go build ...

[advanced use] To use golang-* package at runtime in your job scripts:

#!/bin/bash -eu
source /var/vcap/packages/golang-1.22-linux/bosh/runtime.env
go run ...

or on Windows:

. C:\var\vcap\packages\golang-1.22-windows\bosh\runtime.ps1
go run ...

Development

To run tests cd tests/ && BOSH_ENVIRONMENT=vbox ./run.sh

Adding a new golang line

To add a new line, edit the variable in the top of dev/add-line Execute the script, commit changes, and update the pipeline.

The blobs necessary for the new version line will automatically be added via CI. The build-docker-image job will fail until the blobs are added by the bump job.

Windows

You will need to set the following variables, for example:

export STEMCELL_PATH="/path/to/windows/stemcell.zip"
export STEMCELL_VERSION="<version>"
export OS="windows2019"
export JOB_NAME="test-windows"
export VM_EXTENSIONS="[50GB_ephemeral_disk]"

Shared Concourse tasks

This repository provides a couple helpful Concourse tasks in ci/tasks/shared that can help keep the Golang package vendored in your BOSH release up to date, and bump dependencies.

ci/tasks/shared/bump-golang-package

The bump-golang-package task runs bosh vendor-package to automatically update the version of Golang vendored into your own BOSH release.

  • GIT_USER_NAME: Required. The email that will be used to generate commits.
  • GIT_USER_EMAIL: Required. The user name that will be used to generate commits.
  • PACKAGES: Required. Specifies Golang packages will be vendored into your own BOSH release, e.g. the golang-1-linux package.
  • PACKAGES_TO_REMOVE: Optional. A list of packages to remove from the release. This can be useful if one is bumping from golang-1.x-linux to golang-1.y-linux and 1.y is intended to replace 1.x/
  • PRIVATE_YML: Required. The contents of config/private.yml for your own BOSH release. Necessary to run bosh vendor-package.
  • RELEASE_DIR: Required. The directory where your release has been cloned on disk.

ci/tasks/shared/bump-deps

The bump-deps task will update to go version specified in go.mod and then run go get -u ./..., and if a tools package is present go get -u ./tools in the $SOURCE_PATH directory specified.

  • GIT_USER_NAME: Required. The email that will be used to generate commits.
  • GIT_USER_EMAIL: Required. The user name that will be used to generate commits.
  • GO_PACKAGE: Required. The location of the vendored Golang package to be used when running go commands.
  • SOURCE_PATH: Required. The location of the Golang source you wish to update. Must contain a go.mod file.

bosh-package-golang-release's People

Contributors

aramprice avatar beyhan avatar camilalonart avatar charleshansen avatar cjnosal avatar cppforlife avatar cunnie avatar danielfor avatar dpb587 avatar dpb587-pivotal avatar genevieve avatar h4xnoodle avatar jfmyers9 avatar jpalermo avatar jrussett avatar klakin-pivotal avatar lnguyen avatar maxmoehl avatar mrosecrance avatar ragaskar avatar rkoster avatar s4heid avatar selzoc avatar tanzeeb avatar winkingturtle-vmw avatar ystros avatar zpascal avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bosh-package-golang-release's Issues

Add golang-stable-* and golang-old-stable-* packages

Github action now supports having stable and old-stable version instead of having to update the version every few months. Recently we had to keep both supported golang version for windows-tools-release since some of our concourse workers needed to stay behind while others could be moved forward. We've opt-in for an actual version number to get around this and added a second package, but it'd be great if we could've used old-stable instead so that we don't have to keep updating it.

What are you thoughts about adding 12 more packages to this release

  • golang-old-stable-darwin-test
  • golang-old-stable-darwin
  • golang-old-stable-linux-test
  • golang-old-linux-darwin
  • golang-old-stable-windows-test
  • golang-old-stable-windows
  • golang-stable-darwin-test
  • golang-stable-darwin
  • golang-stable-linux-test
  • golang-stable-linux-darwin
  • golang-stable-windows-test
  • golang-stable-windows

Update to Golang 1.9.4

The CFCR team is using golang-release and would like to incorporate the CVE fix in Go 1.9.4.

Version mentioned in /packages/golang-1-linux/version is not consistently the latest one

Hi all,
we'd like to bump the used golang version in app-autoscaler automatically.
Therefor we'd like to depend on golang-1-linux and have to figure out the currently contained version after using vendor-package.

We noticed that /packages/golang-1-linux/version contains the current version. But when we checked the history of that file the version is jumping backwards and forward between the last two maintained versions.

From our perspective it need to be ensured that an updated of the second last golang release (1.17.x) does not overwrite the version of the last golang release (1.18) in /packages/golang-1-linux/version.

Support compiling with dep.

My go application is using dep and this release seems to be not supported it. so, bosh can't do "dep ensure" in compile phase.
In workaround. I commit vendor dir into go-app repo. but that is not quite smart.

Would this release has dep pkg?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.