Code Monkey home page Code Monkey logo

Comments (4)

btassone avatar btassone commented on June 21, 2024

is there a way to set env variable in the context where the goss binary is downloaded ? I want to set proxy env variable to let curl || wget to connect on internet

Are you talking about creating an environment variable for the base part of url in the getDownloadUrl method here:

return fmt.Sprintf("https://github.com/goss-org/goss/releases/download/v%s/%s", p.config.Version, filename)
?

from packer-plugin-goss.

tuxtof avatar tuxtof commented on June 21, 2024

no i'm talking about specifying env variable used by the wget/curl command who download the goss binary to change their behaviour, in this specific case use a proxy

from packer-plugin-goss.

FalcoSuessgott avatar FalcoSuessgott commented on June 21, 2024

I think the plugin does provide that ability using VarsEnv var:

func (p *Provisioner) envVars() string {
var sb strings.Builder
for env_var, value := range p.config.VarsEnv {
switch p.config.TargetOs {
case windows:
// Windows requires a call to "set" as separate command seperated by && for each env variable
sb.WriteString(fmt.Sprintf("set \"%s=%s\" && ", env_var, value))
default:
sb.WriteString(fmt.Sprintf("%s=\"%s\" ", env_var, value))
}
}
return sb.String()
}
func (p *Provisioner) sslFlag(cmdType string) string {
if p.config.SkipSSLChk {
switch cmdType {
case "curl":

In case I find some time I could try to provide you an example ..

from packer-plugin-goss.

Related Issues (20)

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.