Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Gitlab Project Doctor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
Numérique et Écologie
Gitlab Project Doctor
Commits
7828d05a
Verified
Commit
7828d05a
authored
1 year ago
by
Geoffrey Arthaud
Browse files
Options
Downloads
Patches
Plain Diff
Fix app test
parent
6cbae745
No related branches found
No related tags found
1 merge request
!1
Feat/job token
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+8
-5
8 additions, 5 deletions
.gitlab-ci.yml
src/diagnosis/gitlab_connection.rs
+10
-5
10 additions, 5 deletions
src/diagnosis/gitlab_connection.rs
with
18 additions
and
10 deletions
.gitlab-ci.yml
+
8
−
5
View file @
7828d05a
...
@@ -21,6 +21,10 @@ include:
...
@@ -21,6 +21,10 @@ include:
-
remote
:
'
https://api.r2devops.io/job/r/gitlab/r2devops/hub/docker_build@latest.yaml'
-
remote
:
'
https://api.r2devops.io/job/r/gitlab/r2devops/hub/docker_build@latest.yaml'
-
remote
:
'
https://api.r2devops.io/job/r/gitlab/r2devops/hub/gitleaks@latest.yaml'
-
remote
:
'
https://api.r2devops.io/job/r/gitlab/r2devops/hub/gitleaks@latest.yaml'
gitleaks
:
stage
:
build_test
cache
:
[
]
check-format
:
check-format
:
stage
:
build_test
stage
:
build_test
image
:
rust:$RUST_VERSION
image
:
rust:$RUST_VERSION
...
@@ -30,10 +34,9 @@ check-format:
...
@@ -30,10 +34,9 @@ check-format:
-
cargo fmt --all -- --check
-
cargo fmt --all -- --check
-
cargo clippy -- -D warnings
-
cargo clippy -- -D warnings
allow_failure
:
true
allow_failure
:
true
rules
:
gitleaks
:
-
if
:
$CI_COMMIT_REF_NAME == 'main'
stage
:
build_test
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
cache
:
[
]
test-rust-current
:
test-rust-current
:
stage
:
build_test
stage
:
build_test
...
@@ -45,7 +48,7 @@ test-rust-current:
...
@@ -45,7 +48,7 @@ test-rust-current:
rules
:
rules
:
-
if
:
$CI_COMMIT_REF_NAME == 'main'
-
if
:
$CI_COMMIT_REF_NAME == 'main'
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
test-rust-nightly
:
test-rust-nightly
:
extends
:
test-rust-current
extends
:
test-rust-current
...
...
This diff is collapsed.
Click to expand it.
src/diagnosis/gitlab_connection.rs
+
10
−
5
View file @
7828d05a
...
@@ -9,8 +9,8 @@ use regex::Regex;
...
@@ -9,8 +9,8 @@ use regex::Regex;
use
serde
::{
Deserialize
,
Serialize
};
use
serde
::{
Deserialize
,
Serialize
};
use
crate
::
diagnosis
::{
use
crate
::
diagnosis
::{
ARTIFACT_JOBS_LIMIT
,
PACKAGE_REGISTRY_LIMIT
,
REPO_LIMIT
,
Report
able
,
Report
Job
,
Report
Pending
,
warning_if
,
ReportJob
,
Report
Pending
,
Report
Status
,
Report
able
,
ARTIFACT_JOBS_LIMIT
,
ReportStatus
,
STORAGE_LIMIT
,
warning_if
,
PACKAGE_REGISTRY_LIMIT
,
REPO_LIMIT
,
STORAGE_LIMIT
,
};
};
use
crate
::
fl
;
use
crate
::
fl
;
...
@@ -119,10 +119,15 @@ impl ConnectionJob {
...
@@ -119,10 +119,15 @@ impl ConnectionJob {
token
:
Option
<
String
>
,
token
:
Option
<
String
>
,
)
->
Result
<
(
Gitlab
,
Project
)
>
{
)
->
Result
<
(
Gitlab
,
Project
)
>
{
println!
(
"INFO: Project server : {server}"
);
println!
(
"INFO: Project server : {server}"
);
println!
(
"INFO: Project token : {token:?}"
);
let
client
=
match
Self
::
_env_token
(
token
)
?
{
let
client
=
match
Self
::
_env_token
(
token
)
?
{
GitlabToken
::
PrivateToken
(
token
)
=>
Gitlab
::
new
(
server
,
token
)
?
,
GitlabToken
::
PrivateToken
(
token
)
=>
{
GitlabToken
::
JobToken
(
token
)
=>
Gitlab
::
new_job_token
(
server
,
token
)
?
,
println!
(
"INFO: Project token : {token:?}"
);
Gitlab
::
new
(
server
,
token
)
?
}
GitlabToken
::
JobToken
(
token
)
=>
{
println!
(
"INFO: Project token : {token:?}"
);
Gitlab
::
new_job_token
(
server
,
token
)
?
}
};
};
println!
(
"INFO: Project path : {path}"
);
println!
(
"INFO: Project path : {path}"
);
let
endpoint
=
projects
::
Project
::
builder
()
let
endpoint
=
projects
::
Project
::
builder
()
...
...
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