Closed a-t-0 closed 1 year ago
elif [ "$found_error_in_ssh_command" == "FOUND" ]; then
# Two tries is enough to determine the device does not have ssh-access.
if [ "$is_retry" == "YES" ]; then
echo "NOTFOUND"
else
create_and_activate_local_github_ssh_deploy_key
# Perform recursive call to run function one more time.
echo $(check_quick_ssh_access_to_repo "$github_username" "$github_repository" "YES")
fi
elif [ "$found_permission_lack_in_ssh_command" == "FOUND" ]; then
# Two tries is enough to determine the device does not have ssh-access.
create_and_activate_local_github_ssh_deploy_key
read -p "Set ssh key"
# Perform recursive call to run function one more time.
echo $(check_quick_ssh_access_to_repo "$github_username" "$github_repository" "YES")
read -p "checked has access again."
fi
Output:
6. Ensuring you have ssh push access to the gitlab-ci-build-statuses repository with your ssh-deploy key.HIIIII has_quick_ssh_access_to_github=NOTFOUND
Identity added: /home/name/.ssh/some_github_deploy_key (example@example.com)
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
yes: standard output: Broken pipe
HIIIII has_quick_ssh_access_to_github=FOUND
STOP ensured_quick_ssh_access_to_github=FOUND
Agent pid 48156
Reading package lists...
Building dependency tree...
Reading state information...
wget is already the newest version (1.21.3-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
Setting and getting GitHub ssh-deploy key (NOT TOKEN).
The ssh deploy key is:=ssh-some key example@example.com
Loading geckodriver
Loading took too much time!
Please enter the two factor authentication you just received:Page is ready!
Page is ready!
Page is ready!
Page is ready!
Done adding the ssh deploy key from your machine to:gitlab-ci-build-statuses. Waiting 10 seconds and then the browser.
Done setting GitHub deployment token repo:gitlab-ci-build-statuses.
Done.
ENSURED_QUICK_SSH_ACCESS
5. Setting and Getting the GitHub personal access token if it does not yet exist. % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5607 100 5607 0 0 15755 0 --:--:-- --:--:-- --:--:-- 15794
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5607 100 5607 0 0 18178 0 --:--:-- --:--:-- --:--:-- 18204
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 279 100 279 0 0 2078 0 --:--:-- --:--:-- --:--:-- 2066
jq: error (at <stdin>:1): Cannot index string with string "sha"
Error, the commit sha: is not of correct length
Now using a browser controller repository to create a GitHub personal access token and store it localy.
.
Third error:
pac=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
File exists,new_line=GITHUB_PERSONAL_ACCESS_TOKEN_GLOBAL=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
Hi, I'm done creating the GitHub personal access token to set the GitHub commit build status.
Done.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 90 100 90 0 0 294 0 --:--:-- --:--:-- --:--:-- 295
curl: (3) URL using bad/illegal format or missing URL
jq: error (at <stdin>:1): Cannot index string with string "url"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 90 100 90 0 0 339 0 --:--:-- --:--:-- --:--:-- 338
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 217 100 90 100 127 334 471 --:--:-- --:--:-- --:--:-- 806
Error, was not able to use the GitHub personal access token (I):
NOTFOUND
Error, was not able to use the GitHub personal access token (II):
Error, the GitHub commit status was not succesfully set to:pending
Done.
On a clean install of Ubuntu, running:
yields: