KKIMS on-site docs
Deploy KIMS (UAT and production)

Push the code to KIMS's Git

Put the kims-v2 main branch into KIMS's Git repository (and a uat branch if KIMS has UAT), check it arrived, and know how later changes move from uat to main.

Both Jenkins jobs in each environment check out from KIMS's own Git: production's from main, UAT's from uat. This page puts the code there.

#Before you start

  • KIMS has created an empty repository and given you push access. Note its URL, <KIMS_GIT_URL> (for example https://git.kims.example/web/kims-v2.git).
  • You have the code: a clone of kims-v2, or the git bundle kims-v2.bundle from the handover (workstation/get-the-code).
  • You know whether KIMS wants UAT (deploy/environments).
Warning

Push main, the commit that was handed over (535cdc7 "Runbook: AWS set-up from scratch, Hyderabad region", or later). Do not push the windows-fixes branch: it branched before main's last three commits and lacks the production and UAT model the Jenkins jobs depend on.

#Check what you are about to push

#Step 1: the working copy is clean and on main

The same commands on every system (in PowerShell or a terminal), from the kims-v2 folder:

bash
git switch main
git status --short
git log -1 --oneline

Expected: Already on 'main' (or Switched to branch 'main'), no output from git status --short, and one line starting with the commit you mean to deploy, for example 535cdc7 Runbook: AWS set-up from scratch, Hyderabad region.

If you cloned from the bundle, git log -1 shows the bundle's commit. git bundle verify <PATH_TO_BUNDLE> before cloning should end ... is okay.

#Push

#Step 2: add KIMS's repository as a remote

bash
git remote add kims <KIMS_GIT_URL>
git remote -v

Expected: two lines for kims, (fetch) and (push), with KIMS's URL. If it says error: remote kims already exists, use git remote set-url kims <KIMS_GIT_URL>.

#Step 3: push main

bash
git push kims main

Expected: ends with * [new branch] main -> main.

Note

In PowerShell, git's progress lines may appear in red, wrapped in NativeCommandError. That is only because git writes progress to the error stream. The push worked if the last line is the [new branch] one.

Git asks for credentials the way KIMS's server needs (a username and a personal access token, or an SSH key). Use your own account, and let Git Credential Manager (Windows, macOS) or your credential helper store it: never put a token inside the URL.

#UAT only: create the uat branch

The uat branch starts as the same commit as main:

bash
git push kims main:uat

Expected: * [new branch] main -> uat.

#Check

#KIMS's Git has the same commits

bash
git rev-parse main
git ls-remote kims main uat
bash
git rev-parse main
git ls-remote kims main uat
powershell
git rev-parse main
git ls-remote kims main uat

Expected: the first command prints a 40-character commit id; the second prints the same id for refs/heads/main (and, with UAT, for refs/heads/uat).

#Line endings survived (Windows)

The repository has a .gitattributes. If you cloned on Windows with core.autocrlf=true, the pushed commits are still normalised, because Git stores what was committed. Nothing to do; but do not commit from a Windows working copy without checking git diff --stat first (workstation/git).

#Later changes

#With UAT

  1. Push the change to uat: git push kims <COMMIT>:uat (or merge into uat on KIMS's server).
  2. kims-uat/kims-platform deploys it. KIMS tests it.
  3. Promote: git push kims uat:main. This only succeeds as a fast-forward. If it is refused with non-fast-forward, someone committed to main directly: stop and sort it out with KIMS, never force-push.
  4. Run kims-production/kims-platform (by hand, or by its trigger). It reuses UAT's image of that commit.

#Production only

Push the change to main; kims-production/kims-platform deploys it.

#Which commit is running

bash
kubectl --context <KUBE_CONTEXT> -n <NAMESPACE> get deployment kims-cms -o jsonpath='{.spec.template.spec.containers[0].image}'; echo
bash
kubectl --context <KUBE_CONTEXT> -n <NAMESPACE> get deployment kims-cms -o jsonpath='{.spec.template.spec.containers[0].image}'; echo
powershell
kubectl --context <KUBE_CONTEXT> -n <NAMESPACE> get deployment kims-cms -o jsonpath="{.spec.template.spec.containers[0].image}"

Expected: <REGISTRY>/kims/kims-v2:<40-character commit SHA>. The tag is the commit.

#If it goes wrong

What you see Cause Fix
Permission denied or 403 No push access yet Ask KIMS
! [rejected] main -> main (fetch first) KIMS's repository is not empty Ask KIMS what is in it. Never force-push over it
non-fast-forward on uat:main main has commits uat lacks Find out who committed to main; bring uat up to date with KIMS's agreement
SSL certificate problem KIMS's Git uses an internal certificate authority Get KIMS's CA certificate and set git config --global http.<KIMS_GIT_URL>.sslCAInfo <PATH_TO_CA_PEM>. Do not turn off SSL verification

#Sources

Built 2026-11-29. Commands are shown for the system picked at the top; every block has all three.