Commit ce5d9a2d authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg 🌴

Update documentation

parent 96205da6
Pipeline #7341125 passed with stages
in 29 minutes and 1 second
......@@ -363,7 +363,6 @@ func (b *Build) String() string {
func (b *Build) GetDefaultVariables() JobVariables {
return JobVariables{
{Key: "CI_DEBUG_TRACE", Value: "false", Public: true, Internal: true, File: false},
{Key: "CI_PROJECT_DIR", Value: b.FullProjectDir(), Public: true, Internal: true, File: false},
{Key: "CI_SERVER", Value: "yes", Public: true, Internal: true, File: false},
}
......
......@@ -378,3 +378,26 @@ func TestRunSuccessOnSecondAttempt(t *testing.T) {
err = build.Run(&Config{}, &Trace{Writer: os.Stdout})
assert.NoError(t, err)
}
func TestDebugTrace(t *testing.T) {
build := &Build{}
assert.False(t, build.IsDebugTraceEnabled(), "IsDebugTraceEnabled should be false if CI_DEBUG_TRACE is not set")
successfulBuild, err := GetSuccessfulBuild()
assert.NoError(t, err)
successfulBuild.Variables = append(successfulBuild.Variables, JobVariable{"CI_DEBUG_TRACE", "false", true, true, false})
build = &Build{
JobResponse: successfulBuild,
}
assert.False(t, build.IsDebugTraceEnabled(), "IsDebugTraceEnabled should be false if CI_DEBUG_TRACE is set to false")
successfulBuild, err = GetSuccessfulBuild()
assert.NoError(t, err)
successfulBuild.Variables = append(successfulBuild.Variables, JobVariable{"CI_DEBUG_TRACE", "true", true, true, false})
build = &Build{
JobResponse: successfulBuild,
}
assert.True(t, build.IsDebugTraceEnabled(), "IsDebugTraceEnabled should be true if CI_DEBUG_TRACE is set to true")
}
......@@ -224,8 +224,8 @@ type UpdateJobRequest struct {
}
type JobCredentials struct {
ID int `long:"id" env:"CI_BUILD_ID" description:"The build ID to upload artifacts for"`
Token string `long:"token" env:"CI_BUILD_TOKEN" required:"true" description:"Build token"`
ID int `long:"id" env:"CI_JOB_ID" description:"The build ID to upload artifacts for"`
Token string `long:"token" env:"CI_JOB_TOKEN" required:"true" description:"Build token"`
URL string `long:"url" env:"CI_SERVER_URL" required:"true" description:"GitLab CI URL"`
TLSCAFile string `long:"tls-ca-file" env:"CI_SERVER_TLS_CA_FILE" description:"File containing the certificates to verify the peer when using HTTPS"`
}
......
......@@ -96,7 +96,7 @@ and straight forward access between container during the CI stages.
``` yaml
variables:
KUBERNETES_NAMESPACE_OVERWRITE: ci-${CI_BUILD_REF_NAME}
KUBERNETES_NAMESPACE_OVERWRITE: ci-${CI_COMMIT_REF_NAME}
```
Furthermore, to ensure only designated namespaces will be used during CI runs, inform the configuration
......
......@@ -80,11 +80,11 @@ IF %errorlevel% NEQ 0 exit /b %errorlevel%
goto :EOF
:prescript
SET CI=true
SET CI_BUILD_REF=db45ad9af9d7af5e61b829442fd893d96e31250c
SET CI_BUILD_BEFORE_SHA=d63117656af6ff57d99e50cc270f854691f335ad
SET CI_BUILD_REF_NAME=master
SET CI_BUILD_ID=1
SET CI_BUILD_REPO=http://gitlab.example.com/group/project.git
SET CI_COMMIT_REF=db45ad9af9d7af5e61b829442fd893d96e31250c
SET CI_COMMIT_BEFORE_SHA=d63117656af6ff57d99e50cc270f854691f335ad
SET CI_COMMIT_REF_NAME=master
SET CI_JOB_ID=1
SET CI_REPOSITORY_URL=http://gitlab.example.com/group/project.git
SET CI_PROJECT_ID=1
SET CI_PROJECT_DIR=Z:/Gitlab/tests/test/builds/0/project-1
SET CI_SERVER=yes
......@@ -127,11 +127,11 @@ goto :EOF
:buildscript
SET CI=true
SET CI_BUILD_REF=db45ad9af9d7af5e61b829442fd893d96e31250c
SET CI_BUILD_BEFORE_SHA=d63117656af6ff57d99e50cc270f854691f335ad
SET CI_BUILD_REF_NAME=master
SET CI_BUILD_ID=1
SET CI_BUILD_REPO=Z:\Gitlab\tests\test
SET CI_COMMIT_REF=db45ad9af9d7af5e61b829442fd893d96e31250c
SET CI_COMMIT_BEFORE_SHA=d63117656af6ff57d99e50cc270f854691f335ad
SET CI_COMMIT_REF_NAME=master
SET CI_JOB_ID=1
SET CI_REPOSITORY_URL=Z:\Gitlab\tests\test
SET CI_PROJECT_ID=1
SET CI_PROJECT_DIR=Z:/Gitlab/tests/test/builds/0/project-1
SET CI_SERVER=yes
......@@ -154,11 +154,11 @@ goto :EOF
:postscript
SET CI=true
SET CI_BUILD_REF=db45ad9af9d7af5e61b829442fd893d96e31250c
SET CI_BUILD_BEFORE_SHA=d63117656af6ff57d99e50cc270f854691f335ad
SET CI_BUILD_REF_NAME=master
SET CI_BUILD_ID=1
SET CI_BUILD_REPO=Z:\Gitlab\tests\test
SET CI_COMMIT_REF=db45ad9af9d7af5e61b829442fd893d96e31250c
SET CI_COMMIT_BEFORE_SHA=d63117656af6ff57d99e50cc270f854691f335ad
SET CI_COMMIT_REF_NAME=master
SET CI_JOB_ID=1
SET CI_REPOSITORY_URL=Z:\Gitlab\tests\test
SET CI_PROJECT_ID=1
SET CI_PROJECT_DIR=Z:/Gitlab/tests/test/builds/0/project-1
SET CI_SERVER=yes
......@@ -203,16 +203,16 @@ echo "Running on $env:computername..."
& {
$CI="true"
$env:CI=$CI
$CI_BUILD_REF="db45ad9af9d7af5e61b829442fd893d96e31250c"
$env:CI_BUILD_REF=$CI_BUILD_REF
$CI_BUILD_BEFORE_SHA="d63117656af6ff57d99e50cc270f854691f335ad"
$env:CI_BUILD_BEFORE_SHA=$CI_BUILD_BEFORE_SHA
$CI_BUILD_REF_NAME="master"
$env:CI_BUILD_REF_NAME=$CI_BUILD_REF_NAME
$CI_BUILD_ID="1"
$env:CI_BUILD_ID=$CI_BUILD_ID
$CI_BUILD_REPO="Z:\Gitlab\tests\test"
$env:CI_BUILD_REPO=$CI_BUILD_REPO
$CI_COMMIT_REF="db45ad9af9d7af5e61b829442fd893d96e31250c"
$env:CI_COMMIT_REF=$CI_COMMIT_REF
$CI_COMMIT_BEFORE_SHA="d63117656af6ff57d99e50cc270f854691f335ad"
$env:CI_COMMIT_BEFORE_SHA=$CI_COMMIT_BEFORE_SHA
$CI_COMMIT_REF_NAME="master"
$env:CI_COMMIT_REF_NAME=$CI_COMMIT_REF_NAME
$CI_JOB_ID="1"
$env:CI_JOB_ID=$CI_JOB_ID
$CI_REPOSITORY_URL="Z:\Gitlab\tests\test"
$env:CI_REPOSITORY_URL=$CI_REPOSITORY_URL
$CI_PROJECT_ID="1"
$env:CI_PROJECT_ID=$CI_PROJECT_ID
$CI_PROJECT_DIR="Z:/Gitlab/tests/test/builds/0/project-1"
......@@ -273,16 +273,16 @@ if(!$?) { Exit $LASTEXITCODE }
& {
$CI="true"
$env:CI=$CI
$CI_BUILD_REF="db45ad9af9d7af5e61b829442fd893d96e31250c"
$env:CI_BUILD_REF=$CI_BUILD_REF
$CI_BUILD_BEFORE_SHA="d63117656af6ff57d99e50cc270f854691f335ad"
$env:CI_BUILD_BEFORE_SHA=$CI_BUILD_BEFORE_SHA
$CI_BUILD_REF_NAME="master"
$env:CI_BUILD_REF_NAME=$CI_BUILD_REF_NAME
$CI_BUILD_ID="1"
$env:CI_BUILD_ID=$CI_BUILD_ID
$CI_BUILD_REPO="Z:\Gitlab\tests\test"
$env:CI_BUILD_REPO=$CI_BUILD_REPO
$CI_COMMIT_REF="db45ad9af9d7af5e61b829442fd893d96e31250c"
$env:CI_COMMIT_REF=$CI_COMMIT_REF
$CI_COMMIT_BEFORE_SHA="d63117656af6ff57d99e50cc270f854691f335ad"
$env:CI_COMMIT_BEFORE_SHA=$CI_COMMIT_BEFORE_SHA
$CI_COMMIT_REF_NAME="master"
$env:CI_COMMIT_REF_NAME=$CI_COMMIT_REF_NAME
$CI_JOB_ID="1"
$env:CI_JOB_ID=$CI_JOB_ID
$CI_REPOSITORY_URL="Z:\Gitlab\tests\test"
$env:CI_REPOSITORY_URL=$CI_REPOSITORY_URL
$CI_PROJECT_ID="1"
$env:CI_PROJECT_ID=$CI_PROJECT_ID
$CI_PROJECT_DIR="Z:/Gitlab/tests/test/builds/0/project-1"
......@@ -318,16 +318,16 @@ if(!$?) { Exit $LASTEXITCODE }
& {
$CI="true"
$env:CI=$CI
$CI_BUILD_REF="db45ad9af9d7af5e61b829442fd893d96e31250c"
$env:CI_BUILD_REF=$CI_BUILD_REF
$CI_BUILD_BEFORE_SHA="d63117656af6ff57d99e50cc270f854691f335ad"
$env:CI_BUILD_BEFORE_SHA=$CI_BUILD_BEFORE_SHA
$CI_BUILD_REF_NAME="master"
$env:CI_BUILD_REF_NAME=$CI_BUILD_REF_NAME
$CI_BUILD_ID="1"
$env:CI_BUILD_ID=$CI_BUILD_ID
$CI_BUILD_REPO="Z:\Gitlab\tests\test"
$env:CI_BUILD_REPO=$CI_BUILD_REPO
$CI_COMMIT_REF="db45ad9af9d7af5e61b829442fd893d96e31250c"
$env:CI_COMMIT_REF=$CI_COMMIT_REF
$CI_COMMIT_BEFORE_SHA="d63117656af6ff57d99e50cc270f854691f335ad"
$env:CI_COMMIT_BEFORE_SHA=$CI_COMMIT_BEFORE_SHA
$CI_COMMIT_REF_NAME="master"
$env:CI_COMMIT_REF_NAME=$CI_COMMIT_REF_NAME
$CI_JOB_ID="1"
$env:CI_JOB_ID=$CI_JOB_ID
$CI_REPOSITORY_URL="Z:\Gitlab\tests\test"
$env:CI_REPOSITORY_URL=$CI_REPOSITORY_URL
$CI_PROJECT_ID="1"
$env:CI_PROJECT_ID=$CI_PROJECT_ID
$CI_PROJECT_DIR="Z:/Gitlab/tests/test/builds/0/project-1"
......
......@@ -346,7 +346,7 @@ func getRequestJobResponse() (res map[string]interface{}) {
cache := make([]map[string]interface{}, 1)
cache[0] = make(map[string]interface{})
cache[0]["key"] = "$CI_BUILD_REF"
cache[0]["key"] = "$CI_COMMIT_REF"
cache[0]["untracked"] = false
cache[0]["paths"] = []string{"vendor/*"}
res["cache"] = cache
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment