From e4995c81184412380f678996038cfef65c18f506 Mon Sep 17 00:00:00 2001 From: Zheyuan Wu <60459821+Trance-0@users.noreply.github.com> Date: Sat, 25 Oct 2025 01:18:03 -0500 Subject: [PATCH] check passed. --- components/navbar.client.tsx | 6 ++- content/_meta.js | 5 +++ docker/Jenkinsfile | 84 ++++++++++++++++++++++++++++++++++++ docker/docker-compose.yaml | 2 +- 4 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 docker/Jenkinsfile diff --git a/components/navbar.client.tsx b/components/navbar.client.tsx index 8a08698..761529b 100644 --- a/components/navbar.client.tsx +++ b/components/navbar.client.tsx @@ -105,9 +105,11 @@ export const ClientNavbar: FC<{ // filter out titles for elements in topLevelNavbarItems with non empty route const existingCourseNames = new Set( topLevelNavbarItems.filter( - item => !('href' in item) && item.route !== '' + item => !('href' in item) ).map(item => item.title) ) + console.log(existingCourseNames) + // filter out elements in topLevelNavbarItems with url but have title in existingCourseNames const filteredTopLevelNavbarItems = topLevelNavbarItems.filter(item => !('href' in item && existingCourseNames.has(item.title))) @@ -116,7 +118,7 @@ export const ClientNavbar: FC<{ const items = filteredTopLevelNavbarItems - console.log(topLevelNavbarItems) + console.log(filteredTopLevelNavbarItems) const themeConfig = useThemeConfig() const pathname = useFSRoute() diff --git a/content/_meta.js b/content/_meta.js index c4ab31a..4a5aa6e 100644 --- a/content/_meta.js +++ b/content/_meta.js @@ -34,6 +34,11 @@ export default { type: 'page', href: '/Math4111', }, + CSE559A_link: { + title: 'CSE 559A', + type: 'page', + href: '/CSE559A', + }, /* Math Courses End */ Math4201: { title: 'Math 4201', diff --git a/docker/Jenkinsfile b/docker/Jenkinsfile new file mode 100644 index 0000000..eec1593 --- /dev/null +++ b/docker/Jenkinsfile @@ -0,0 +1,84 @@ +pipeline { + environment { + registry = "trance0/notenextra" + version = "1.2" + NODE_OPTIONS = "--max-old-space-size=8192" + // NEXT_SEARCH_ALGOLIA_APP_ID = "${NEXT_SEARCH_ALGOLIA_APP_ID}" + // NEXT_SEARCH_ALGOLIA_API_KEY = "${NEXT_SEARCH_ALGOLIA_API_KEY}" + // NEXT_SEARCH_ALGOLIA_INDEX_NAME = "${NEXT_SEARCH_ALGOLIA_INDEX_NAME}" + } + + agent any + + stages { + stage('Cleanup Workspace') { + steps { + // Using Workspace Cleanup Plugin (if installed and configured) + cleanWs() + } + } + stage('Checkout') { + steps { + checkout([ + $class: 'GitSCM', + branches: [[ name: '*/main' ]], + userRemoteConfigs: [[ + url: 'https://github.com/Trance-0/NoteNextra', + ]] + ]) + } + } + stage('Build and test'){ + parallel { + stage('Build Math') { + steps { + script { + echo "Building docker image ${registry}-math:${version}.${env.BUILD_ID}" + def customImage = docker.build("${registry}-math:v${version}.${env.BUILD_ID}", + "-f ./docker/math/Dockerfile", + "--no-cache --progress=plain", + "-t notenextra-math:latest" + ) + echo "Logging in to docker hub" + // docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-creds') { + // echo "Pushing docker image ${registry}:v${version}.${env.BUILD_ID}" + // customImage.push() + // } + echo "skipping push due to conflicted servers" + } + } + } + stage('Build CSE') { + steps { + script { + echo "Building docker image ${registry}-cse:${version}.${env.BUILD_ID}" + def customImage = docker.build("${registry}-cse:v${version}.${env.BUILD_ID}", + "-f ./docker/cse/Dockerfile", + "--no-cache --progress=plain", + "-t notenextra-cse:latest" + ) + echo "Logging in to docker hub" + // docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-creds') { + // echo "Pushing docker image ${registry}:v${version}.${env.BUILD_ID}" + // customImage.push() + // } + echo "skipping push due to conflicted servers" + } + } + } + } + } + stage('Deploy') { + steps { + script { + echo "Stopping existing container" + sh 'docker compose -f ./docker/docker-compose.yaml down' + echo "Removing existing container" + sh 'docker compose -f ./docker/docker-compose.yaml rm -f' + echo "Deploying docker image ${registry}-math:${version}.${env.BUILD_ID} and ${registry}-cse:${version}.${env.BUILD_ID} with docker compose" + sh 'docker compose -f ./docker/docker-compose.yaml up -d' + } + } + } + } +} diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 80f35b9..83d345b 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -24,7 +24,7 @@ services: nginx: image: nginx:latest ports: - - 13003:80 + - 13000:80 volumes: - ./nginx.conf:/etc/nginx/nginx.conf depends_on: