Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
afc0cb1
fix: update google-webfonts-helper service URL
esroyo Jan 30, 2023
f54a30b
fix: serve by default normal-400 variation
esroyo Jan 30, 2023
315f705
fix: change repo where to copy contents from
esroyo Jan 30, 2023
897014f
feat: generate all fonts if none selected
esroyo Jan 30, 2023
bd8280c
fix: make requests on prepare-fonts sequential
esroyo Jan 30, 2023
35642b6
feat: add a do-setup command to avoid the need of a web UI
esroyo Jan 30, 2023
028f7c6
feat: allow to perform a setup from cli
esroyo Jan 30, 2023
10ab9ea
feat: add a `/health` endpoint
esroyo Jan 31, 2023
fbe005e
feat: add cors to the service
esroyo Jan 31, 2023
eebdb9b
chore: add infra resources (#1)
manuasir Feb 1, 2023
5da6f03
fix: use relative path for font assets
esroyo Feb 1, 2023
e60785f
chore(k8s): change resource limits and requests (#3)
manuasir Feb 2, 2023
1e47797
chore: remove stg hpa
Apr 6, 2023
e6c769e
Merge pull request #4 from the-hotels-network/SYS-3179--eks-delete-pd…
toni299 Apr 6, 2023
25c4ca2
chore: reduce oversized resources
Apr 14, 2023
5f871c7
Merge pull request #5 from the-hotels-network/SYS-3247--kubernetes-op…
toni299 Apr 14, 2023
be8901f
chore: change ingress to external in stg and add missing parameters t…
May 25, 2023
35de874
Merge pull request #6 from the-hotels-network/SYS-ChangeIngressToExte…
toni299 May 25, 2023
4671f03
chore: remove ingress and update helm chart (#7)
manuasir Jul 19, 2023
1c2d576
chore: change target port for stg (#8)
manuasir Jul 25, 2023
ecfcb09
fix(CircleCI): update EKS orb and change image
Dec 4, 2023
22480b3
chore(Helm): upgrade chart version
Dec 4, 2023
5134be5
feat(CircleCI): enable DLC
Dec 5, 2023
ba745ef
fix(CircleCI): remove old DLC syntax
Dec 5, 2023
0728e6c
chore(CIrcleCI): change to reactivate pipeline
Dec 5, 2023
882dc9d
fix(Helm): change command for entrypoint in stg
Dec 5, 2023
b03b0d9
fix(Helm): changed string for array in entrypoint
Dec 5, 2023
43202f7
fix(Helm): fix last commits
Dec 5, 2023
1a5eee1
fix(Helm): change command for entrypoint in prd
Dec 5, 2023
5c63bfd
Merge pull request #9 from the-hotels-network/feat/SYS-3813
igordillothn Dec 5, 2023
7b61989
chore: rename references from master to main
esroyo Jun 18, 2024
b4b2997
chore: add PR template
esroyo Jun 25, 2024
72b27f5
feat: update deps, add download retry logic & upgrade Helm chart to v…
igordillothn Jan 12, 2026
ce5db88
feat(helm): improve ingress snippet readability (#13)
igordillothn Jan 28, 2026
8e054c5
feat: add serviceAccount for IRSA (SYS-6223)
allanmori Apr 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
version: 2.1
orbs:
aws-cli: circleci/aws-cli@5.4.1
aws-ecr: circleci/aws-ecr@7.3.0
aws-eks: circleci/aws-eks@3.0.1
helm: circleci/helm@3.2.0
defaults: &defaults
working_directory: ~/fontless
resource_class: medium
environment:
CHART_NAME: single-container
parameters:
dyn:
type: boolean
default: false
jobs:
deploy:
<<: *defaults
docker:
- image: cimg/python:3.13.8
steps:
- checkout
- helm/install_helm_client
- when:
condition: << pipeline.parameters.dyn >>
steps:
- run:
name: Setup environment variable for URL
command: |
echo 'export NORMALIZED_BRANCH=`echo ${CIRCLE_BRANCH} | tr -cd '[:alnum:]' | tr '[:upper:]' '[:lower:]' | cut -c 1-37`' >> "$BASH_ENV" && \
echo 'export URL=`grep "^ host:" helm/values-${ENV}.yaml | tr -s "[:blank:]\"" ":" | cut -d: -f3`' >> "$BASH_ENV" && \
echo 'export URL=`echo ${NORMALIZED_BRANCH}-${URL}`' >> "$BASH_ENV"
- unless:
condition: << pipeline.parameters.dyn >>
steps:
- run:
name: Setup environment variable for URL
command: |
echo 'export URL=`grep "^ host:" helm/values-${ENV}.yaml | tr -s "[:blank:]\"" ":" | cut -d: -f3`' >> "$BASH_ENV"
- aws-cli/setup:
aws_access_key_id: AWS_ACCESS_KEY_ID
aws_secret_access_key: AWS_SECRET_ACCESS_KEY
- aws-eks/update_kubeconfig_with_authenticator:
aws_region: ${AWS_REGION}
cluster_name: ${CLUSTER_NAME}
- aws-ecr/build-and-push-image:
account-url: AWS_ECR_ACCOUNT
dockerfile: ./docker/Dockerfile
region: AWS_REGION
repo: ${ECR_REPOSITORY}
remote-docker-layer-caching: true
remote-docker-version: docker24
setup-remote-docker: true
skip-when-tags-exist: true
tag: '${CIRCLE_SHA1},${CIRCLE_TAG}'
extra-build-args: '--build-arg CIRCLE_BRANCH=${CIRCLE_BRANCH} --build-arg CIRCLE_TAG=${CIRCLE_TAG}'
- run:
name: Render Helm templates
command: |
helm template ${CIRCLE_PROJECT_REPONAME}${NORMALIZED_BRANCH} \
oci://${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${COMPANY_PREFIX}-${HELM_CHARTS_REPOSITORY}/${CHART_NAME} \
--debug \
--disable-openapi-validation \
--namespace ${CIRCLE_PROJECT_REPONAME} \
--set applicationName="${CIRCLE_PROJECT_REPONAME}${NORMALIZED_BRANCH}" \
--set applicationVersion=`if [ -z ${CIRCLE_TAG} ]; then echo ${CIRCLE_SHA1}; else echo ${CIRCLE_TAG}; fi` \
--set deployment.container.image="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${ECR_REPOSITORY}:`if [ -z ${CIRCLE_TAG} ]; then echo ${CIRCLE_SHA1}; else echo ${CIRCLE_TAG}; fi`" \
--values helm/values-${ENV}.yaml \
--version ${GLOBAL_SINGLE_CONTAINER_VERSION}
- run:
name: Install Helm chart
command: |
helm upgrade -i ${CIRCLE_PROJECT_REPONAME}${NORMALIZED_BRANCH} \
oci://${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${COMPANY_PREFIX}-${HELM_CHARTS_REPOSITORY}/${CHART_NAME} \
--namespace ${CIRCLE_PROJECT_REPONAME} \
--set applicationName="${CIRCLE_PROJECT_REPONAME}${NORMALIZED_BRANCH}" \
--set applicationVersion=`if [ -z ${CIRCLE_TAG} ]; then echo ${CIRCLE_SHA1}; else echo ${CIRCLE_TAG}; fi` \
--set deployment.container.image="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${ECR_REPOSITORY}:`if [ -z ${CIRCLE_TAG} ]; then echo ${CIRCLE_SHA1}; else echo ${CIRCLE_TAG}; fi`" \
--values helm/values-${ENV}.yaml \
--version ${GLOBAL_SINGLE_CONTAINER_VERSION} \
--wait
- run:
name: Test Helm release
command: |
helm test ${CIRCLE_PROJECT_REPONAME}${NORMALIZED_BRANCH} \
--namespace ${CIRCLE_PROJECT_REPONAME} && \
echo "${CIRCLE_PROJECT_REPONAME}${NORMALIZED_BRANCH} Helm release created successfully." && \
echo "Your ${ENV} environment is ready to use at $URL."

workflows:
staging:
jobs:
- deploy:
context:
- global
- staging
filters:
tags:
only: /^\d+\.\d+\.\d+-stg$/
branches:
ignore: /.*/
production:
jobs:
- deploy:
context:
- global
- production
filters:
tags:
only: /^\d+\.\d+\.\d+$/
branches:
ignore: /.*/
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### Pull Request Context 🍏
Enter the PR context. Why is this new development necessary? What new feature, chore or bug are we addressing here?

---
### Solution provided 🍎
Briefly explain the approach taken through this Pull Request to address the requirements or expectations above.

---

🔗 **Helpful links** (If any - remove block otherwise):

---
:tickets: closes JIRA_PROJECT-XXXX
4 changes: 2 additions & 2 deletions .github/workflows/test-hooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Test Hooks

on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]

jobs:
build:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,5 @@ dist
fontless.config.json
service/public/
.DS_Store
.env.local
.env.local
*.zip
14 changes: 14 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# These owners will be the default owners for everything in
# the target repo. The following users will be requested for
# review when someone opens a pull request.

* @the-hotels-network/frontend @the-hotels-network/agent

# The /.circleci folder contains all Circle CI workflow pipelines. When updating
# its content we will want the Infra team to sign off on the changes. Having one
# approval from their team is enough to move on.
.circleci @the-hotels-network/infra @the-hotels-network/frontend @the-hotels-network/agent

# *********************************************************************
# (c) The Hotels Network
# *********************************************************************
24 changes: 24 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM node:16-alpine3.16 as builder

ARG CIRCLE_BRANCH
ARG CIRCLE_TAG

ENV CIRCLE_BRANCH=$CIRCLE_BRANCH
ENV CIRCLE_TAG=$CIRCLE_TAG

COPY . /src

WORKDIR /src

RUN npm install

RUN cd setup && npm run build && npm run do-setup

FROM node:16-alpine3.16

WORKDIR /app

COPY --from=builder /src/setup/deployment.zip ./

RUN unzip deployment.zip -o && npm install && npm run build

72 changes: 72 additions & 0 deletions helm/values-prd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Chart-wide values.
env: "prd"
# Where to install ALL objects of the chart.
namespace: "fontless"

pdb:
minAvailable: 1

serviceAccount:
create: true

# Select the port to expose to the cluster. 80 is the default unless otherwise specified.
service:
port: 80

deployment:
# Settings for the main deployment object.
rollingUpdateMaxSurge: "20%"
rollingUpdateMaxUnavailable: "0"
# Settings for the deployment's pods.
datadogAnnotations: '[{"source": "fontless", "service": "fontless-prd"}]'
nodeSelector:
ng: prd-hp
terminationGracePeriodSeconds: 60
# Settings for the deployment's container.
container:
apm: true
command:
- /bin/sh
- -c
- cd /app/ && npm run start
# Set which port to expose from the container to the pod. Not to be confused with the service one.
port: 3000
resources:
limits:
cpu: 100m
memory: 512Mi
ephemeral-storage: 1500Mi
requests:
cpu: 100m
memory: 512Mi
ephemeral-storage: 1500Mi
# Check if the container has started properly.
startupProbe:
httpGet:
path: "/api/health"
initialDelaySeconds: 45
# If the container has started properly, periodically check if its service is still active.
livenessProbe:
periodSeconds: 300
# If the container has started properly, periodically check if its service is still ready to serve traffic.
readinessProbe:
httpGet:
path: "/api/health"
failureThreshold: 3
initialDelaySeconds: 10
periodSeconds: 300

# Autoscaling settings.
hpa:
maxReplicas: 20
minReplicas: 2
memoryAverageUtilization: 90
cpuAverageUtilization: 90

# Set a URL to expose to the Internet.
ingress:
# If set to "external", the URL will be exposed in *.thehotelsnetwork.com (public). Otherwise, it'll be exposed in *.thn.app (only accessible via VPN).
class: "internal"
host: "fontless.thn.app"
extraConfigurationSnippet: |
rewrite ^/gfonts(.*) $1 break;
58 changes: 58 additions & 0 deletions helm/values-stg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Chart-wide values.
env: "stg"
applicationName: "fontless"
# Where to install ALL objects of the chart.
namespace: "fontless"

serviceAccount:
create: true

# Select the port to expose to the cluster. 80 is the default unless otherwise specified.
service:
port: 80

deployment:
# Settings for the deployment's pods.
datadogAnnotations: '[{"source": "fontless", "service": "fontless-stg"}]'
terminationGracePeriodSeconds: 60
# Settings for the deployment's container.
container:
apm: true
command:
- /bin/sh
- -c
- cd /app/ && npm run start
# Set which port to expose from the container to the pod. Not to be confused with the service one.
port: 3000
resources:
limits:
cpu: 100m
memory: 512Mi
ephemeral-storage: 1500Mi
requests:
cpu: 50m
memory: 256Mi
ephemeral-storage: 1500Mi
# Check if the container has started properly.
startupProbe:
httpGet:
path: "/api/health"
initialDelaySeconds: 45
# If the container has started properly, periodically check if its service is still active.
livenessProbe:
periodSeconds: 300
# If the container has started properly, periodically check if its service is still ready to serve traffic.
readinessProbe:
httpGet:
path: "/api/health"
failureThreshold: 3
initialDelaySeconds: 10
periodSeconds: 300

# Set a URL to expose to the Internet.
ingress:
# If set to "external", the URL will be exposed in *.thehotelsnetwork.com (public). Otherwise, it'll be exposed in *.thn.app (only accessible via VPN).
class: "internal"
host: "fontless.stg.thn.app"
extraConfigurationSnippet: |
rewrite ^/gfonts(.*) $1 break;
Loading