unable to deploy from codeship to heroku - codeship

We had a consultant configure our CI, but since he left we get the following error whenever trying to deploy:
Warning: Permanently added 'heroku.com,40.19.75.141' (RSA) to the list of known hosts.
! Your account pedro#someemail.com does not have access to mysascards-staging.
!
! SSH Key Fingerprint: 41:fc:8a:39:fb:ed:eb:a6:69:a5:1b:ff:35:84:41:2f
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
If I add "pedro#someemail.com" to heroku, the deployment works fine.
How do I remove the dependency on this account from our codeship configuration?

In order for you to deploy your app using Codeship, you need to provide the Heroku API key from your Heroku account.
You can access your Heroku API key here -
https://dashboard.heroku.com/account.
Once you have your API key, you can change the deployment configuration with the following steps:
Navigate to your project
Click Project Settings
Click Deploy
Copy/Paste the API key to Heroku API Key
Make sure the Heroku user's API key has access to the application mysascards-staging
If the project has been transferred (as it appears yours has), the SSH Key that was assigned to the project most likely needs to be recreated.
You can recreate the SSH key by submitting a help ticket, and the add the key to both Heroku and the SCM.
Let me know if this helps!

To clarify the answer above - it was necessary to generate a new SSH key on codeship as the account had changed ownership.
This key then needed to be added to both the remote GIT repo (bitbucket in my case) and in Heroku. In both cases, this was possible directly on the site (no command line needed).

Related

Azure pipeline to build xcode project can't clone repo

I would like to know if you have any ideas of what happens to the following pipeline I'm developing to build an xcode project.
I'm configuring a pipeline with the xcode build, copy files, and publish artifact tasks.
I have configured the build task, with my xcworkspace path, and set up the scheme
I have all of my repos, in bitbucket, but I have set it up a service connection between my Azure devops, and bitbucket, using an app password, which have all the permissions allowed, I have developed a pipeline to build an Android app, and I don't have problems with that one, just to mention that this one doesn't depends on other separated repos
The thing is that, the developer separated the api client in a repo, from the main repo were the iOS code is, so when Azure tries to clone this repo, it can't be done, due to a host key verification, he told me that this repo is dependency of the main iOS repo.
This is the error
I'm new to Azure devops, but I have searched for solutions, and nothing. I understand that I have to configure an SSH key, but, I'm using a pipeline with a hosted microsoft agent. Should I add a task to actually set up this SSH key to the agent? Or it is only permission problems?
The things I have done, are:
Creating the app password again, with all permissions set
Change my project path, and use the correct scheme, cause I was using the wrong one. But there's no difference
The only thing I have left is to add the user from my Azure devops to a group of admins, who actually have permissions to the repo Azure is trying to clone. But I need to open a ticket with my partner, cause I cannot logged into the mail account.

Azure Devops clone This is not a valid source path in source tree

I have managed to finally add my devops account in sourcetree using the https://orgname.visualstudio.com path
Now I am having issues cloning the repository
I am using the path that devops gives me
https://orgname#dev.azure.com/orgname/MyProject/_git/MyRepo
but I get an error saying
This is not a valid source
The details reveal authentication issues... Yet it authenticated fine when adding the account.
What is going on? Does the azure account have to be the default account?
I managed to fix this by changing from the sourcetree embedded git to my system git Tools>Options>Git>Git Version>Select System. Afterwards when trying again it prompted me to login on my organization domain with 2 factor as if logging in on the devops web app directly.
My system Git is using manager-core for the credential management which is probably not the same system which the embedded version used.
I tried the above solutions (and more) but for me what in the end solved the problem was that the git-password I first wrongly entered when I tried to access the repo had been saved in Keychain (MacOS) and when I tried again this password was used without giving me the option to type it in again. I deleted the password to the Azure DevOps project in Keychain and then got prompted to enter the password again whereafter I pasted the Personal Access Token (!!) generated in Azure Devops and it finally worked!
It could happen when you entered wrong credentials and you don't get asked again, try this:
Go to : Sourtree->Preferences->Advance (tab)
Under: "Default usernames for URLs which do not include one:" delete your wrong credentials.
Try accessing your repo again with right credentials.
This is not the issue which caused by Azure devops. No matter https://xxx.visualstudio.com, or the URL which like dev.azure.com, they should all available git source.
For me, I just try with multi different git URLs, and found the few of URLs are failed with same error with you. But it prompt This is a git repository after I exit the SourceTree and re-configure the clone with same URL which encountered the error previously.
This seems be the most common Sourcetree problem which encountered by many users, not just the URL of azure devops that you occurred.
Check this thread, and try with its recommend way:
Open source tree, Tools -> Options -> Click on Git Tab -> Update
Embedded Git.
Or, consider the method I used: exit the Sourcetree, and re-configure the clone with same URL. (Not recommend since this can not permanently solve this issue)

How to use private packages in Azure Pipelines During CI/CD builds

I am using Azure CI/CD pipelines for Flutter build. In my Pubspec yaml file, I have dependencies that are private to my project and the code is hosted in same azure devops project but in different repository. During Build (i.e. Flutter Packages get) it gives me error saying Authentication failed?. I tried with PAT token where in prior to flutter build task i used git command to set that token, but it didn't solve the issue. Can anyone help me out?
I am open to being shown a better way but these are the steps I took to solve this issue a little while ago.
Assuming you are referencing the package in your pubspec.yaml using git over ssh on azure devops like:
repo_name:
git:
ref: 'tag or other identifier'
url: you#vs-ssh.visualstudio.com:v3/you/project/repo_name
Generate a new ssh key pair on your machine.
Upload the private key to the library secure files section on azure devops.
Add the install ssh key task to your azure pipelines build, using the key pair generated in the previous steps and referencing the private key uploaded to the secure files library. link
Upload the public key to your list of public keys. (This step I'm not 100% sure is necessary but I did it initially and things have worked so I haven't changed removed it)
So in my azure-pipelines.yaml the install ssh key step looks kinda like this where id_rsa is the name of the private key in my secure files.
- task: InstallSSHKey#0
inputs:
knownHostsEntry: 'vs-ssh.visualstudio.com, ...etc'
sshPublicKey: 'ssh-rsa ...etc'
sshKeySecureFile: id_rsa
A private feed is created with permissions such that only you have access.
The build agent run with user(build service account), give to this user permissions in the feed. From Feed settings->Permissions, assign your build service account owner permission.
Also verify the token is working, make sure you have selected sufficient scopes for this token to authorize for your specific tasks.
Besides try adding a variable system.debug with a value of true you’ll get more information in the failure. That might help pinpoint the problem.

Azure build pipeline with dependency on private AZ repo

We have an Angular project in an Azure repo that references another private Azure project/Repo in the packages.json file under dependencies. The project builds fine locally for all developers, but fails in the Azure Pipeline with Authentication failed. What is the correct way to pull code from a private Azure repo into another projects build pipeline?
I changed the access protocol from ssh to https and have done a lot of reading about how to accomplish this. I have read about the personal access tokens, but this doesn't seem like a good solution.
"core-js": "^2.5.4",
"xxx": "git+https://xxx#dev.azure.com/xxx/xxx#master",
"date-fns": "^1.30.1",
Note: The error is saying fatal: Authentication failed for 'https://dev.azure.com/..., which doesn't include the provided username in the dependency url.
Agree with yours. I also think that using PAT token is not a security way, because it does not expose the token exactly.
If you want to use SSH, you need first sure that the repos you want to install has a package.json at root.
And then, generate a pair of public/private key with the command: vssh-keygen -t rsa. After that, you can follow this doc: Use SSH key authentication to install them into your org.
Clone the repos with SSH, and this will make your client accept the fingerprint expressed by the server. Then, go repos page, get the SSH URI to cloning your repos and add it into the dependencies section of your package.json file:
"dependencies": {
"testproj": "git+ssh://account#ssh.visualstudio.com:v3/{org name}/{project name}/{repos name}"
}

Can't create project or add ssh key on Gitlab

I just created a CentOS 6.3 VM and followed these instructions for the gitlab install: http://howto.basjes.nl/linux/installing-gitlab-on-centos-6
I've tried this installation with both gitlab v3.01 and v2.91.
Here is what is working for me:
I can complete the gitlab install without problem
From the command-line, I can use passwordless authentication from the the gitlab service account to the gitolite service account
From the command-line, I can clone the gitolite-admin repo, make changes, and pushes the changes back to the remote repo
I can start the rails web app
I can login the web management site
I can create new accounts and login with the new accounts
Here's what I can't do:
I can't create projects (Repos)
I can't add ssh keys
I always get the same error:
GitLab was unable to access your Gitolite system.
In the githost.log log file, I get a less than useful error:
ERROR -> Timeout::Error execution expired
I've double checked permissions
Reviewed the gitlab.yml config file
Ran through the four suggested troubleshooting tips from the web page
Tried different versions of gitlab, but no matter what I do, I keep getting the same error.
I'm stuck because the logs don't tell me anything and I am able to access the gitolite repositories with the gitlab service account without issue. Anybody have any success with the most recent versions of CentOS/Gitlab/Gitolite? Any help would be much appreciated, thanks!
I know this is kind of late - but for completeness.
I've run into the same problem doing installation on recent Debian version.
It is, or was for me, caused by an old version of redis-server.