github.com/vchain-us/vcn@v0.9.11-0.20210921212052-a2484d23c0b3/pkg/cicontext/jenkins_probe.go (about)

     1  /*
     2   * Copyright (c) 2018-2020 vChain, Inc. All Rights Reserved.
     3   * This software is released under GPL3.
     4   * The full license information can be found under:
     5   * https://www.gnu.org/licenses/gpl-3.0.en.html
     6   *
     7   */
     8  
     9  package cicontext
    10  
    11  import (
    12  	"os"
    13  )
    14  
    15  type jenkisnProbe struct {
    16  	name string
    17  }
    18  
    19  func (p *jenkisnProbe) Detect() bool {
    20  	_, ok := os.LookupEnv(CI_JENKINS_KEY)
    21  	return ok
    22  }
    23  
    24  func (p *jenkisnProbe) GetName() string {
    25  	return p.name
    26  }
    27  
    28  func NewJenkinsProbe() *jenkisnProbe {
    29  	return &jenkisnProbe{
    30  		name: CI_JENKINS_DESC,
    31  	}
    32  }