Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
951face3
Unverified
Commit
951face3
authored
1 year ago
by
Florian Ruynat
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Migrate CI_BUILD_ID to CI_JOB_ID and CI_BUILD_REF to CI_COMMIT_SHA (#10063)
parent
07d45e6b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
scripts/premoderator.sh
+4
-4
4 additions, 4 deletions
scripts/premoderator.sh
tests/scripts/testcases_run.sh
+4
-4
4 additions, 4 deletions
tests/scripts/testcases_run.sh
with
9 additions
and
9 deletions
.gitlab-ci.yml
+
1
−
1
View file @
951face3
...
...
@@ -14,7 +14,7 @@ variables:
GITLAB_REPOSITORY
:
'
kargo-ci/kubernetes-sigs-kubespray'
ANSIBLE_FORCE_COLOR
:
"
true"
MAGIC
:
"
ci
check
this"
TEST_ID
:
"
$CI_PIPELINE_ID-$CI_
BUILD
_ID"
TEST_ID
:
"
$CI_PIPELINE_ID-$CI_
JOB
_ID"
CI_TEST_VARS
:
"
./tests/files/${CI_JOB_NAME}.yml"
CI_TEST_REGISTRY_MIRROR
:
"
./tests/common/_docker_hub_registry_mirror.yml"
CI_TEST_SETTING
:
"
./tests/common/_kubespray_test_settings.yml"
...
...
This diff is collapsed.
Click to expand it.
scripts/premoderator.sh
+
4
−
4
View file @
951face3
...
...
@@ -2,18 +2,18 @@
# A naive premoderation script to allow Gitlab CI pipeline on a specific PRs' comment
# Exits with 0, if the pipeline is good to go
# Exits with 1, if the user is not allowed to start pipeline
# Exits with 2, if script is unable to get issue id from CI_
BUILD
_REF_NAME variable
# Exits with 2, if script is unable to get issue id from CI_
COMMIT
_REF_NAME variable
# Exits with 3, if missing the magic comment in the pipeline to start the pipeline
CURL_ARGS
=
"-fs --retry 4 --retry-delay 5"
MAGIC
=
"
${
MAGIC
:-
ci
check this
}
"
exit_code
=
0
# Get PR number from CI_
BUILD
_REF_NAME
issue
=
$(
echo
${
CI_
BUILD
_REF_NAME
}
| perl
-ne
'/^pr-(\d+)-\S+$/ && print $1'
)
# Get PR number from CI_
COMMIT
_REF_NAME
issue
=
$(
echo
${
CI_
COMMIT
_REF_NAME
}
| perl
-ne
'/^pr-(\d+)-\S+$/ && print $1'
)
if
[
"
$issue
"
=
""
]
;
then
echo
"Unable to get issue id from:
$CI_
BUILD
_REF_NAME
"
echo
"Unable to get issue id from:
$CI_
COMMIT
_REF_NAME
"
exit
2
fi
...
...
This diff is collapsed.
Click to expand it.
tests/scripts/testcases_run.sh
+
4
−
4
View file @
951face3
...
...
@@ -57,9 +57,9 @@ fi
# Check out latest tag if testing upgrade
test
"
${
UPGRADE_TEST
}
"
!=
"false"
&&
git fetch
--all
&&
git checkout
"
$KUBESPRAY_VERSION
"
# Checkout the CI vars file so it is available
test
"
${
UPGRADE_TEST
}
"
!=
"false"
&&
git checkout
"
${
CI_
BUILD_REF
}
"
tests/files/
${
CI_JOB_NAME
}
.yml
test
"
${
UPGRADE_TEST
}
"
!=
"false"
&&
git checkout
"
${
CI_
BUILD_REF
}
"
${
CI_TEST_REGISTRY_MIRROR
}
test
"
${
UPGRADE_TEST
}
"
!=
"false"
&&
git checkout
"
${
CI_
BUILD_REF
}
"
${
CI_TEST_SETTING
}
test
"
${
UPGRADE_TEST
}
"
!=
"false"
&&
git checkout
"
${
CI_
COMMIT_SHA
}
"
tests/files/
${
CI_JOB_NAME
}
.yml
test
"
${
UPGRADE_TEST
}
"
!=
"false"
&&
git checkout
"
${
CI_
COMMIT_SHA
}
"
${
CI_TEST_REGISTRY_MIRROR
}
test
"
${
UPGRADE_TEST
}
"
!=
"false"
&&
git checkout
"
${
CI_
COMMIT_SHA
}
"
${
CI_TEST_SETTING
}
# Create cluster
ansible-playbook
${
ANSIBLE_LOG_LEVEL
}
-e
@
${
CI_TEST_SETTING
}
-e
@
${
CI_TEST_REGISTRY_MIRROR
}
-e
@
${
CI_TEST_VARS
}
-e
local_release_dir
=
${
PWD
}
/downloads
--limit
"all:!fake_hosts"
cluster.yml
...
...
@@ -68,7 +68,7 @@ ansible-playbook ${ANSIBLE_LOG_LEVEL} -e @${CI_TEST_SETTING} -e @${CI_TEST_REGIS
if
[
"
${
UPGRADE_TEST
}
"
!=
"false"
]
;
then
test
"
${
UPGRADE_TEST
}
"
==
"basic"
&&
PLAYBOOK
=
"cluster.yml"
test
"
${
UPGRADE_TEST
}
"
==
"graceful"
&&
PLAYBOOK
=
"upgrade-cluster.yml"
git checkout
"
${
CI_
BUILD_REF
}
"
git checkout
"
${
CI_
COMMIT_SHA
}
"
ansible-playbook
${
ANSIBLE_LOG_LEVEL
}
-e
@
${
CI_TEST_SETTING
}
-e
@
${
CI_TEST_REGISTRY_MIRROR
}
-e
@
${
CI_TEST_VARS
}
-e
local_release_dir
=
${
PWD
}
/downloads
--limit
"all:!fake_hosts"
$PLAYBOOK
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment