An integration in a Git repository
GitOps 1 · 4:17
The hello integration and its devtest documents move into a Git repository, and the hub is updated from there after a plan shows what the update will change. The repository contains no secret values.
What it covers
- Turning the work folder into a Git repository with
git init - The shared path
sandbox/sharedand the devtest pathsandbox/devtest - Deployment and variable documents for devtest, with no secret value in the repository
- A plan with
weikio diffthat applies nothing, with the prune namesandboxand its exit codes - Applying from the repository with
weikio apply, which builds 0.2.0 - A second commit with a new period and 0.2.1 in the integration and its deployment document
Commands in this video
Terminal
$ git init
$ weikio validate -f sandbox/shared -f sandbox/devtest
$ weikio diff -f sandbox/shared -f sandbox/devtest --env devtest --prune sandbox
$ echo $?
$ weikio apply -f sandbox/shared -f sandbox/devtest --env devtest --prune sandbox -y
$ git add sandbox
$ git commit -m 'hello in the repository'
$ git commit -m 'period 2000 and version 0.2.1'
$ git log --onelineTranscript
- 0:01Typed commands started hello in devtest.
- 0:04This video puts hello into Git.
- 0:11Agent dev runs the sandbox/hello deployment.
- 0:17The devtest environment holds version 0.1.4,
- 0:21variable sandbox/message and secret sandbox/erp-api-key.
- 0:29The hello folder cannot say this.
- 0:35The work folder becomes a Git repository with git init.
- 0:39The repository starts on the branch main.
- 0:42The .git folder holds what Git stores about the repository.
- 0:46hello moves to sandbox/shared/hello, the shared path of the project.
- 0:54It holds what every environment of the project reads.
- 0:57Its integration.yaml states version 0.2.0.
- 1:04Two documents for devtest sit under sandbox/devtest.
- 1:09The Deployment document names what runs where: hello at version 0.2.0.
- 1:16The Variable document gives message the value hello again.
- 1:20The repository holds no secret value. The route names the secret it needs.
- 1:26weikio validate reads the two paths before anything is sent.
- 1:31The closing line counts the documents and the integration.
- 1:39The plan reads both paths and applies nothing.
- 1:42The prune carries one name for the repository, sandbox.
- 1:46The rows name the integration, the deployment and the variable.
- 1:51Both notes say this prune name has no earlier apply here.
- 1:55Exit code 0 means nothing would change, and 2 means something would.
- 2:05The apply writes what the plan listed.
- 2:07The y flag answers the prune confirmation in advance.
- 2:14The hub built 0.2.0, and the deployment card reads 0.2.0.
- 2:22Under the name sandbox, the hub now keeps what these two paths put there.
- 2:26The commit stores this state of the folder.
- 2:37The route fires every two seconds now. The integration folder states 0.2.1. The Deployment document now names 0.2.1.
- 2:52Both paths ran under the name sandbox before, so no note prints.
- 3:00The apply builds 0.2.1 and the deployment runs it.
- 3:08A pipeline runs these same commands.
- 3:11The commit names the new period and version.
- 3:23The repository holds two commits on main.
- 3:33Hello's page in the admin UI shows the new version.
- 3:37The strip reads 0.2.1. The Versions panel lists 0.2.0 and 0.1.4.
- 3:51The repository holds the route, the Deployment and Variable documents.
- 3:56The apply runs from the repository to the hub.
- 3:59The hub's newest version came from the folder.
- 4:02The deployment is 0.2.1 and running.
- 4:06Devtest runs it with the value hello again.
Next in this track
GitOps 2 · 3:45 Deleting and undoing through Git Watched