This is part of my automated build series. The aim is to automate a lot of the Cordova Background Service plugin process.
In this final part of the series I will be adding two further Jenkins to make upload to my GitHub repositories nice and easy.
I have two GitHub repositories to update:
I'm creating two further jobs. Each will download the contents of the relevant GitHub respository then sync in any changes.
I'll add these two jobs then to the master job created in the last post.
This will leave me with two folders which I manually push up to GitHub (see below).
For this part, I'll be using the following tools:
I only want to upload to GitHub changes I've made. So I have a Powershell script which will run through the downloaded copy of GitHub, compare with the files created by this process and copy in any new or updated files.
Note that I have to perform specific logic for jar files. Jars include a timestamp every time it is compiled - thus doing a file comparison will always show a difference even if the underlying code hasn't changed. To do this, I extract the contents of the jar then test the contents.
I've saved this as a separate file to make usage easier.
To create the job:
Add a Windows Powershell script to rename the version specific plugin from .txt to .java (I store them as .txt in my build projects to avoid conflicts):
Add a Windows Powershell script to sync up the source code changes
And save the project
To create the job:
Add a Windows Powershell script to sync up the source code changes
And save the project
Now we add the following to the end of the "BackgroundServicePlugin Build All" job:
Ok. So this gives me an automated build, test and prepare. After about 45 minutes I've got code ready to push.
All I do then is to drop into the folders separately using Git bash and run:
And that's it.
The automating has really helped me other the past few weeks with compiling new versions, fixing bugs and adding additional features.
If anyone has some advice on how to improve then I'd love to hear it.