Teamcity tools create your k8s user - teamcity

What is tools in teamcity
All qa environment are now k8s
Local development and qa environment

Related

Cross Network CI/CD (Dev to Prod)

We are currently setting up CI/CD pipeline in an air-gapped environment. The DEV and PROD network are segregated on different VLAN network and sitting in between is an app-aware firewall which only allows authorized traffic to pass through to the PROD network. The CI sits in the DEV env while the CD tool sits in the PROD env.
What we have in DEV Network?
Code Commit -> CI Pipeline (Build) -> Artifact Uploaded to DEV Repo -> Approval Stage (if need to deploy to PROD) -> Push Artifact to PROD Repo -> Edit a random file on PROD code repo to trigger CD pipeline
What we have in PROD Network?
CD Pipeline -> Approval Stage to Deploy -> Deploy to Kubernetes/VMs
Questions
What is the best practice to trigger a CD flow to run after the artifact is pushed to the PROD artifact repo?
We currently perform a random code commit on a code repo on the PROD side just to trigger a CD pipeline to run and pull the PROD artifact for deployment. Is this considered a workaround or are there other recommended ways about this?

How to configure Azure-DevOps release pipeline task to kick off automated UI test scripts on xcode in MacBook?

I have setup the Build pipeline in Azure-DevOps to generate build of xcode automation project. For that, I have used Microsoft hosted MacOS agent on my macbook. Now, i want to setup release pipeline to kick off automated test scripts from TFS/Azure-DevOps Server on the same macBook? Not sure what are the configuration I need to use in release pipeline task. If someone has done this, could you please help me step-by-step?
Did you mean you want the automated test from azure devops to run against your local macBook.
If this is your intention. You may need to setup a self-hosted macOS agent on you local macBook.
Please check here to create a self-hosted agent.
And in the release pipeline, associate your release pipeline to the build artifacts from your build pipeline. Make sure the build artifacts include your test code.If not you may need to add a publish artifact task in your build pipeline to include your test code in the build artifacts which will be downloaded and used in release pipeline.
In your stage create an agent job with the agent pool set to your agent pool with your self-host agent. And add a xcode task to run your test. When you run the release pipeline the test will run on your local macBook.
Here is documents about how to build, test and deploy with xcode. Hope you find above helpful.

Setting up CI/CD for an AWS CDK app using AWS CodeBuild/Deploy/Pipeline

I'm trying to setup a CI/CD pipeline for a dotnet app which uses AWS Lambda and AWS CDK for infrastructure. The source is on github and we have a Jenkins pipeline which runs the tests and publishes the artifacts. I want to use the artifact and deploy (or better use Code Deploy)
Can I use CodePipeline to run cdk deploy?
How can I use CodeDeploy to do a dotnet test and dotnet publish? and then pass on the artifact to CodePipeline
CodePipeline is a workflow service, it by itself cannot execute any commands. What you need is a Build/Test service like CodeBuild and/or Jenkins as part of the CodePipeline. This is where you will run the commands like 'cdk deploy', 'dotnet test' and 'dotnet publish'.
Once the Deployment artifacts are ready in the Build environment (using the aforementioned commands), the next CodePipeline Stage can use them to deploy - this is where a Service like CodeDeploy will be used.
CodePipeline is just orchestrating the workflow between the building block services like CodeCommit (Source), CodeBuild (Build/Test) and CodeDeploy (Deploy). There are many more integrations available.
Hope this helps.
There are example from AWS on this AWS CDK home page.
https://docs.aws.amazon.com/cdk/latest/guide/codepipeline_example.html
The working implementation on this using code commit is as below, it has screen shots and github link.
https://nikhilbhojcloud.blogspot.com/2019/08/code-pipeline-using-aws-cdk-for-lambda.html
Apart from this AWS CDK team is building CI/CD for CDK applications.
https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/app-delivery
You should use CodeBuild not CodeDeploy to do a dotnet test.
CodePipeline has three stages
Source
CodeBuild
CodeDeploy
For your use case github is the source. CodeBuild can be used to build/test your application. And CodeDeploy to deploy the build artifacts to your environment.
In order use codeBuild you must provide build specification reference.
follow the link for further more information like how to do it in codebuild.
https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html

Add maven capability to Team Services build agent

What's the correct way to setup maven on a Team Services Default build agent?
What I have done so far:
I have downloaded the agent on a virtual machine
I have manually installed java and maven on that machine (C:\Java\jdk1.8.0_101 resp C:\Java\maven\apache-maven-3.3.9)
I have added a few environment variables (maven, MAVEN_HOME, M2_HOME)
after that I install the agent using the powershel script .\config.cmd
The agent gets succesfully registered in my visualstudio.com environment, but the maven capability does not get picked up:
After reading several other posts, I manually added the "maven" capability to the agent:
After all this I can start a build that requires maven. But unfortunately the build fails:
How do I get maven to work properly on my default build agent? I cannot find a solution in the MS documentation.
To answer my own question. The mistake that I made was that I created the environment variables as user variables instead of system variables. To sum things up, here's what's needed:
download the agent on a virtual machine
installed java and maven on that machine
add SYSTEM environment variables M2_HOME and JAVA_HOME
install the agent using the powershel script .\config.cmd
Download the agent on a virtual machine
Install java and maven on that machine add SYSTEM environment variables M2_HOME and JAVA_HOME
Run 'path' in command prompt and ensure that the maven installation directory is listed.
Ensure the maven is installed in 'C:\Program Files\Maven'.
Install the agent using the powershel script .\config.cmd.
Restart server or Update agent from Devops Portal.
In my case I have installed in C drive on root and getting error.

Adding MSBuild Community Tasks as an Agent Requirement

My build script depends on the MSBuild Community Task targets. I'd like to make this an agent requirement. How can this be done in TeamCity 8.x?
What you can do is add an Agent Requirement (Step 8 of your build Configuration)
Now immediately after doing this your build agent will be incompatible - that is because there is no such environment variable as MSBuildCommunityTasksPath - I've made this up because Community Tasks does not install any.
The next thing you need to do is log into the build agent PCs that do have Community Tasks installed and add this environment variable:
the path should be either
C:\Program Files (x86)\MSBuild\MSBuildCommunityTasks
or
C:\Program Files\MSBuild\MSBuildCommunityTasks
nb techincally it doesnt matter what you enter as this variable is just a flag indicating community tasks is installed
after you do this you need to restart your build agent
Now this paramter will be available in TeamCity and your build agent should be compatible. You can go to the Agents tab to check this. Agents -> <your agent> -> Agent parameters -> Environment Variables

Resources