Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create object overview (TT-1753) #1

Merged
merged 6 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
NEXT_PUBLIC_BASE_PATH=/ammo
IMAGE_API_URL=http://localhost:3000
158 changes: 157 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,159 @@
{
"extends": ["next/core-web-vitals", "next/typescript"]
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"next/core-web-vitals"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": true,
"tsconfigRootDir": "./"
},
"plugins": [
"@typescript-eslint",
"@stylistic"
],
"rules": {
"@stylistic/arrow-parens": [
"error",
"as-needed"
],
"@stylistic/comma-dangle": "off",
"@stylistic/indent": [
"error",
2,
{
"ObjectExpression": "first",
"FunctionDeclaration": {
"parameters": "first"
},
"FunctionExpression": {
"parameters": "first"
}
}
],
"@stylistic/linebreak-style": [
"off",
"unix"
],
"@stylistic/max-len": [
"error",
{
"code": 140
}
],
"@stylistic/member-delimiter-style": [
"error",
{
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@stylistic/new-parens": "error",
"@stylistic/no-trailing-spaces": "error",
"@stylistic/quote-props": [
"error",
"as-needed"
],
"@stylistic/quotes": [
"error",
"single"
],
"@stylistic/semi": [
"error"
],
"@stylistic/space-in-parens": [
"error",
"never"
],
"@stylistic/spaced-comment": [
"error",
"always",
{
"markers": [
"/"
]
}
],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "property",
"format": ["camelCase"],
"filter": {
"regex": "[-]",
"match": false
}
}
],

"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/unified-signatures": "error",
"eqeqeq": [
"error",
"smart"
],
"guard-for-in": "error",
"id-denylist": [
"error",
"any",
"Number",
"number",
"String",
"string",
"Boolean",
"boolean",
"Undefined",
"undefined"
],
"id-match": "error",
"no-bitwise": "error",
"no-caller": "error",
"no-console": [
"error",
{
"allow": [
"assert",
"clear",
"Console",
"context",
"count",
"countReset",
"dir",
"dirxml",
"error",
"group",
"groupEnd",
"groupCollapsed",
"log",
"profile",
"profileEnd",
"table",
"timeLog",
"timeStamp",
"warn"
]
}
],
"no-eval": "error",
"no-new-wrappers": "error",
"no-restricted-imports": [
"error",
"rxjs/Rx"
],
"no-throw-literal": "error",
"no-undef-init": "error",
"no-underscore-dangle": "error",
"no-var": "error",
"object-shorthand": "error",
"one-var": [
"error",
"never"
],
"prefer-const": "error",
"radix": "error"
},
"root": true
}
9 changes: 6 additions & 3 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
needs: lint-and-test
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
runs-on: [self-hosted-linux]
outputs:
image_version: ${{ steps.meta.outputs.version }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -72,7 +74,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: harbor.nb.no/tekst/ammo
images: ${{ steps.import-secrets.outputs.HARBOR_URL }}/tekst/ammo
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
Expand Down Expand Up @@ -108,7 +110,8 @@ jobs:
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: |
kv/team/text/data/k8s-text-stage *
kv/team/text/data/k8s-text-stage * ;
kv/team/text/data/harbor *

- name: Set up kubectl
uses: azure/setup-kubectl@v4
Expand All @@ -118,7 +121,7 @@ jobs:
- name: Deploy to stage cluster
run: |
echo "Deploying to stage version ${{ env.APP_VERSION }}"
sed -i "s/<version>/${{ env.APP_VERSION }}/g" k8s/stage/deployment.yml
sed -i "s|<image>|${{ steps.import-harbor-secrets.outputs.HARBOR_URL }}/tekst/ammo:${{ needs.build-and-publish.outputs.image_version }}|g" k8s/stage/deployment.yml
sed -i "s/<host_url>/${{ steps.import-secrets.outputs.K8S_HOST_URL }}/g" k8s/stage/ingress.yml
kubectl config set-cluster stagecl --server=${{ steps.import-secrets.outputs.K8S_STAGE_SERVER }}
kubectl config set clusters.stagecl.certificate-authority-data ${{ steps.import-secrets.outputs.K8S_STAGE_NB_NO_CA }}
Expand Down
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
# env files
.env*.local
.env.production
.env.development

# vercel
.vercel
Expand All @@ -36,4 +38,7 @@ yarn-error.log*
next-env.d.ts

# IDE
/.idea
/.idea

# local dev files
dummy-data.json
8 changes: 7 additions & 1 deletion k8s/stage/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ spec:
spec:
containers:
- name: ammo
image: harbor.nb.no/tekst/ammo:<version>
image: <image>
ports:
- name: app-port
containerPort: 3000
imagePullPolicy: Always
env:
- name: IMAGE_API_PATH
valueFrom:
secretKeyRef:
name: ammo-secrets
key: image_api_path
13 changes: 12 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
basePath: process.env.NEXT_PUBLIC_BASE_PATH
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
images: {
remotePatterns: [
{
protocol: 'https',
// TODO: Temporary remote pattern. Change when we have decided where to retrieve images from.
hostname: 'www.nb.no',
port: '',
pathname: '/services/image/resolver/**'
}
]
}
};

export default nextConfig;
Loading