martes, 15 de agosto de 2017

Converting Java to native code with GCJ

I recently discovered the power of gcc in order to create native executables from Java source code. You never know when are you going to need it, but just in case, is good to know that is there:
gcj -c -g -O MyJavaProg.java
gcj --main=MyJavaProg -o MyJavaProg MyJavaProg.o

Jenkins Pipelines.

Hey!!! I know it has been a while since my last post. It has been a very busy period in my life but now I wanted to take back my good habits and start writing posts related with software and infrastructure. Today I will start with Jenkins (the most usefull tool I have found in these days).
pipeline{
    agent any
    stages{
        stage ('logic artifact build'){
            steps{
                echo 'Fase I construyendo artefacto aplicacion'
                echo params.BRANCH
                build job: 'XXXXXX', parameters: [string(name: 'BRANCH', value: params.BRANCH)]
            }
        }
        stage ('build web app'){
            steps{
                echo 'Fase II construiyendo el Web'
                echo params.BRANCH
                build job: 'XXXXXX', parameters: [string(name: 'PARAM_BRANCH', value: params.BRANCH)]
            }
        }
        stage ('resource assembly'){
            steps{
                build 'APACHE_CONFIG'
                build 'PACKAGE_ZIP'
            }    
        }
        
    }
    post{
    always{
        echo 'Pipeline finished'
        echo params.BRANCH
    }
    success{
       echo 'Build was success'
    }
    failure{
       echo 'Build failed'
    }
  }
    
}
This DSL is a very basic PIPELINE job that can handle the construction, resource assembly, and deployment of the application. It's important to give your jobs parameters like branch, environment, etc... so you don't have to have a job for every environment.