Skip to content

Commit d398771

Browse files
authored
Merge pull request #2 from projectsyn/ssh-agent
Update tutorial to link with setting up commodore alias
2 parents 803b28d + 86e7df5 commit d398771

7 files changed

Lines changed: 8 additions & 36 deletions

File tree

2_commodore_on_minikube.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ LIEUTENANT_TOKEN=$(kubectl --context minikube -n lieutenant get secret $(kubectl
3232
echo "===> Kickstart Commodore"
3333
echo "===> IMPORTANT: When prompted enter your SSH key password"
3434
kubectl -n lieutenant run commodore-shell \
35-
--image=docker.io/projectsyn/commodore:v0.2.0 \
35+
--image=docker.io/projectsyn/commodore:v0.3.0 \
3636
--env=COMMODORE_API_URL="$LIEUTENANT_URL" \
3737
--env=COMMODORE_API_TOKEN="$LIEUTENANT_TOKEN" \
3838
--env=COMMODORE_GLOBAL_GIT_BASE="https://github.com/$GITHUB_USERNAME" \

4_synthesize_on_k3s.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ check_variable "CLUSTER_ID" $CLUSTER_ID
2626
echo "===> Kickstart Commodore"
2727
echo "===> IMPORTANT: When prompted enter your SSH key password"
2828
kubectl --context minikube -n lieutenant run commodore-shell \
29-
--image=docker.io/projectsyn/commodore:v0.2.0 \
29+
--image=docker.io/projectsyn/commodore:v0.3.0 \
3030
--env=COMMODORE_API_URL="$LIEUTENANT_URL" \
3131
--env=COMMODORE_API_TOKEN="$LIEUTENANT_TOKEN" \
3232
--env=COMMODORE_GLOBAL_GIT_BASE="https://github.com/$GITHUB_USERNAME" \

4_synthesize_on_kind.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ check_variable "CLUSTER_ID" $CLUSTER_ID
2222
echo "===> Kickstart Commodore"
2323
echo "===> IMPORTANT: When prompted enter your SSH key password"
2424
kubectl --context minikube -n lieutenant run commodore-shell \
25-
--image=docker.io/projectsyn/commodore:v0.2.0 \
25+
--image=docker.io/projectsyn/commodore:v0.3.0 \
2626
--env=COMMODORE_API_URL="$LIEUTENANT_URL" \
2727
--env=COMMODORE_API_TOKEN="$LIEUTENANT_TOKEN" \
2828
--env=COMMODORE_GLOBAL_GIT_BASE="https://github.com/$GITHUB_USERNAME" \

4_synthesize_on_microk8s.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ check_variable "CLUSTER_ID" $CLUSTER_ID
2424
echo "===> Kickstart Commodore"
2525
echo "===> IMPORTANT: When prompted enter your SSH key password"
2626
kubectl --context minikube -n lieutenant run commodore-shell \
27-
--image=docker.io/projectsyn/commodore:v0.2.0 \
27+
--image=docker.io/projectsyn/commodore:v0.3.0 \
2828
--env=COMMODORE_API_URL="$LIEUTENANT_URL" \
2929
--env=COMMODORE_API_TOKEN="$LIEUTENANT_TOKEN" \
3030
--env=COMMODORE_GLOBAL_GIT_BASE="https://github.com/$GITHUB_USERNAME" \

commodore_command.sh

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
11
#!/usr/bin/env bash
22

3-
commodore () {
4-
docker run \
5-
--env-file=.env \
6-
--interactive=true \
7-
--tty \
8-
--rm \
9-
--user="$(id -u)" \
10-
--volume "${HOME}/.ssh:/app/.ssh:ro" \
11-
--volume "${HOME}/.gitconfig:/app/.gitconfig:ro" \
12-
--volume "${PWD}:/app/data/" \
13-
--workdir "/app/data" \
14-
projectsyn/commodore:v0.3.0 \
15-
$*
16-
}
17-
183
commodore_compile_all() {
194
CLUSTERS=($(kubectl --context minikube -n lieutenant get cluster -o jsonpath="{$.items[*].metadata.name}"))
205
for CLUSTER in "${CLUSTERS[@]}"; do

docs/modules/ROOT/pages/index.adoc

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ To follow this tutorial you will need quite an array of software in your system:
3737
* https://k3d.io/[K3d] version 3.0
3838
* A https://about.gitlab.com/[GitLab] account with your https://gitlab.com/profile/keys[SSH key configured]. You can use a private GitLab instance, if you have one nearby.
3939
* A https://github.com/[GitHub] account with your https://github.com/settings/keys[SSH key configured].
40+
* SSH-agent running with your SSH key added.
4041
* The following commands must be installed and available in your path: https://curl.haxx.se/[curl], https://stedolan.github.io/jq/[jq], `ssh-keyscan`, and `base64`.
4142
** Although not required by this tutorial, you could also install https://github.com/mikefarah/yq[yq] and https://k9scli.io/[k9s], both very useful when working with Commodore Components.
4243
* We will be editing files with https://code.visualstudio.com/[Visual Studio Code] together with the following extensions:
@@ -167,20 +168,7 @@ Now we're getting to the actual subject of this tutorial! Let us dive into the r
167168

168169
=== Using the Commodore Docker Image
169170

170-
We are going to use now the `commodore` tool to generate and compile our new component. This tool is written in Python and requires quite a few dependencies; to make our lives easier, we are instead going to use the corresponding https://hub.docker.com/r/projectsyn/commodore[container image available in Docker Hub]. This is why it is strongly recommended that you define the following function in your environment, which will make using `commodore` a much simpler task:
171-
172-
[source,bash]
173-
----
174-
$ which commodore
175-
commodore not found
176-
177-
$ source ./commodore_command.sh
178-
179-
$ which commodore
180-
commodore () {
181-
docker run --env-file=.env --interactive=true --tty --rm --user="$(id -u)" --volume "$HOME"/.ssh:/app/.ssh:ro --volume "$PWD"/compiled/:/app/compiled/ --volume "$PWD"/catalog/:/app/catalog --volume "$PWD"/dependencies/:/app/dependencies/ --volume "$PWD"/inventory/:/app/inventory/ --volume ~/.gitconfig:/app/.gitconfig:ro projectsyn/commodore:v0.2.0 "$*"
182-
}
183-
----
171+
We are going to use now the `commodore` tool to generate and compile our new component. This tool is written in Python and requires quite a few dependencies; to make our lives easier, we are instead going to use the corresponding https://hub.docker.com/r/projectsyn/commodore[container image available in Docker Hub]. This is why it is strongly recommended that you define the following function in your environment, which will make using `commodore` a much simpler task. See https://docs.syn.tools/commodore/running-commodore.html[Running Commodore].
184172

185173
=== Checking out the Commodore Project
186174

@@ -291,7 +279,7 @@ The Jsonnet extension for Visual Studio Code requires some values in your `setti
291279
]
292280
----
293281

294-
The value of the third entry of the `jsonnet.libPaths` property can be found using the `poetry env info` command.
282+
The value of the third entry of the `jsonnet.libPaths` property can be found using the `poetry env info` command (run `poetry install` first if you have not done it yet).
295283

296284
[TIP]
297285
.Creating Jsonnet files from YAML
@@ -534,7 +522,7 @@ cluster.syn.tools "c-aged-sea-7813" deleted
534522
cluster.syn.tools "c-snowy-sunset-5873" deleted
535523
===> Removing tenant
536524
tenant.syn.tools "t-solitary-field-4017" deleted
537-
===> Waiting 20 seconds for the removal of GitLab repositories
525+
===> Waiting 20 seconds for the removal of GitLab repositories
538526
🔥 Deleting "minikube" in docker ...
539527
🔥 Deleting container "minikube" ...
540528
🔥 Removing /home/username/.minikube/machines/minikube ...

env.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ case "${OPTION}" in
3434
echo "K3S_CLUSTER_ID: $K3S_CLUSTER_ID"
3535
;;
3636
esac
37-

0 commit comments

Comments
 (0)