How to create a CI/CD pipeline for deployment on physical server - deployment

I have multiple servers installed at client site. I can access all of them via anydesk. I have python project running on them. All of the source code is in azure devops. I want to create a CI CD pipeline so that whenever we merge pull request to main branch, it should automatically be deployed on client's server.
Previously, I have worked on many web API's which was deployed on azure. We had branches created for each client and whenever we merge changes into those clients branch, it automatically used to start deployment on API as our repo and branch was linked to web API.
To deploy the new code changes on server, I have to follow manual way of first logging into the client server via anydesk and then perform the git pull to pull the required changes. This is very manual thing and we sometime do mistake in it. I am looking for a way to connect the client server with the branch of the repo so that once we merge our changes to that branch, it should automatically deploy the changes. Is there any way we can do it? Is there any tool/service available for this. All the client server are Ubuntu machines. Please give some suggestions. Thanks

Related

Sending a file to multiple servers

I'm working on a web project(built with the .Net framework) on a remote windows server, and this project is connected to a database my SQL server management studio, now on multiple other remote windows servers exist the same web project linked to the same database, now I change a page's code in my project or add/remove a table or stored procedure in my database, is there a way(or an already existing software) which will my to deploy the changes that I made to all the others(or to choose multiple servers if I don't want to deploy the changes to all of them)?
If it were me, I would stand up a git server somewhere (cloud or local vm), make a branch called something like Prod or Stable, and create a script (powershell if the servers are windows, bash on anything else) on a nightly or hourly job to pull from that branch. Only push to that branch after testing thoroughly. If your code requires compilation, you have the choice to compile once before committing (in which case you're probably going to commit to releases), or on each endpoint after the pull. I would have the script that does the pull also compile and restart the service (only if there was something new in the pull).
You can probably achieve this by following two things :
Create a separate publishing profile for each server.
Use git/vsts branches to keep the code separate. (as suggested by #memtha).
Let's say you have total 6 servers and two branches A and B. So, you'll have to create 6 publishing profiles. Then, you can choose which branch to deploy where. e.g. you can deploy branch B on server 1,3 and 4.
For the codebase you could use Git Hooks.
https://gist.github.com/noelboss/3fe13927025b89757f8fb12e9066f2fa
And for the database, maybe you could use migrations or something similar. You will need to provide more info about your database, do you store your database across multiple servers etc.
If the same web project is connecting to the same database and the database changes, I suspect you would need to update all the web apps to ensure the database changes don't break any of the apps and to keep all the apps updated to prevent any being left behind.
You should look at using Azure Devops to build and deploy your apps and update the database.
If you use Entity Framework, you can run the migrations on startup and have the application update the database when deployed manually or automatically using devops.
To maintain the software updated in multiple server you could use Git with hooks, post-receive hook is what you need.
The idea is to use one server as your Remote Repository and here configure the post-receive hook to update the codebase in the same server and the others.

Circle ci trigger a build on pull request creation or update

We are usng circle ci and github.
So i have a remote k8 cluster for staging, on which we have our test suite.
I have a project on github, and id like to deploy and run the tests on the cluster everytime a pull request is created or updated. The reason for doing it on pull requests is that we wwant to merge the feature branch with master and then run the tests on the rmeote testing cluster:
I have read a few articles, but nothing that explains to me how this could be achieved.
Github web hooks calling circle ci on pull request creation or update?
Build status based on the result of remote testing?
Not currently possible on CircleCI, they do not expose all the payload from a github.
its on their todo list
Yes it is possible now, just don't specify any branch and it will trigger on every pull requests creation or update.

VS Team Services trigger option on build pipeline for external git repository

I have a unauthenticated (in vsts) external git repository that works in an local agent pool (who is auth) that is external too. Our build pipepline is the connection with our certificates that does this solution work.
The problem here is that there is no possibility to trigger automatically when someone push some changes on the master branch on this external unauthenticated (in vsts) git repository.
For this trigger option, there is only this configuration:
But after this, if someone push an commit, nothing happen.
Is there a limitation? Any configuration that I need to get this working? At now, it's always done manually to stat the build pipeline.
For the continuous integration with External Git, VSTS will connect to your external repository and check if there is new changes by the polling interval time you set. So you must configure the authentication in VSTS so that VSTS can access to your Git Repository to query new changes. When you configure the external git repository, it should ask you to provide user and password/token, enter the auth information there.

Github - Octopus Deploy Integration

Basically i have the following scenario that i need to solve:
On a schedule basis, OctopusDeploy is pulling the latest releases from code repo using GitHub Feed and then perform some operation through the tentacle agent on another server.
Problem:
Currently we have to trigger a release in Github manually whenever there is changes to the repo so that Octopus Deploy can pick up new changes. Is there a way to trigger the release in GitHub automatically whenever there is a merged event to the master.
Thanks.
I’m going to guess that you don’t want to expose your Octopus Deploy instance to the internet... so how about use reoccurring scheduled deployments?
https://octopus.com/blog/octopus-release-2018.4#recurring-scheduled-deployments
Currently we have to trigger a release in GitHub manually whenever there is changes to the repo so that Octopus Deploy can pick up new changes.
Is there a way to trigger the release in GitHub automatically whenever there is a merged event to the master.
First, since March 2022 (4 years later):
Octopus Deploy is now a GitHub secret scanning partner
GitHub secret scanning protects users by searching repositories for known types of secrets.
By identifying and flagging these secrets we help protect users from data leaks and fraud associated with exposed data.
We have partnered with Octopus Deploy to scan for access tokens for their cloud-hosted product, Octopus Cloud.
Octopus API keys allow users to perform tasks like creating and deploying releases. We'll forward access tokens found in public repositories to Octopus Deploy, who will notify the affected user via email
In that new context:
no need for an external private Octopus Deploy
The check would be done for any new commit
But this is limited to secret scanning, so it might not do everything you were doing in your case.

Automatic deployment to Restcomm

I'm setting up a Restcomm instance and I would like to integrate it with Jenkins, so each time we have a PR in github in a specific branch, Jenkins will deploy the RVD App to the Restcomm instance.
I have access to the RVD Workspace from Jenkins, so I guess I could have something like:
Developer create/update her RVD app in local.
She copies the APP from her workspace to a github repo and creates the PR.
Jenkins updates the remote RVD workspace copying/updating the new files / app.
I guess this would be work but I don't like to copy files from one workspace to another one because of inconsistencies and so on.
I would prefer something like:
Developer updates the APP source in github and creates a PR.
Jenkins packages the app (zip?) and invokes a Restcomm API to deploy it / update it.
Is it possible? Any documentation about that API?
We have an open issue for that (providing an API) at https://github.com/RestComm/Restcomm-Connect/issues/947. Would you be interested in contributing to move it forward faster ?