Spinnaker Deploying the last build from Jenkins - spinnaker

I am using Spinnaker with Jenkins. When creating a server group we have to specify the image which needs to be deployed. But my jenkins job creates an image which I want to deploy using Spinnaker. My jenkins Job number is the tag. but I am not able to find a way to mention the tag dynamically. I am able to figure out that the build number is available in parameter "context.buildInfo.number" but to use this as tag number is something which I am not able to figure out.
Thanks in advance
Amol

Just for an update I was able to resolve the problem by creating a trigger for DockerRegistry. Now one of my Pipeline Starts the Job and pushes the build to DockerRegistry. And another pipeline to monitor the images from there. It can pickup the latest build from the registry and deploy that.

Related

Deployment from within IntelliJ IDEA

Deployments from IDEA are possible, e.g. I can connect to remote server and I can upload a package. The deployment process I have involves a little bit more than just deploying a file on server.
Once the file is uploaded I need to run certain commands to complete the deployment which mean I need to connect to the server and run those commands one by one and I am looking to do that through one click from the IntelliJ IDEA.
Is that possible?
This is how the project directory looks like:
This is how I am trying to setup deployment:
if you click on that little "Fix" button that's what I see
Even if I try to remove the unwanted entries they come back and never go away.
Finally this is what my project structure looks like in idea
Yes, you can use Remote SSH External tools. Make a script that will run your commands, deploy it to the server as well, then run this script remotely via a tool.
In the Run/Debug configuration Before Launch steps you can add your remote external tool to run automatically.
You can find some more details in my another answer.

How do I start an Amazon EC2 VM from a saved AMI using Jenkins?

I'm trying to create a Jenkins job to spin up a VM on Amazon EC2 based on an AMI that I currently have saved. I've done my searching and can't find an easy way to do this other than through Amazon's GUI. This isn't very ideal as there are a lot of manual steps involved and it's time-consuming.
If anyone's had any luck doing this or could point me in the right direction that would be great.
Cheers,
Darwin
Unless I'm misunderstanding the question this should be possible using the cli, assuming you can install and configure the cli on your jenkins server you can just run the command as a shell script as part of the build.
Create an instance with CLI.
The command would be something along the lines of:
[path to cli]/aws ec2 run-instances --image-id ami-xyz
If your setup is too complicated for a single cli command, I would recommend creating a simple cloudformation template.
If you are unable to install the cli, you could use any number of sdk's e.g. java to make a simple application you could run with jenkins.
There is the Jenkins EC2 Plugin
Looking at the document it looks like you may be able to reuse your AMI. If not, you can configure it with an init script
Next, configure AMIs that you want to launch. For this, you need to
find the AMI IDs for the OS of your choice. ElasticFox is a good tool
for doing that, but there are a number of other ways to do it. Jenkins
can work with any Unix AMIs. If using an Ubuntu EC2 or UEC AMI you
need to fill out the rootCommandPrefix and remoteAdmin fields under
'advanced'. Windows is currently unsupported.

Automatic Jenkins deployment

I want to be able to automate Jenkins server installation using a script.
I want, given Jenkins release version and a list of {(plugin,version)}, to run a script that will deploy me a new jenkins server and start it using Jetty or Tomcat.
It sounds like a common thing to do (in need to replicate Jenkins master enviroment or create a clean one). Do you know what's the best practice in this case?
Searching Google only gives me examples of how to deploy products with Jenkins but I want to actually deploy Jenkins.
Thanks!
this may require some additional setup at the beginning but perhaps could save you time in the long run. You could use a product called puppet (puppetlabs.com) to automatically trigger the script when you want. I'm basically using that to trigger build outs of my development environments. As I find new things that need to be modified, I simply update my puppet modules and don't need to worry about what needs to be done to recreate the environments through testing for the next go round.

How to combine several run configurations in IntelliJ together?

I have an IntelliJ project with several modules. Some of the modules should be run as servers. For every server (module), I have a run configuration.
Can I bundle those run configurations together, so I don't need to click run or stop five times?
If it matters, the project is fully mavenized.
The previously accepted answer does not work for running multiple servers or any scripts which do not terminate. However, now you can use the Compound run configuration to execute multiple non-terminating servers simultaneously. It looks like this:
Steps to get it working:
Create the individual run configurations
Create a new compound configuration
Choose the desired individual run configurations.
Run the new Compound configuration.
Go to the intellij documentation.
All the individual configs will run simultaneously - perfect for servers and other threads which do not exit!
NOTE: Even the MultiRun plugin recommends using Compound on their GitHub page.
More info in the IDEA documentation.
Update
This now is possible (despite the fact that the issues #CrazyCoder linked to are still open as of this date). In Intellij 12, you can "Run Another Configuration" before launch when you're in "Edit Configurations". Here's a screenshot:
Check out this Multirun plugin.
And yes, I found it following CrazyCoder's link, so props to him again!
I found that 'Compound' sorted all modules alphabetically and launched them in that order. This could be a problem if there are modules with dependencies. If there is a way to override that sorting, I could not find it.
I am using the paid version of IntelliJ 2020.2
I wanted a simple thing - Start my Spring Boot application and then start my Angular application. I tried the 'Run Another Configuration' way and it did not work. I faced the same issue as faced by #AxelFontaine.
The Multirun plugin solved my problem. I did have to restart the IDE twice - once to update it after plugin installed and the second time because there was an error saving some configuration. But since then its working just as expected. This is very helpful as I can work on the UI and see the changes immediately and similarly the Spring dev tools lets me change code and it reloads immediately. This plugin is very very helpful.

Getting Build URi or Build number of the last build from MSBuild

I am trying to create a custom task for MSBuild so that it will send an email to the users that sais that a new version is up on the test server.
I go the email part done, what i would like to do is add the work items that are included in this build.
I tried the MSBuild extention (used to send the email) but the feature to get that info is not supporte don TFS 2005 wich is what i am using and cannot upgrade.
I was trying to use BuildStore.GetWorkItemsForBuild but i need a builduri which i cannot find a way to get.
The setup is like this, the steps to compile, build and deploy are called from a batch file as diffrent options. At the end of the deploy option, the email is sent.
Anyone can help me on this?
It's feasible but it seems your'e trying to stretch MSBuild functionality for tasks that related to build management.
Consider a solution like TeamCity that wraps for you all the build processes and manage notifications (i.e. when build has succeed or failed). It has out-of-the-box support for MSBuild.