-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pipeline
- Loading branch information
Showing
16 changed files
with
1,179 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.git | ||
.github | ||
.k8s | ||
*.md | ||
**/node_modules | ||
**/.next/cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": ["github>SocialGouv/renovate-config:light"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.next | ||
out | ||
out | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
include: | ||
- project: SocialGouv/gitlab-ci-yml | ||
file: /autodevops.yml | ||
ref: v17.13.0 | ||
|
||
variables: | ||
AUTO_DEVOPS_RELEASE_AUTO: "🔖" | ||
AUTO_DEVOPS_PRODUCTION_AUTO: "🚀" | ||
|
||
# NOTE(douglasduteil): No install :( | ||
# sharing the node_modules is too slow... | ||
Install: | ||
rules: | ||
- when: never | ||
|
||
Lint: | ||
rules: | ||
- when: never | ||
|
||
Test: | ||
rules: | ||
- when: never | ||
|
||
# NOTE(douglasduteil): use custom build job | ||
# The website it statically built with Nextjs | ||
# Here we manually run `yarn next export` and reuse the `out` dir in Dockerfile | ||
Build: | ||
needs: [] | ||
cache: | ||
key: | ||
files: | ||
- yarn.lock | ||
prefix: ${CI_JOB_NAME} | ||
paths: | ||
- .cache | ||
script: | ||
- yarn config set cache-folder $CI_PROJECT_DIR/.cache/yarn | ||
- yarn --frozen-lockfile --prefer-offline | ||
- yarn next build | ||
- yarn next export | ||
variables: | ||
VERSION: ${CI_COMMIT_SHORT_SHA} | ||
artifacts: | ||
expire_in: 1 day | ||
paths: | ||
- out | ||
|
||
# NOTE(julienbouquillon): use custom register job | ||
# By default, kosko-charts use a "/app" for default docker images names | ||
# TODO: discuss | ||
Register image: | ||
extends: .autodevops_register_image | ||
variables: | ||
IMAGE_NAME: $CI_REGISTRY_IMAGE/app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { createNamespace } from "@socialgouv/kosko-charts/utils/createNamespace"; | ||
|
||
const manifests = createNamespace(); | ||
|
||
export default manifests; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import env from "@kosko/env" | ||
|
||
import { create } from "@socialgouv/kosko-charts/components/app" | ||
|
||
const manifests = create("app", { | ||
env, | ||
config: { containerPort: 3000 }, | ||
deployment: { | ||
container: { | ||
resources: { | ||
requests: { | ||
cpu: "50m", | ||
memory: "128Mi", | ||
}, | ||
limits: { | ||
cpu: "200m", | ||
memory: "256Mi", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
|
||
export default manifests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
CI_COMMIT_BEFORE_SHA=ae724d33b9dfe463812eb3890bba85c259a05e73 | ||
CI_COMMIT_BRANCH=beta-db-12 | ||
CI_COMMIT_DESCRIPTION= | ||
CI_COMMIT_MESSAGE=build(k8s): add dummy drop-db job | ||
CI_COMMIT_REF_NAME=beta-db-12 | ||
CI_COMMIT_REF_PROTECTED=false | ||
CI_COMMIT_REF_SLUG=beta-db-12 | ||
CI_COMMIT_SHA=c58c0974f7023063b1296d3a5a285b46b92771f8 | ||
CI_COMMIT_TAG=xyz42 | ||
CI_COMMIT_SHORT_SHA=c58c0974 | ||
CI_COMMIT_TITLE=build(k8s): add dummy drop-db job | ||
CI_ENVIRONMENT_NAME=beta-db-12-dev2 | ||
CI_ENVIRONMENT_SLUG=beta-db-12-dev2 | ||
CI_ENVIRONMENT_URL=https://beta-db-12-dev2-sample-next-app.dev2.fabrique.social.gouv.fr | ||
CI_PROJECT_DIR=/builds/SocialGouv/sample-next-app | ||
CI_PROJECT_ID=85 | ||
CI_PROJECT_NAME=sample-next-app | ||
CI_PROJECT_NAMESPACE=SocialGouv | ||
CI_PROJECT_PATH=SocialGouv/sample-next-app | ||
CI_PROJECT_PATH_SLUG=socialgouv-sample-next-app | ||
CI_PROJECT_REPOSITORY_LANGUAGES=javascript,shell,plpgsql,dockerfile,tsql | ||
CI_PROJECT_TITLE=sample-next-app | ||
CI_PROJECT_URL=https://gitlab.factory.social.gouv.fr/SocialGouv/sample-next-app | ||
CI_PROJECT_VISIBILITY=public | ||
CI_REGISTRY_IMAGE=registry.gitlab.factory.social.gouv.fr/socialgouv/sample-next-app | ||
CI_REGISTRY_PASSWORD=[MASKED] | ||
CI_REGISTRY_USER=gitlab-ci-token | ||
KUBE_INGRESS_BASE_DOMAIN=dev2.fabrique.social.gouv.fr | ||
KUBE_NAMESPACE=sample-next-app-85-beta-db-12-dev2 | ||
RANCHER_PROJECT_ID=c-f8qps:p-46tj7 | ||
ENABLE_AZURE_POSTGRES=1 | ||
AUTO_DEVOPS_DEV_ENVIRONMENT_NAME=-dev2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: app-configmap | ||
data: | ||
NODE_ENV: "production" | ||
PORT: "3000" | ||
NEXT_PUBLIC_MATOMO_URL: "https://matomo.fabrique.social.gouv.fr/" | ||
NEXT_PUBLIC_MATOMO_SITE_ID: "33" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: app-configmap | ||
data: | ||
NODE_ENV: "production" | ||
PORT: "3000" | ||
NEXT_PUBLIC_MATOMO_URL: "https://matomo.fabrique.social.gouv.fr/" | ||
NEXT_PUBLIC_MATOMO_SITE_ID: "33" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: app-configmap | ||
data: | ||
NODE_ENV: "production" | ||
PORT: "3000" | ||
NEXT_PUBLIC_MATOMO_URL: "https://matomo.fabrique.social.gouv.fr/" | ||
NEXT_PUBLIC_MATOMO_SITE_ID: "33" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
components = ["*"] | ||
require = ["ts-node/register"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const fs = require("fs"); | ||
const toml = require("toml"); | ||
|
||
const data = toml.parse( | ||
fs.readFileSync(`${__dirname}/../socialgouv.toml`, "utf-8") | ||
); | ||
console.dir(data); | ||
|
||
("use strict"); | ||
|
||
const env = require("@kosko/env"); | ||
const { generate, print, PrintFormat } = require("@kosko/generate"); | ||
const { join } = require("path"); | ||
|
||
(async () => { | ||
// Set environment | ||
env.env = "dev"; | ||
|
||
// Set CWD (Optional) | ||
env.cwd = __dirname; | ||
|
||
// Generate manifests | ||
const result = await generate({ | ||
path: join(env.cwd, "components"), | ||
components: ["*"], | ||
baseEnvironment: "_base", | ||
}); | ||
|
||
// Print manifests to stdout | ||
print(result, { | ||
format: PrintFormat.YAML, | ||
writer: process.stdout, | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"license": "Apache-2.0", | ||
"scripts": { | ||
"generate": "kosko generate", | ||
"generate:dev": "kosko generate --env dev", | ||
"generate:prod": "kosko generate --env prod", | ||
"gitlab": "DOTENV_CONFIG_PATH=./environments/.gitlab-ci.env kosko generate --require dotenv/config", | ||
"gitlab:dev": "yarn --silent gitlab --env dev", | ||
"gitlab:preprod": "yarn --silent gitlab --env preprod", | ||
"gitlab:prod": "yarn --silent gitlab --env prod", | ||
"xxx": "DOTENV_CONFIG_PATH=./environments/.gitlab-ci.env npx ts-node --require dotenv/config ./main.js" | ||
}, | ||
"dependencies": { | ||
"@kosko/env": "^0.5.2", | ||
"@socialgouv/kosko-charts": "^3.2.2", | ||
"kubernetes-models": "^1.0.1", | ||
"toml": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"@kubernetes-models/sealed-secrets": "^1.0.1", | ||
"@types/node": "^14.14.7", | ||
"dotenv": "^8.2.0", | ||
"kosko": "^0.9.2", | ||
"ts-node": "^9.0.0", | ||
"typescript": "^4.0.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"esModuleInterop": true, | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"strict": true, | ||
"target": "es2015", | ||
"types": ["node"] | ||
} | ||
} |
Oops, something went wrong.