Skip to content

Commit 293394c

Browse files
committed
Merge branch 'main' of https://github.com/lttle-cloud/docs into feature/styling
2 parents d95bab1 + 6c196a9 commit 293394c

9 files changed

Lines changed: 30 additions & 30 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- name: "Setting deployment url"
6868
id: deploymentUrl
6969
run: |
70-
url="https://"$(lttle deploy --eval "git.ref == 'main'? 'docs.lttle.aifrim.com' : 'docs-' + env.GITHUB_HEAD_REF + '-lttle-aifrim.eu.lttle.host'")
70+
url="https://"$(lttle deploy --eval "git.ref == 'main'? 'docs.lttle.aifrim.com' : 'docs-' + env.GITHUB_HEAD_REF.toSlug() + '-lttle-aifrim.eu.lttle.host'")
7171
echo "url=$url" >> $GITHUB_OUTPUT
7272
7373
# TODO: Split this into several bash functions so that we can use the dedicated docker build actions

deploy-docs.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ if [ -z "${GITHUB_HEAD_REF+x}" ]; then
1313
export GITHUB_HEAD_REF
1414
fi
1515

16-
namespace="docs-"$(lttle deploy --eval "git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF + '-branch'")
17-
tag=$(lttle deploy --eval "git.ref == 'main' ? 'latest' : env.GITHUB_HEAD_REF + '-branch'")
16+
namespace="docs-"$(lttle deploy --eval "git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch'")
17+
tag=$(lttle deploy --eval "git.ref == 'main' ? 'latest' : env.GITHUB_HEAD_REF.toSlug() + '-branch'")
1818

19-
docsURL="https://"$(lttle deploy --eval "git.ref == 'main' ? 'docs.lttle.aifrim.com' : 'docs-' + env.GITHUB_HEAD_REF + '-lttle-aifrim.eu.lttle.host'")
20-
typesenseFQDN=$(lttle deploy --eval "git.ref == 'main' ? 'docs-search.lttle.aifrim.com' : 'docs-search-' + env.GITHUB_HEAD_REF + '-lttle-aifrim.eu.lttle.host'")
19+
docsURL="https://"$(lttle deploy --eval "git.ref == 'main' ? 'docs.lttle.aifrim.com' : 'docs-' + env.GITHUB_HEAD_REF.toSlug() + '-lttle-aifrim.eu.lttle.host'")
20+
typesenseFQDN=$(lttle deploy --eval "git.ref == 'main' ? 'docs-search.lttle.aifrim.com' : 'docs-search-' + env.GITHUB_HEAD_REF.toSlug() + '-lttle-aifrim.eu.lttle.host'")
2121

2222
deployDocs "$namespace" "$tag" "$docsURL" "$typesenseFQDN"

deploy-typesense.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ if [ -z "${GITHUB_HEAD_REF+x}" ]; then
1313
export GITHUB_HEAD_REF
1414
fi
1515

16-
namespace="docs-"$(lttle deploy --eval "git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF + '-branch'");
17-
tag=$(lttle deploy --eval "git.ref == 'main' ? 'latest' : env.GITHUB_HEAD_REF + '-branch'")
16+
namespace="docs-"$(lttle deploy --eval "git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch'");
17+
tag=$(lttle deploy --eval "git.ref == 'main' ? 'latest' : env.GITHUB_HEAD_REF.toSlug() + '-branch'")
1818

19-
docsURL="https://"$(lttle deploy --eval "git.ref == 'main' ? 'docs.lttle.aifrim.com' : 'docs-' + env.GITHUB_HEAD_REF + '-lttle-aifrim.eu.lttle.host'")
20-
typesenseFQDN=$(lttle deploy --eval "git.ref == 'main' ? 'docs-search.lttle.aifrim.com' : 'docs-search-' + env.GITHUB_HEAD_REF + '-lttle-aifrim.eu.lttle.host'")
19+
docsURL="https://"$(lttle deploy --eval "git.ref == 'main' ? 'docs.lttle.aifrim.com' : 'docs-' + env.GITHUB_HEAD_REF.toSlug() + '-lttle-aifrim.eu.lttle.host'")
20+
typesenseFQDN=$(lttle deploy --eval "git.ref == 'main' ? 'docs-search.lttle.aifrim.com' : 'docs-search-' + env.GITHUB_HEAD_REF.toSlug() + '-lttle-aifrim.eu.lttle.host'")
2121

2222
deployTypeSense "$namespace" "$tag" "$docsURL" "$typesenseFQDN"

deploy.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ fi
1515

1616
lttle deploy --eval "" --debug-context
1717

18-
namespace="docs-"$(lttle deploy --eval "git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF + '-branch'");
19-
tag=$(lttle deploy --eval "git.ref == 'main' ? 'latest' : env.GITHUB_HEAD_REF + '-branch'")
18+
namespace="docs-"$(lttle deploy --eval "git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch'");
19+
tag=$(lttle deploy --eval "git.ref == 'main' ? 'latest' : env.GITHUB_HEAD_REF.toSlug() + '-branch'")
2020

21-
docsURL="https://"$(lttle deploy --eval "git.ref == 'main' ? 'docs.lttle.aifrim.com' : 'docs-' + env.GITHUB_HEAD_REF + '-lttle-aifrim.eu.lttle.host'");
22-
typesenseFQDN=$(lttle deploy --eval "git.ref == 'main' ? 'docs-search.lttle.aifrim.com' : 'docs-search-' + env.GITHUB_HEAD_REF + '-lttle-aifrim.eu.lttle.host'")
21+
docsURL="https://"$(lttle deploy --eval "git.ref == 'main' ? 'docs.lttle.aifrim.com' : 'docs-' + env.GITHUB_HEAD_REF.toSlug() + '-lttle-aifrim.eu.lttle.host'");
22+
typesenseFQDN=$(lttle deploy --eval "git.ref == 'main' ? 'docs-search.lttle.aifrim.com' : 'docs-search-' + env.GITHUB_HEAD_REF.toSlug() + '-lttle-aifrim.eu.lttle.host'")
2323

2424
deployDocs "$namespace" "$tag" "$docsURL" "$typesenseFQDN"
2525
deployTypeSense "$namespace" "$tag" "$docsURL"

lttle/docs.lttle.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
machine:
3-
namespace: "docs-${{ git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF + '-branch' }}"
3+
namespace: "docs-${{ git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch' }}"
44
name: nginx-docs
5-
image: "aifrim/lttle-docs:${{ git.ref == 'main'? 'latest' : env.GITHUB_HEAD_REF + '-branch' }}"
5+
image: "aifrim/lttle-docs:${{ git.ref == 'main'? 'latest' : env.GITHUB_HEAD_REF.toSlug() + '-branch' }}"
66
# IMPORTANT: nginx-docs memory & cpu configuration
77
# For the time being, 1 vCPU and 512 MiB should suffice
88
# To be re-visited later - post-MVP
@@ -19,7 +19,7 @@ machine:
1919
listen-on-port: 80
2020
---
2121
service:
22-
namespace: "docs-${{ git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF + '-branch' }}"
22+
namespace: "docs-${{ git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch' }}"
2323
name: docs-ingress
2424
target:
2525
name: nginx-docs
@@ -29,6 +29,6 @@ service:
2929
external:
3030
# Production is docs.lttle.aifrim.com (for now) where we have dedicated certificate
3131
# Preview Environments are reusing the same wildcard certificate from *.eu.lttle.host
32-
host: "${{ git.ref == 'main'? 'docs.lttle.aifrim.com' : 'docs-' + env.GITHUB_HEAD_REF + '-lttle-aifrim.eu.lttle.host' }}"
32+
host: "${{ git.ref == 'main'? 'docs.lttle.aifrim.com' : 'docs-' + env.GITHUB_HEAD_REF.toSlug() + '-lttle-aifrim.eu.lttle.host' }}"
3333
protocol: https
3434
certificate: "${{ git.ref == 'main'? 'main' : null }}"

lttle/typesense.lttle.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# FIXME: Only allow certain domains to call this machine by enabling CORS
33
# TODO: Look for other important security measures for TypeSense
44
machine:
5-
namespace: "docs-${{ git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF + '-branch' }}"
5+
namespace: "docs-${{ git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch' }}"
66
name: typesense-search
77
image: typesense/typesense:29.0
88
# IMPORTANT: typesense memory & cpu configuration
@@ -30,9 +30,9 @@ machine:
3030
TYPESENSE_DATA_DIR: /data
3131
---
3232
machine:
33-
namespace: "docs-${{ git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF + '-branch' }}"
33+
namespace: "docs-${{ git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch' }}"
3434
name: typesense-scraper
35-
image: "aifrim/typesense-scraper:${{ git.ref == 'main'? 'latest' : env.GITHUB_HEAD_REF + '-branch' }}"
35+
image: "aifrim/typesense-scraper:${{ git.ref == 'main'? 'latest' : env.GITHUB_HEAD_REF.toSlug() + '-branch' }}"
3636
# TODO: Check memory usage of the TypeSense Scraper and adjust memory
3737
resources:
3838
cpu: 1
@@ -56,7 +56,7 @@ machine:
5656
# TODO: Must get this from an environment variable
5757
TYPESENSE_API_KEY: ${{ env.TYPESENSE_API_KEY }}
5858
# This is service-name.namespace.svc.lttle.local
59-
TYPESENSE_HOST: "typesense-search-internal.docs-${{ git.ref == 'main'? 'main' : env.GITHUB_HEAD_REF + '-branch' }}.svc.lttle.local"
59+
TYPESENSE_HOST: "typesense-search-internal.docs-${{ git.ref == 'main'? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch' }}.svc.lttle.local"
6060
# NOTE: Does this really need to always be a string, can it not be
6161
# A number or a boolean, and then we can transform it to a string?
6262
TYPESENSE_PORT: "8108"
@@ -70,22 +70,22 @@ machine:
7070
---
7171
# This makes typesense reachable from the docs search
7272
service:
73-
namespace: "docs-${{ git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF + '-branch' }}"
73+
namespace: "docs-${{ git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch' }}"
7474
name: typesense-search-ingress
7575
target:
7676
name: typesense-search
7777
port: 8108
7878
protocol: http
7979
bind:
8080
external:
81-
host: "${{ git.ref == 'main'? 'docs-search.lttle.aifrim.com' : 'docs-search-' + env.GITHUB_HEAD_REF + '-lttle-aifrim.eu.lttle.host' }}"
81+
host: "${{ git.ref == 'main'? 'docs-search.lttle.aifrim.com' : 'docs-search-' + env.GITHUB_HEAD_REF.toSlug() + '-lttle-aifrim.eu.lttle.host' }}"
8282
protocol: https
8383
certificate: "${{ git.ref == 'main'? 'cert-docs' : null }}"
8484
---
8585
# This makes typesense reachable internally
8686
# We point the typesense-scraper to send scraped data to this internal service
8787
service:
88-
namespace: "docs-${{ git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF + '-branch' }}"
88+
namespace: "docs-${{ git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch' }}"
8989
name: typesense-search-internal
9090
target:
9191
name: typesense-search
@@ -96,7 +96,7 @@ service:
9696
internal: {}
9797
---
9898
volume:
99-
namespace: "docs-${{ git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF + '-branch' }}"
99+
namespace: "docs-${{ git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch' }}"
100100
mode: writeable
101101
name: typesense-search
102102
# NOTE: This may be too much for now. Since the size of the docs I would say

remove.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ if [ -z "${GITHUB_HEAD_REF+x}" ]; then
1313
export GITHUB_HEAD_REF
1414
fi
1515

16-
namespace="docs-"$(lttle deploy --eval "git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF + '-branch'")
16+
namespace="docs-"$(lttle deploy --eval "git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch'")
1717

18-
# if [ "$namespace" == "docs-main" ]; then
18+
if [ "$namespace" == "docs-main" ]; then
1919
echo "We do not remove the main documentation"
2020
exit 1
2121
fi

restart.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if [ -z "${GITHUB_HEAD_REF+x}" ]; then
1313
export GITHUB_HEAD_REF
1414
fi
1515

16-
namespace="docs-"$(lttle deploy --eval "git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF + '-branch'");
16+
namespace="docs-"$(lttle deploy --eval "git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch'");
1717

1818
what="$1"
1919

wait-for-app.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if [ -z "${GITHUB_HEAD_REF+x}" ]; then
1313
export GITHUB_HEAD_REF
1414
fi
1515

16-
docsURL="https://"$(lttle deploy --eval "git.ref == 'main' ? 'docs.lttle.aifrim.com' : 'docs-' + env.GITHUB_HEAD_REF + '-lttle-aifrim.eu.lttle.host'")
17-
namespace="docs-"$(lttle deploy --eval "git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF + '-branch'")
16+
docsURL="https://"$(lttle deploy --eval "git.ref == 'main' ? 'docs.lttle.aifrim.com' : 'docs-' + env.GITHUB_HEAD_REF.toSlug() + '-lttle-aifrim.eu.lttle.host'")
17+
namespace="docs-"$(lttle deploy --eval "git.ref == 'main' ? 'main' : env.GITHUB_HEAD_REF.toSlug() + '-branch'")
1818

1919
isUp "$namespace" "nginx-docs" "$docsURL" 300 1

0 commit comments

Comments
 (0)