Jenkins job generator - plugins

On a project Im working on we have a pretty advanced command-line interface to build, test, package and deploy software.
Now we want to use jenkins as a front-end to this CLI and we want to be able to generate job configurations. We want the interface simple, the user only supply a couple of parameters and jenkins will then query our CLI and generate the needed build steps.
Simple use case:
Create new domain-specific-job
Select Product
Jenkins now queries the CLI and updates the next drop-down with the products different brances.
Select branch
Jenkins generates the build steps by querying the build steps
As Im new to plugin development in Jenkins (and jenkins overall) I would love to get some tips and pointers to where to start.

There are several plugins to generate jobs in Jenkins, there is also the Jenkins CLI.
I think the better approach would be to use the Jenkins CLI to generate Jobs from the outside by developing a cool GUI tool integrating both CLIs nicely.
Here is an example: http://tikalk.com/alm/using-jenkins-cli-job-gen
If you really require to do it in the Jenkins front-end then here are some pointers on possible plugins:
job DSL plugin https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin
jobcopy builder plugin https://wiki.jenkins-ci.org/display/JENKINS/Jobcopy+Builder+plugin
job generator plugin https://wiki.jenkins-ci.org/display/JENKINS/Job+Generator+Plugin

Take a look at jenkins-job-builder from jenkins, it could help you to abstract your work and use command line to create the jenkins jobs.

Related

Can I Integrate Web Tests (written in visual studio) in Azure Devops build pipeline

I have a web api (REST) project that is written in .NET and I have written a few webtests (.webtest) that test those apis.
While those tests run fine locally from visual studio, I want to integrate them into my VSTS (Azure Devops) build pipeline, so as to identify and breaking changes that could break any of those APIs.
I am not able to find any task in build pipeline which can run the webtests as part of build. I see option for running unit-tests though.
So, wanted to check what am I missing here.
You might want to find an alternative approach as this link implies it has been deprecated.
Visual Studio web performance test (.webtest file) is tied to the load
test functionality and is deprecated. Some customers have used
.webtest for other purposes such as running API tests, even though it
was not designed for that purpose. Many API testing alternatives are
available in the market. SOAP UI is a free, open source alternative to
consider, and is also available as a commercial option with additional
capabilities.
You could try to use cmd task command line to run MSTest with arguments.
Add Run Command Line step/task to execute MSTest command
Add Publish Test Results step/task
On the other hand, you can do test in Unit Test too, just send the request and check the response, related thread.
Also as Matt mentioned, since Visual Studio web performance tests (.webtest files) are tied to the load test functionality and is also deprecated. You could take a look at this blog here: Cloud-based load testing service end of life

Deploy + desktop application + TFS 2017

I have a winForm application. I want to install it on the server every time the CI/CD happens. Later, after I install it(i don't know how to automate installation as well.), I want to run UI tests on it. What task should I add to my release management?
I only found web deployment when I researched. Since, mine is a desktop application, I need different build/release task. I could do it from vs2017(by right click project + publish)
I want similar one from TFS 2017.
You can try to build with the publish profile. See Publish profile.
In TFS using VS Build step with the MSBuild Arguments something like below:
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(Build.StagingDirectory)\\" /p:PublishProfile="YourPbulishProfile"
You can reference this article : Using Web Deploy in Visual Studio Team Services Release Management
To run coded UI tests from TFS.
Firstly, you need to run your agent as an interactive process. Regarding how to deploy an agent on windows, please refer to this link.
Secondly, add your coded UI tests project into TFS version control.
Last, create a build definition to use Visual Studio Test Agent Deployment task and Run Functional Tests task to run the tests.
Reference below articles:
Continuous integration, test, and deployment tutorial
Deploy a Desktop App from TFS to VM for Coded UI Test.
I found a way to publish my desktop application on to the server. below is the article which explains the build tasks needed.
Click here

MSDeploy/web deploy/publish using Gulp in Visual Studio Code

I've switched to using Visual Studio Code and and am missing the ability to right-click and publish files.
I read here that a task runner can be used to build/deploy files...
Publish Web Deploy using VS Code
That answer only mentions Grunt and I cannot find any articles on how to do this with Gulp which I am already using. I've got as far as finding an article on how to hook up Gulp and MSbuild which I assume must be the first step.
However, I'm unsure about the deployment step as I don't know what the "publish" button in standard VS does. It seems to be using something called MSDeploy or "web deploy" and requires a bunch of publish settings, so presumably this can be done from gulp?
I know I must sound a bit clueless but I'm not really a Microsoft guy I'm a front-ender, just happen to be working with other people's .net projects occasionally. Any help would really be appreciated.
WebDeploy is the technology that VisualStudio uses for web deployments. WebDeploy uses MSDeploy behind the scenes. MSDeploy is capable of far more than just web app deployments. We use it for deploying Windows Services, Scheduled Tasks and SQL databases as well.
Here are details on you to use the MSDeploy commandline. The sync command is used most commonly for deployments.
You can use the gulp-mswebdeploy-package plugin to create a web deploy package as part of you gulp build task. you can the use the msdeploy command line to deploy the site.

Deploying Golang Applications to AWS OPSWORKS

Over the last few months I've become familiar with the AWS OpsWorks deployment process as it pertain to Node.js - deployment for Go seems to be another animal.
From what I've gathered, this is what I need to compile a successful Go deployment:
Install go on the EC2 box
Pull the private repository from GitHub
Pull in all dependencies
Compile the main package for the box's arch
Start the binary with a couple of flags that I use
Everywhere I have read seems to tout the ease of Go deployments because dependencies are included in the binary, but that seems to imply that you are compiling the application in your development environment and pushing that up to the cloud. This doesn't seem like a process that works well across a development team.
https://github.com/crowdmob/chef-golang-web-server-cookbook
I have been attempting to get the Chef Scripts from CrowdMob working, but to no avail. I continue to get errors that look like this:
[2014-08-01T16:08:22+00:00] WARN: Cookbook 'templates' is empty or entirely chefignored at /opt/aws/opsworks/current/merged-cookbooks/templates
What is the proper way to deal with dependencies during deployment?
Are there any established practices for deploying Go onto AWS with Chef?
Use a continuous integration service like CircleCi, Travis or your own setup Jenkins.
On the Continuous integration service then
Add a github post commit hook .
Test / Build the binary
Create the zip file as artifact
At this point you can create an new version on Elastic Beanstalk using the AWS commandline and the zip file created from this version.
venv/bin/aws elasticbeanstalk create-application-version ...
Then just select which version to deploy from the EB dashboard.
For simple services using Chef is overkill IMHO. Docker offers a simple workflow.
Use the Docker container option and then use elastic beanstalk's command-line client to initialize your environment in the project root directory and then you can simply do a 'git aws.push' from the same place.
With the correctly configured Dockerfile in your project and pushed to eb, the EBS' docker container app will pull the correct image with golang installed, then do a go get on your projects dependencies, and then compile and run your app. It sounds way more complicated but it's actually very easy.
Below is a link to a video walkthrough I did for running a simple golang webapp on EBS. The method for uploading the project does not use git. Instead, I zip it up and upload it, but the git method is recommended (and I do it) for automating deployment.
YouTube: How to run a go web app on Amazon's Elastic Beanstalk
I also had some problems to setup a good building process with Elastic Beanstalk and Go.. I don't want to use Docker, and all the people seems to be going on this direction.. so.. you can take a look at this project: https://github.com/battle-arena/heimdall
There you will find a custom setup using the Buildfile and the Procfile.. and I rely on a CI system to build the release package...
Basically I do the following:
Hook the commits to a CI system
On the CI system I run the test and the install.sh if all good
The install.sh will create a build folder and a structure that will be sended to the Elastic Beanstalk with the aws-cli tool
After send to the EB the Buildfile will run the build.sh that will basically extract the compressed package with the proper structure, and run a go get ./... and go build
The Procfile will run the generated binary
I think the result is pretty good, and you can use with any CI tool.

Continuous Deployment with TeamCity

I recently set up a CI server in TeamCity and now want to take it to the next step, continuous deployment. Basically, we host a suite of restful services and about 3 web applications for each one of our customers. All customers get 3 environments QA, UAT and Prod. We want to be able to automatically deploy our builds once our tests pass. I'm not looking for custom scripting options to do this. I've seen plenty of those of SO. What we're looking for is a solutions like UDeploy but at a lower price point. Is anyone aware of alternatives to UDeploy? Or other Continuous Deployment plugins that work with TeamCity?
Thanks,
I agree with #Niklas Ringdahl -- I think you're thinking about it wrong.
You can deploy directly from TeamCity using MS WebDeploy.
See Troy Hunt's excellent blog series about this:
Part 1: Config transforms
Part 2: MS Build and deployable packages
Part 3: Publishing with WebDeploy
Part 4: Continuous builds with TeamCity
Part 5: WebDeploy with TeamCity
If this is .net you should look at Octopus, it now works nicely with TeamCity.
http://www.octopusdeploy.com/
http://www.paulstovell.com/octopus/octopus-octopack-and-teamcity
I don't know if there's any part of this I don't understand, but I would use TeamCity for that also.
If you have a build configuration to manage your tests, you can easily create configurations for deploy, which are triggered by the success of the test configuration. We handle lots of our deploys that way.
Again, sorry if I'm missing something here...
EDIT:
A build configuration in TeamCity can be triggered when another configuration is successfully built:
Build triggering in JetBrains documentation (Look at "Finish Build trigger")
Or you could use one build configuration with many "Build steps":
Build steps in JetBrains documentation
Each step is run in order, and only if the previous step is successful.
Another alternative: RedGate has recently updated pricing on their Deployment manager tool: http://www.red-gate.com/delivery/deployment-manager/
If you have 5 projects or less, the tool appears to be free.
I'm familiar with Nolio ASAP but have no knowledge about its pricing:
http://www.noliosoft.com/product/nolio-automation-center
As a developer for the product, I'll add BuildMaster to the list of options here. Basically, you can run a basic tutorial to get started deploying from TeamCity (http://inedo.com/buildmaster/extensions/teamcity), then customize your deployment plans to any further environments as needed.