Skip to content
Snippets Groups Projects
Commit 6038165b authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Fix typo in echo statement preventing from showing DEP_NAME

parent ab6e4210
No related branches found
No related tags found
No related merge requests found
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
################################################################################################### ###################################################################################################
.ubuntu:download:select_jobs: .ubuntu:download:select_jobs:
# This task will retrieve specific jobs and store them in # This task will retrieve specific jobs and store them in
# NOTE: this script do not work in standalone # NOTE: this script do not work in standalone
# it is meant to be called as part of the # it is meant to be called as part of the
# following jobs : # following jobs :
# - .ubuntu:download:repositories # - .ubuntu:download:repositories
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
echo "*************************************************************************" echo "*************************************************************************"
echo "*************************************************************************" echo "*************************************************************************"
echo "**" echo "**"
echo "** RETRIEVING \$DEP_NAME'S PROJECT ID" echo "** RETRIEVING ${DEP_NAME^^}'S PROJECT ID"
echo "**" echo "**"
echo "*************************************************************************" echo "*************************************************************************"
echo "*************************************************************************" echo "*************************************************************************"
...@@ -161,8 +161,8 @@ ...@@ -161,8 +161,8 @@
--argjson mr_pipelines "$MR_PIPELINES" \ --argjson mr_pipelines "$MR_PIPELINES" \
--arg project_namespace "$CI_PROJECT_NAMESPACE" \ --arg project_namespace "$CI_PROJECT_NAMESPACE" \
'$pipelines + $mr_pipelines '$pipelines + $mr_pipelines
| map(select(.web_url | test($project_namespace))) | map(select(.web_url | test($project_namespace)))
| sort_by(.updated_at) | sort_by(.updated_at)
| reverse' | reverse'
) )
if [[ ! -z "$CI_COMMIT_TAG" ]]; then if [[ ! -z "$CI_COMMIT_TAG" ]]; then
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
repo : $repo_name, repo : $repo_name,
repo_id : $repo_id, repo_id : $repo_id,
branch_to_pull : $branch_name, branch_to_pull : $branch_name,
id, status, name, ref, created_at, updated_at, id, status, name, ref, created_at, updated_at,
user : { id : .user.id, username : .user.username }, user : { id : .user.id, username : .user.username },
commit : { author : .commit.author_name, id : .commit.id, message : .commit.message, authored_date : .commit.authored_date }, commit : { author : .commit.author_name, id : .commit.id, message : .commit.message, authored_date : .commit.authored_date },
pipeline : { id : .pipeline.id, iid : .pipeline.iid, project_id : .pipeline.project_id, ref : .pipeline.ref}, pipeline : { id : .pipeline.id, iid : .pipeline.iid, project_id : .pipeline.project_id, ref : .pipeline.ref},
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
foreach ($DEP_NAME in $DEPS_NAMES) { foreach ($DEP_NAME in $DEPS_NAMES) {
Write-Host "curr dep = $DEP_NAME" Write-Host "curr dep = $DEP_NAME"
# Download dependencies # Download dependencies
###################################################################################################### ######################################################################################################
# Retrieve the ID of the project # Retrieve the ID of the project
# Depending on wether the project is the official project or a user fork # Depending on wether the project is the official project or a user fork
...@@ -288,10 +288,10 @@ ...@@ -288,10 +288,10 @@
if ( $CI_PROJECT_NAMESPACE -match ".*eclipse/aidge.*" ){ # nominal case : we are in the official project if ( $CI_PROJECT_NAMESPACE -match ".*eclipse/aidge.*" ){ # nominal case : we are in the official project
Write-Host "Retrieve DEP ID from $API_URL/groups/$CI_PROJECT_NAMESPACE_ID/projects?search=$DEP_NAME" Write-Host "Retrieve DEP ID from $API_URL/groups/$CI_PROJECT_NAMESPACE_ID/projects?search=$DEP_NAME"
$DEP_ID=$( Invoke-RestMethod -Uri "$API_URL/groups/$CI_PROJECT_NAMESPACE_ID/projects?search=$DEP_NAME" -Method Get)[0].id $DEP_ID=$( Invoke-RestMethod -Uri "$API_URL/groups/$CI_PROJECT_NAMESPACE_ID/projects?search=$DEP_NAME" -Method Get)[0].id
} else { } else {
# case for fork # case for fork
Write-Host "Forked repo detected : not on the official repo but on a user's forked project." Write-Host "Forked repo detected : not on the official repo but on a user's forked project."
Write-Host "Retrieving USER_ID from : $API_URL/users?username=$CI_PROJECT_ROOT_NAMESPACE" Write-Host "Retrieving USER_ID from : $API_URL/users?username=$CI_PROJECT_ROOT_NAMESPACE"
$USER_ID=$(Invoke-RestMethod -Uri "$API_URL/users?username=$CI_PROJECT_ROOT_NAMESPACE" -Method Get)[0].id $USER_ID=$(Invoke-RestMethod -Uri "$API_URL/users?username=$CI_PROJECT_ROOT_NAMESPACE" -Method Get)[0].id
Write-Host "USER ID = $USER_ID" Write-Host "USER ID = $USER_ID"
$DEP_ID=$(Invoke-RestMethod -Uri "$API_URL/users/$USER_ID/projects?search=${DEP_NAME}" -Method Get)[0].id $DEP_ID=$(Invoke-RestMethod -Uri "$API_URL/users/$USER_ID/projects?search=${DEP_NAME}" -Method Get)[0].id
...@@ -326,7 +326,7 @@ ...@@ -326,7 +326,7 @@
Write-Host "NON DRAFT MERGE REQUEST Pipeline detected : Pulling from CI_MERGE_REQUEST_TARGET_BRANCH_NAME : $CI_MERGE_REQUEST_TARGET_BRANCH_NAME." Write-Host "NON DRAFT MERGE REQUEST Pipeline detected : Pulling from CI_MERGE_REQUEST_TARGET_BRANCH_NAME : $CI_MERGE_REQUEST_TARGET_BRANCH_NAME."
Write-Host "Checking if CI_MERGE_REQUEST_TARGET_BRANCH_NAME "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" branch exists, otherwise pull from default." Write-Host "Checking if CI_MERGE_REQUEST_TARGET_BRANCH_NAME "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" branch exists, otherwise pull from default."
$FILTERED_BRANCHES=@($DEP_BRANCHES | Where-Object { $_.name -eq "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"}) $FILTERED_BRANCHES=@($DEP_BRANCHES | Where-Object { $_.name -eq "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"})
if ( ($FILTERED_BRANCHES.Count) -gt 0){ if ( ($FILTERED_BRANCHES.Count) -gt 0){
Write-Host "Found MR target branch in $DEP_NAME." Write-Host "Found MR target branch in $DEP_NAME."
$BRANCH_TO_PULL=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME $BRANCH_TO_PULL=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
...@@ -340,7 +340,7 @@ ...@@ -340,7 +340,7 @@
# CASE WHERE A COMMIT TAG IS CREATED # CASE WHERE A COMMIT TAG IS CREATED
} elseif ( "$CI_COMMIT_TAG" ) { } elseif ( "$CI_COMMIT_TAG" ) {
Write-Host "Retrieving repo tags from $DEP_API_URL/repository/tags?per_page=100" Write-Host "Retrieving repo tags from $DEP_API_URL/repository/tags?per_page=100"
$DEP_TAGS = $($(Invoke-RestMethod -Uri "$DEP_API_URL/repository/tags?per_page=100" -Method Get) | $DEP_TAGS = $($(Invoke-RestMethod -Uri "$DEP_API_URL/repository/tags?per_page=100" -Method Get) |
Sort-Object -Property {[datetime]$_.commit.created_at} -Descending) Sort-Object -Property {[datetime]$_.commit.created_at} -Descending)
if ( $DEP_TAGS.Count -eq 0 ) { if ( $DEP_TAGS.Count -eq 0 ) {
Write-Host "No tag found for $DEP_NAME at url $DEP_API_URL/repository/tags?per_page=100" Write-Host "No tag found for $DEP_NAME at url $DEP_API_URL/repository/tags?per_page=100"
...@@ -395,8 +395,8 @@ ...@@ -395,8 +395,8 @@
$PIPELINES | Out-String $PIPELINES | Out-String
Write-Host "Sorting pipelines from newest to oldest & filtering out those not linked to CI_PROJECT_NAMESPACE ($CI_PROJECT_NAMESPACE)" Write-Host "Sorting pipelines from newest to oldest & filtering out those not linked to CI_PROJECT_NAMESPACE ($CI_PROJECT_NAMESPACE)"
$PIPELINES = $PIPELINES | $PIPELINES = $PIPELINES |
Where-Object { $_.web_url -match $CI_PROJECT_NAMESPACE } | Where-Object { $_.web_url -match $CI_PROJECT_NAMESPACE } |
Sort-Object -Property updated_at -Descending Sort-Object -Property updated_at -Descending
$PIPELINES = @($PIPELINES) $PIPELINES = @($PIPELINES)
Write-Host "Final Pipelines nb to parse : $($PIPELINES.Count)" Write-Host "Final Pipelines nb to parse : $($PIPELINES.Count)"
...@@ -420,7 +420,7 @@ ...@@ -420,7 +420,7 @@
$JOBS = @( $JOBS = @(
$JOBS | $JOBS |
Where-Object { $_.name -eq $DEPENDENCY_JOB -and $_.status -eq "success" } | Where-Object { $_.name -eq $DEPENDENCY_JOB -and $_.status -eq "success" } |
Select-Object @{Name="repo"; Expression={$DEP_NAME}}, Select-Object @{Name="repo"; Expression={$DEP_NAME}},
id, status, @{Name="job_name"; Expression={$_.name}}, ref, id, status, @{Name="job_name"; Expression={$_.name}}, ref,
@{Name="branch_to_pull"; Expression={$BRANCH_TO_PULL}}, @{Name="branch_to_pull"; Expression={$BRANCH_TO_PULL}},
created_at, updated_at, created_at, updated_at,
...@@ -429,7 +429,7 @@ ...@@ -429,7 +429,7 @@
@{Name="pipeline"; Expression={[PSCustomObject]@{id=$_.pipeline.id; iid=$_.pipeline.iid; project_id=$_.pipeline.project_id; ref=$_.pipeline.ref}}} @{Name="pipeline"; Expression={[PSCustomObject]@{id=$_.pipeline.id; iid=$_.pipeline.iid; project_id=$_.pipeline.project_id; ref=$_.pipeline.ref}}}
) )
if ( $JOBS.Count -gt 0 ) { if ( $JOBS.Count -gt 0 ) {
$FOUND_JOB=1 $FOUND_JOB=1
Write-Host "Successful job $DEPENDENCY_JOB found in branch $BRANCH_TO_PULL for project $DEP_NAME" Write-Host "Successful job $DEPENDENCY_JOB found in branch $BRANCH_TO_PULL for project $DEP_NAME"
Write-Host "Appending this jobs to the list of selected jobs that will serve as reference to retrieve artifact or specific commit." Write-Host "Appending this jobs to the list of selected jobs that will serve as reference to retrieve artifact or specific commit."
...@@ -466,6 +466,6 @@ ...@@ -466,6 +466,6 @@
Write-Host "*" Write-Host "*"
Write-Host "*************************************************************************" Write-Host "*************************************************************************"
Write-Host "*************************************************************************" Write-Host "*************************************************************************"
Write-Host "SELECTED_JOBS = $($DEPS_SELECTED_JOBS | Out-String)" Write-Host "SELECTED_JOBS = $($DEPS_SELECTED_JOBS | Out-String)"
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment