Setting up IBM Urbancode Deploy to work with Git

I wanted to try integrating  IBM UrbanCode Deploy with source-code management systems.  Git is a one of the source-code management system which is supported and since it is open source, I decided to give it a try . Git allows groups of people to work on the same documents (often code) at the same time, and without stepping on each other’s toes. It’s a distributed version control system. I had not used git before and hence spent some time exploring git.

Part1: Setting up account on Git Hub

This was simple 3 step process

1 . I started out by creating an account on GIT hub by providing userid and email .
2. Next I created a repository “Demo3-GIT” (https://github.com/snaik17/Demo3-GIT.git )
3.  Finally I also  set up GIT on my local machine

Part2: Working with Git:

I created a folder Demo3-GIT which would be my project
I set terminal prompt on Git Bash to  C:\DemoUCD\Demo3-GIT

1. To initialize a local Git repository in above location, I ran    git unitThis created  .git directory  (usually hidden) which had all sorts of directories and files inside it which are required  for GIT to funcion.

2.  Next I added a file “a.txt” in Demo3-GIT directory and I  run  git statusThis tells me there is a  new file is there.

3. I executeed git add a.txtwhich adds the file to staging area.

4. To commit changes from staging area and create a snapshot  and adding to time line I ran git commit -m "Adding a.txt"

5. Now to  push changes from local repo to the GitHub server I run following command git remote add origin https://github.com/snaik17/Demo3-GIT.git

https://github.com/snaik17/Demo3-GIT.git  is the URL for remote repository created in Part1

6. Next I  run  git push - u origin master
The name of our remote is origin and the default local branch name is master .
The -u tells Git to remember the parameters, so that next time we can simply run git pushand Git will know what to do.
Go ahead and push it!

Bang ran into issue fatal: could not read Username for 'https://github.com': No such file or directory

This was resolved by downloading git-credential-winstore.exe , and re-running the commands and they worked this time

git remote rm origin

gir remote add origin

git remote add origin https://github.com/snaik17/Demo3-GIT.git

git push - u origin master

7. You can now go to GitHub to check your changes .

In my case it was https://github.com/snaik17/Demo3-GIT and I  see a.txt is available on GitHub.

git3

With that we have working GIT setup, next let’s look at how IBM UrbanCode helps you to bring artifacts

Part3: IBM Urbancode Deploy to pull artifacts from Git

1. I added a component in IBM UrbanCode Deploy by navigating to  Home > Components > Create New Component.

I set options as below

git2

Once the component was added , I need to import version , these can be set to automatic or manual .

I go to Version tab and click on Import New  Versions ( incase of manual)

git4

You have your files in IBM Urbancode Deploy  – ready to go to the next level of deployment.

Advertisements

7 Comments

  1. chayan

    Hi..
    I am having the same scenarion with git and UCD….
    I have one question with your configuration….
    How you are talking to Github from UCD without any agent?
    if agent is there could you please share me that details as well Please

    • In UCD , navigate to Settings -> System Settings
      and under General Settings section , you would find “Agent for Version Imports”
      Ensure you have agent set out here.

  2. kelly

    Hi,
    Thanks for providing this information. But it seems the version that I manually created is still waiting (status), not sure what happened there, and no artifacts listed, do you have any other configuation steps between component and version creation?

    Thanks a lot.

    • You need an agent installed and running for imports and after that in UCD , navigate to Settings -> System Settings and under General Settings section , you would find “Agent for Version Imports”, set this to agent you installed

  3. kelly

    Hi,
    Thanks for your reply, actually I’ve added my agent to “Agent for Version Imports”, however, the “Automatic Version Import” still in “Executing” status and no version/artifacts automatically imported at UCD component. I also added agent ssh Key at github, are there any other steps I need to add? thanks again!

  4. Kavita

    Is there a solution for this? We are having a same problem.

    • What problem are you facing ?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

Bluemix HUB

The community for bluemix developers

Smith's Blog

Continuous delivery of software-driven innovation

Sanjeev Sharma's Site

My thoughts on #Cloud, #DevOps, #Architecture, #Agile, #Development, #Innovation, and Life...

Takehiko Amano's Blog on Emerging Technologies.

My thought on DevOps and Cloud technologies

Tim Feeney's Blog on Jazz

close encounters of the Jazz kind

Dan Toczala's Blog

THINK - About what's possible....

%d bloggers like this: