Not terminating but stopping cloud build agent - teamcity

TeamCity supports creating VMs in the cloud for running builds. It can also terminate instance after it is idle for defined period of time.
Is it possible not to terminate but shutdown the instance and to start it again when needed?

If your BA is a VM on Azure then I was able to achieve this by using Azure Automation account (There is a free version).
Basically, you trigger WebHooks for 2 runbooks you import from the gallery - StartAzureV2VM & StopAzureV2VM. The gallery can be found in "Automation Account-> Runbooks -> Browse Gallery"
Then on your TeamCity server you just periodically run some powershell which monitors the build queue on Teamcity and trigger appropriate webhook (with some timeouts etc.).
Here is the script I'm using, feel free to amend it to your needs:
https://gist.github.com/milanio/b300f23883afa9c6288f9365dfb98252

Related

How Can we Configure Camunda Process Engine in Golang?

I found links on process engine Configuration
https://docs.camunda.org/manual/7.16/reference/deployment-descriptors/tags/process-engine/
But how to use this in Golang?
You would not use the embedded process engine approach. Instead run a remote process engine and implement service tasks in Go using the external task patter. To get such a remote engine you can either just sign up for a free developer account on Camunda Cloud. If your prefer on premises, then you can use a self-managed deployment (e.g. via docker compose). For both options check here: https://camunda.com/get-started
Once you have an engine and configured credentials (follow https://docs.camunda.io/docs/guides/getting-started/).
The section https://docs.camunda.io/docs/guides/getting-started/implement-service-task/ shows how to configure the service task on the process engine side. On the Go side you can now implement an external worker (instead of zbctl in the example) as described here: https://github.com/camunda/zeebe/tree/main/clients/go

Deployment Pipeline and the file locks

As we are deploying to the already existing applications our files get locked.
How should we add the appofline file so the deployments can use that file and coordinate with VSTS pipeline ?
VSTS Pipeline
ERROR MESSAGE
2017-10-03T15:07:34.9492376Z Info: Updating file (xxx-xxxx-dev\xxx.xxx.Web.dll).
2017-10-03T15:07:37.8157267Z ##[error]Failed to deploy web package to App Service.
2017-10-03T15:07:37.8187261Z ##[warning]Try to deploy app service again with Rename locked files option selected.
2017-10-03T15:07:37.8187261Z ##[error]Error Code: ERROR_FILE_IN_USE
More Information: Web Deploy cannot modify the file 'xxx.xxxx.Web.dll' on the destination because it is locked by an external process. In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.
Error count: 1.
The Task App Offline option of Azure App Service Deploy task will take the app service offline, since it doesn’t work for you, you can stop or restart azure web app through Stop-AzureRMWebApp/Restart-AzureRmWebApp powershell through Azure PowerShell task or use "Azure App Service Manage" task and then deploy package through Azure App Service Deploy task.

AWS User data windows standard AMI

I'm trying to use codedeploy with autoscaling in order to automate the deployment of my application.
I have everything ready. When developing all the parts (hooks' scripts, roles etc) I installed the codedeploy agent manually. Now I want to make it production ready, which means that the codedeploy agent will be installed at sysprep (by providing the powershell commands via user data in launch configuration).
The problem is that it's not working. The script either runs and fails for some reason (are there any logs to confirm?) or it doesn't run at all. My AMI is based on a aws standard windows AMI. The EC2ConfigService is present.
Do you have any idea of what could be the problem or if I have some way to find what's the problem (logs)?
You could take a look at C:\Program Files\Amazon\Ec2ConfigService\Logs\Ec2ConfigLog.txt
On Linux AMIs you can also find the user data script execution logs in the ec2 console when you right click your instance -> Instance Settings -> Get System Log.

execute dashDB jobs from Workload Scheduler

I have created some stored procedures on my dashDB instance on Bluemix, to manipulate data in tables in the same instance.
I can run these from Data Studio and they work as intended.
Next, I created a process in Workflow Scheduler, which I provisions as a service in the same app, where the dashDB is also a service.
While creating the job step in the process, I noticed a message in the dialog window. I have attached a screen shot here:
http://i.stack.imgur.com/EI2b7.jpg
When I did try to run the process step from Workflow Scheduler, the process failed with a JDBC not found error.
I do realize that the Workflow agent I'm using is hosted on Bluemix, so I am puzzled how I can install the JDBC client there.
Should I be setting up an agent on a local machine outside of bluemix, in a hybrid mode?
Currently there are 2 possibilities:
Open a ticket to ask for a dedicated cloud agent and then download
the JDBC driver on the agent.
Download and install an agent on a VM or on-prem.
It looks like you have the incorrect value for "JDBC jar class path" the correct value is /home/wauser/utils/
I'm not sure why it is required that we put enter this but I was able to get the connection to dashDB working with this change.
JDBC jar class path: /home/wauser/utils/

Making gitolite trigger teamcity builds

Rather than having teamcity log onto the gitolite server several tens of thousands of times each day - and also sitting around waiting for the poll to happen (or starting it manually).
It would be nice if it was possible to set it up gitolite hooks that inform TeamCity that the repository has changed.
Is such a configuration possible with TeamCity and gitolite?
I know Jenkins has a github plugin that works nicely - I use that setup for some Minecraft CI I am running privately.
One way would be to gitolite (through a VREF hook) to call TeamCity through its REST API, in order to launch a build through web request.
You just need to make web request to the following URL:
http://YOURSERVER/httpAuth/action.html?add2Queue=btId
, where btId is build type Id – unique identifier for each build configuration.
To get it, you can just look for it in browser address bar, when clicking on build configuration, or use TeamCity REST API for details.
The OP Morten Nilsen didn't need a VREF:
add a file "post-receive" to .gitolite/hooks/common and
run gitolite setup --hooks-only

Resources