Skip to content

Interactive powershell script to fetch corelink source code repos for gitlab - windows platform

Overview

We need to provide users an easy way to setup corelink repos on their machine rather than doing a manual clone every time via CLI. It is error prone and people tend to do it in non-standard ways leading to differences in setup.

Requirements

Write a interactive powershell script for windows systems (windows desktop and server) which

  • Takes the user token and an installation path. if the installation path is not provided, assume one in a safe location.
  • Do a clone on the repos and the dependencies of these repos e.g. if client depends on commons and external-dependencies, get the other 2 first and then checkout the client.
  • Set the local git branch to dev so that people commit to dev branch by default and not master branch.

Current behavior

Check the python implementation here and the bash implementation here.

You can see the expected usage here

Expected behavior

Please check the requirements for this. But an eventual structure should look something like this

<root>/hsrn/corelink/repo
|-corelink
|-corelink-documentation
|-corelink-client
| // others

Acceptance Criteria

  • The script should ask the user for what they want to install.
  • The script should install the asked component and dependencies. the dependencies may be defined statically. in the future, we might move to repo artifacts or git sub-modules to aid this.
  • The script should set the local branch of all the checked out repos to dev or master as appropriate.

Testing Requirements

  • The shell script should do everything defined in the acceptance criteria
  • This should work on all windows systems.

Linked issues Please care for linked issue #7 (closed)

Notes

git integration on bash and zsh is great, but windows command line does not support all features provided by the git shell. Hence people tend to leave out the option while installing git on their windows machine for windows CLI git integration. For our scripts to work, git should be invokable via PS or CMD. However, if it is not, then we need to make people add git to their %PATH% variable.

For those who do not have git installed, they could follow either

OR

However, if people already have git installed on their machines, they can follow this to make our lives simpler.

I would recommend trying things out from both of these links on your machine first to find out if these work or now.

Edited by Sarthak Tickoo