automatic build and deploy fails with build failure on jazzhub - eclipse

I am trying to use the feature of jazzhub (IBM DevOps offerings) of automatically build and deploy on Bluemix. I have used Eclipse plugin for Jazzhub to check in my code to my project. However automatic build always fails with the below type of error.
using .gitcredentials to set credentials
Checking out Revision a0b1e7c78b02e82ad210bc369cdd633212cb544f (origin/master)
First time build. Skipping changelog.
[47f4a135-016e-4a75-bb42-f9a9fda6df05] $ /bin/bash /tmp/hudson3124921405781328608.sh
Buildfile: build.xml does not exist!
Build failed
Build step 'Execute shell' marked build as failure
Connecting to https://P90JEN01.sl.jazz.net:9444*
I am able to build and deploy the same code base from Eclipse directly to bluemix. My understanding is that DevOps service create build.xml file automatically if It does not find one. The document says it
"A project relative path where the build scripts are found and executed. The project root will be used if empty. A default build script (e.g., Ant build.xml file or Grunt Gruntfile.js file) will be generated and delivered to your source control system if one is not found. You may need to edit the generated build script to fit your needs".
Can anyone help me here? how to get pass this error and make a build successfully deployed ?

I believe we may need to create build.xml if you are using ant script:
http://thoughtsoncloud.com/2014/10/create-deploy-stand-alone-java-application-ibm-bluemix/
"The next step is to create the script to build the code. In this example, I created an .ant script. You can write in the language of your choice from the options supported in Bluemix. Create a file named build.xml and write the .ant build script."

Related

Prevent a VS solution's project from being built by Appveyor

The .sln file in my GitHub repository has two projects -- a class library project, and a tests project. I only want AppVeyor to build the library project, because the tests project requires the Microsoft Access database engine to be installed.
I am using appveyor.yaml.
How can I do this?
You could switch from automatic msbuild mode to script mode, by adding a build_script section to your yaml config file. This might look something like this...
build_script:
- msbuild StringAsSql/StringAsSql.csproj /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
It's the same command AppVeyor would run automatically on your solution file.
There are a number of possible options here.
To disable tests, set the following in appveyor.yml:
tests: off
Or create a special build configuration (via the Visual Studio Configuration Manager...), say ReleaseCI, and specify the configuration in appveyor.yml:
configuration: ReleaseCI
Another option is to create multiple solution files; the UI for switching solutions is simpler (Solution Explorer -> Switch views...) than the UI for switching build configurations. To specify which .sln file should be passed to MSBuild:
build:
project: MySolution.sln

Using TFS Build to Deploy Console Application with Continuous Integration

I have a solution that contains a number of projects. Some MVC Web Applications, Some Class Libraries and some Console Applications.
For the Web Applications we simply used Publish Profiles and created TFS Builds referring to those profiles for building deployment packages. We then used those to deploy the web apps.
How can I configure the Build Definition to give me the same results for my console applications?
The desired result here is to try and work towards automatic deployments using TFS and Release Management.
Update:
Ok, It seems I need to explain myself better.
We use TFS (MSBuild) to build the project. By simply "checking in" the code, it triggers our build which builds the project and creates a nice Website_Package.zip file in the drop folder.
What I am looking for, is for MSBuild to do the same for my Console Application. ie. I want it to produce a "ConsoleApp_Package.zip" file and dump it into my drop folder.
You can use the Zip task from MSBuild Extension Pack at http://msbuildextensionpack.codeplex.com/.
See http://www.msbuildextensionpack.com/help/4.0.8.0/index.html for an example.
You should just build, using MSBuild task, filling the Project with your console app .csproj and leave MSBuild Arguments empty.
Then you use a Copy Files task to get your files from bin folder to staging directory.
Example:
Source Folder: \bin\$(BuildConfiguration)
Contents: **
Target Folder: $(Build.ArtifactStagingDirectory)
After that you can add task to zip the files from staging directory.

Call custom tool from TFS build

We are using TFS2010 for our web sites's builds and we're in the process of creating fully automated builds. At the moment the sites are built and deployed in remote servers.
The sites contains several configuration files that we would like to transform as part of the build. As there are some rules to create the correct config files we would like to use a custom tool for that purpose (.exe), not to use xml transformations for it.
From what we can see in the build template, MSBuild copies the files to a drop folder and then pushes them to the remote IIS site. We would like to hook our custom tool to this process and do the transformations in the build server before the site is published. The problem is that the MSBuild task is a single node in the build template and we can't find a place where to invoke our tool. Before the MSBuild step, there is no code deployed to the drop folder, after the MSBuild step the code was already deployed to the remote server.
Any ideas on how to plug the custom tool in the correct workflow step?
What is the msbuild target, that you use? I think you can define your own target in csproj file to do the following:
execute your custom tool against required files
run usual build target (or whatever target you normally use)
Edit
E.g. in a .csproj file you could define the following:
<Target Name="buildWithCustomTool">
<!-- Exec your custom tool -->
<Exec Command="your command" />
<!-- Call the build target which will run as normally -->
<CallTarget Targets="Build" />
</Target>
Hope it helps,
Ivan

How to trigger command after build?

Is there a way for maven to trigger system command after successful or unsuccessful build?
Right now I'm using external script to run mvn package, but I would like this feature integrated with maven process.
Maven supports pre and post scripts. See the accepted answer here. In your case it would be mavenrc_post.bat
You can easily do that by creating a file at /etc/mavenrc or
~/.mavenrc (Linux) or %HOME%\mavenrc_pre.bat (Windows) Maven executes
those on startup if they exist unless you've defined a variable named
MAVEN_SKIP_RC.

Using TFS, want to run a command line tool to perform obfuscation

First time using team explorer, and I want to add a build task that will run a command line tool to obfuscate the assembly. This will one of the last tasks to be performed I assume.
How would I go about doing this using Team Explorer?
We use Xenocode Postbuild. To obfuscate, we use a custom build task we wrote in a DLL that we call from the build configuration in TFS.
So we created a custom task that wraps the PostBuild command-line. We pass that task variables from an MSBUILD target. That target is part of the project file associated with our release build definition.