Had somewhat of a surprise today when IBM Support informed us that the issue our customer was experiencing could be due to unsupported characters in the password of the user mapped to the connectionsAdmin J2C alias. Say what!? But apparently there are restrictions on the different characters one can use. The password we were using had exclamation point (!) in it which is a no no. The customer is currently on WebSphere Application Server 184.108.40.206 and support suggested we try and upgrade to 220.127.116.11. Funny thing is that the customer has been using that password for years so it must have worked previously.
WebSphere Application Server 8.5.5 InfoCenter: Characters that are valid for user IDs and passwords
Today I extended the build script to monitor another branch so I now both deploy into our "bleeding edge" environment and our test environment.
The post-receive hook is written in bash and is as below. It took me a while to grok but a hook is simply a script that runs as the server OS user when ever something happens. The script is free to run as another user so my script runs as a special Git user so we can distinguish between which users does what. It also means that I could restrict access to feature/eventboard branch so it's only writable by this build user.
The only caveat about this hook was that we are using Atlassian Bitbucket which apparently only accepts hooks written in Java. There is however a way to add bash-based hooks directly in the file system on the server under /<bitbucket-home>/shared/data/repositories/<repoid> where the repoid can be found in the repository settings on the Bitbucket server if logged in as admin.
#!/bin/bash CHECKOUT_NAME=eventboard MERGE_INTO_BRANCH=feature/eventboard MONITOR_BRANCH1=feature/eventboard_web MONITOR_BRANCH2=feature/eventboard_backend WORKING_DIR=/local/stash-hooks-work while read oldrev newrev refname do branch=$(git rev-parse --symbolic --abbrev-ref $refname) echo "Currently on branch '$branch'" if [ "$MONITOR_BRANCH1" == "$branch" ] || [ "$MONITOR_BRANCH2" == "$branch" ]; then echo "Detected commit on $MONITOR_BRANCH1 or $MONITOR_BRANCH2 - merging..." if [ ! -d "$WORKING_DIR" ]; then mkdir -p $WORKING_DIR fi cd $WORKING_DIR unset GIT_DIR if [ ! -d "$CHECKOUT_NAME" ]; then # repo doesn't exit - abort echo "*** Required repo for post-receive hook not configured - exiting..." exit else cd $CHECKOUT_NAME git reset --hard git checkout $MERGE_INTO_BRANCH git pull origin $MERGE_INTO_BRANCH fi git fetch origin $MONITOR_BRANCH1:$MONITOR_BRANCH1 git fetch origin $MONITOR_BRANCH2:$MONITOR_BRANCH2 git merge $MONITOR_BRANCH1 $MONITOR_BRANCH2 -m "Merged \ '$MONITOR_BRANCH1' and '$MONITOR_BRANCH2' into \ '$MERGE_INTO_BRANCH'" git push origin $MERGE_INTO_BRANCH fi done