Commit 9ccf7d62 authored by Grant's avatar Grant
Browse files

Merge branch 'main' into doc-readme

parents 4154ad60 b76408bd
Loading
Loading
Loading
Loading

.eslintrc.json

0 → 100644
+9 −0
Original line number Diff line number Diff line
{
  "root": true,
  "ignorePatterns": ["node_modules", "packages/**/dist"],
  "plugins": ["simple-import-sort"],
  "rules": {
    "simple-import-sort/imports": "error",
    "simple-import-sort/exports": "error"
  }
}
+33 −28
Original line number Diff line number Diff line
stages:
  - publish
  - lint
  - build
  - test
  - deploy

variables:
  REGISTRY: registry.sc07.dev
  IMAGE_NAME: sc07/canvas:edge
eslint client:
  stage: lint
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
      changes:
        - packages/client/src/**/*
  image: node:23-alpine
  script:
    - npm i --include=dev
    - npm -w packages/client run lint

publish:
  stage: publish
  tags:
    - red
eslint server:
  stage: lint
  rules:
    - if: $CI_COMMIT_BRANCH == "main"
    - changes:
        - "**/*.md"
      when: manual
  interruptible: true
  before_script:
    - echo $PAT | docker login $REGISTRY -u $GITLAB_USER_LOGIN --password-stdin
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
      changes:
        - packages/server/src/**/*
  image: node:23-alpine
  script:
    - docker build . --tag $REGISTRY/$IMAGE_NAME
    - docker push $REGISTRY/$IMAGE_NAME
    - npm i --include=dev
    - npm -w packages/server run lint

build wiki:
  stage: build
  trigger:
    include: .gitlab/ci/wiki.yml
  allow_failure: true
  rules:
    - if: $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

deploy:
  stage: deploy
  tags:
    - red
  trigger:
    include: .gitlab/ci/deploy.yml
  allow_failure: true
  rules:
    - if: $CI_COMMIT_BRANCH == "main"
    - changes:
        - "**/*.md"
      when: manual
  interruptible: true
  script:
    - cd $WORK_DIR
    - docker compose pull
    - docker compose up -d
    - if: $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

.gitlab/ci/deploy.yml

0 → 100644
+32 −0
Original line number Diff line number Diff line
variables:
  REGISTRY: registry.sc07.dev
  IMAGE_NAME: sc07/canvas:edge

publish:
  stage: build
  tags:
    - red
  interruptible: true
  before_script:
    - echo $PAT | docker login $REGISTRY -u $GITLAB_USER_LOGIN --password-stdin
  script:
    - |
      docker build --tag $REGISTRY/$IMAGE_NAME \
      --build-arg SENTRY_URL=$SENTRY_URL \
      --build-arg SENTRY_ORG=$SENTRY_ORG \
      --build-arg CLIENT_SENTRY_PROJECT=$CLIENT_SENTRY_PROJECT \
      --build-arg CLIENT_SENTRY_DSN=$CLIENT_SENTRY_DSN \
      --build-arg SERVER_SENTRY_PROJECT=$SERVER_SENTRY_PROJECT \
      --build-arg SERVER_SENTRY_DSN=$SERVER_SENTRY_DSN \
      --build-arg SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN .
    - docker push $REGISTRY/$IMAGE_NAME

deploy:
  stage: deploy
  tags:
    - red
  interruptible: true
  script:
    - cd $WORK_DIR
    - docker compose pull
    - docker compose up -d

.gitlab/ci/wiki.yml

0 → 100644
+16 −0
Original line number Diff line number Diff line
# sync /doc/ to internal wiki repo for UI access
# see #151
build-wiki:
  image: alpine
  stage: build
  before_script:
    - apk add --no-cache git git-subtree
  script:
    - git config user.email "ci@sc07.company"
    - git config user.name "ci"
    - git remote remove gitlab-wiki || true
    - git remote add gitlab-wiki "https://ci:$CI_TOKEN@sc07.dev/sc07/canvas.wiki.git"
    - git status
    - git checkout main
    - git pull
    - git push gitlab-wiki `git subtree split -P doc main`:main --force

.gitlab/dependabot.yml

0 → 100644
+24 −0
Original line number Diff line number Diff line
version: 2
update-options:
  rebase-strategy: all
  reviewers:
    - grant
  vulnerability-alerts:
    enabled: true
    confidential: true
    assignees:
      - grant
updates:
  - package-ecosystem: "npm"
    directories:
      - "/"
      - "/packages/admin"
      - "/packages/client"
      - "/packages/lib"
      - "/packages/server"
    schedule:
      interval: "daily"
  - package-ecosystem: "docker"
    directory: "/"
    schedule:
      interval: "weekly"
Loading