I have been doing a little research on the Jenkins Configuration as Code (JCasC) plugin and I must say I think it’s definitely a step in the right direction.
In theory, with this plugin, you can have the majority of your Jenkins configuration stored in 1 file. This file can then be put in source control, which would allow you to easily rebuild your Jenkins instance at anytime.
However, while playing around with the plugin, a couple things came to my mind.
- It was hard for me to determine the correct syntax that needed to go into my jenkins.yaml file. There are examples located here, but these weren’t enough for me to get moving quickly.
- Long term, it could be a bit cumbersome to make all changes in the yaml file correctly, then re-apply to Jenkins instances.
- If the examples and plugin mature more, this is surely a easy way for teams to fail-safe\share their Jenkins configuration
- Fixing or growing the jenkins.yaml export functionality would greatly help. This would essentially allow you to apply Jenkins changes manually, then export to see the correct yaml syntax.
Anyways – This is a cool plugin that I am surely looking forward to using in the future!
I ran into a little issue today parsing a S3 SQS event that was sent to Lambda via a SQS trigger. I assumed the incoming event to Lambda was 100% of type dict. Given this, I assumed I could pull the bucket name and key using this syntax.
bucketname = event['Records']['body']['Records']['s3']['bucket']['name']
objectname = event['Records']['body']['Records']['s3']['object']['key']
As it turns out the incoming event is not 100% of type dict and I got the following error.
string indices must be integers
The Records after the body ([‘Records’][‘body’]) are of type str. Below is the updated code to pull the bucket name and key from the incoming event.
event_body_records_string = event['Records']['body']
event_body_records_dict = json.loads(event_body_records_string)
bucketname = event_body_records_dict['Records']['s3']['bucaket']['name']
objectname = event_body_records_dict['Records']['s3']['object']['key']
Now everything works out great!!!
I tried to install the Slate python package via PIP today. No good, I ran into the following error.
- Command “python setup.py egg_info” failed with error code 1 in…
The work-around was to bypass https://pypi.org/ and install directly from guthub.
Great link that explains how to grab InstanceId from a AWS CLI query when filtering by tag info!!! Huge time saver!!!
When using the “receive_message” Python Boto function to pull message(s) from a SQS queue, you will always get a response back when the command completes. However, how do you determine if the response you got back actually contains a valid message?
response = sqs.receive_message
if 'Messages' in response:
print("Message on the queue to process")
print("No messages on the queue to process")
Thats about it!!
Remember when it was announced that the Selenium IDE would stop working with FireFox 55+?
This was a little bit sad as its such an easy tool to use. However, now there is a version that supports Firefox 56+. (Download)
Looking to speed up your builds by running your Junit tests in parallel with Ant? With Ant 1.9.4, the Junit task now supports the “threads” attribute. The default value is “1”, but can optionally be changed to the number of test threads desired that will be used for parallel test execution.
Note, when using this new attribute, you must set your “forkmode” equal to “perTest” and if you are upgrading to 1.10.x, Java 8 run-time is required.