diff --git a/magicleaps/helm-pkg/magicleaps/values.alpha.yaml b/magicleaps/helm-pkg/magicleaps/values.alpha.yaml index 651337a8..63106e22 100644 --- a/magicleaps/helm-pkg/magicleaps/values.alpha.yaml +++ b/magicleaps/helm-pkg/magicleaps/values.alpha.yaml @@ -1,4 +1,3 @@ - global: registry: docker.io repository: sunzhenyucn diff --git a/magicleaps/helm-pkg/magicleaps/values.prod.yaml b/magicleaps/helm-pkg/magicleaps/values.prod.yaml new file mode 100644 index 00000000..844f1ace --- /dev/null +++ b/magicleaps/helm-pkg/magicleaps/values.prod.yaml @@ -0,0 +1,109 @@ +global: + registry: docker.io + repository: sunzhenyucn + nodeSelector: {} +frontend: + replicas: 1 + image: + registry: + repository: sunzhenyucn + name: magicleaps-frontend + tag: 1.0.0 + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 80 + protocol: TCP + resources: + requests: + cpu: "50m" + memory: "128Mi" + limits: + cpu: "100m" + memory: "256Mi" + probes: + liveness: + type: httpGet + config: + path: / + port: 80 + readiness: + type: httpGet + config: + path: / + port: 80 + services: + - name: magicleaps-frontend-service + type: ClusterIP + port: 80 + targetPort: 80 + ingresses: + - name: magicleaps-frontend-ingress + host: magicleaps.mathmast.com + class: nginx + rules: + - path: /* + pathType: ImplementationSpecific + backend: + service: + name: magicleaps-frontend-service + port: + number: 80 + tls: + exists: false + issuerRef: + name: mathmast-dot-com + kind: ClusterIssuer + name: magicleaps-frontend-ingress-tls + configs: + tz: "America/Settle" +backend: + replicas: 1 + image: + registry: + repository: sunzhenyucn + name: magicleaps-backend + tag: 1.0.0 + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 8081 + protocol: TCP + resources: + requests: + cpu: "100m" + memory: "256Mi" + limits: + cpu: "200m" + memory: "512Mi" + probes: + liveness: + type: httpGet + config: + path: /api/_/probe/liveness + port: 8081 + readiness: + type: httpGet + config: + path: /api/_/probe/readiness + port: 8081 + services: + - name: magicleaps-backend-service + type: ClusterIP + port: 8081 + targetPort: 8081 + ingresses: + configs: + tz: "America/Settle" + mongodbHost: "mongodb.magicleaps.svc.cluster.local" + mongodbPort: "27017" + mongodbName: "interview" + emailUser: "your@freeleaps.com" + emailPassword: "your-password" + superAdmin: "your@email.com" + twilioAccountSid: "" + twilioAuthToken: "" + eveluationTaskFolderBase: "temp/interview/eveluation_task/" + logDir: "logs" + appLogFile: "app.log" + appLogLevel: "INFO" diff --git a/magicleaps/prod/argo-app/application.yaml b/magicleaps/prod/argo-app/application.yaml new file mode 100644 index 00000000..25e82a93 --- /dev/null +++ b/magicleaps/prod/argo-app/application.yaml @@ -0,0 +1,24 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: magicleaps + namespace: freeleaps-devops-system +spec: + destination: + name: "" + namespace: magicleaps + server: https://kubernetes.default.svc + source: + path: magicleaps/helm-pkg/magicleaps + repoURL: https://freeleaps@dev.azure.com/freeleaps/freeleaps-ops/_git/freeleaps-ops + targetRevision: HEAD + helm: + parameters: [] + valueFiles: + - values.prod.yaml + sources: [] + project: magicleaps + syncPolicy: + automated: + prune: true + selfHeal: true diff --git a/magicleaps/prod/argo-app/project.yaml b/magicleaps/prod/argo-app/project.yaml new file mode 100644 index 00000000..63dfd27c --- /dev/null +++ b/magicleaps/prod/argo-app/project.yaml @@ -0,0 +1,10 @@ +apiVersion: argoproj.io/v1alpha1 +kind: AppProject +metadata: + name: magicleaps + namespace: freeleaps-devops-system +spec: + destinations: + - name: in-cluster + namespace: magicleaps + server: https://kubernetes.default.svc diff --git a/magicleaps/prod/ci/Jenkinsfile b/magicleaps/prod/ci/Jenkinsfile new file mode 100644 index 00000000..fd366ae4 --- /dev/null +++ b/magicleaps/prod/ci/Jenkinsfile @@ -0,0 +1,56 @@ +library 'first-class-pipeline' + +executeFreeleapsPipeline { + serviceName = 'magicleaps' + environmentSlug = 'prod' + serviceGitBranch = 'master' + serviceGitRepo = "https://freeleaps@dev.azure.com/freeleaps/magicleaps/_git/magicleaps" + serviceGitRepoType = 'monorepo' + serviceGitCredentialsId = 'magicleaps-azure-devops-credentials' + executeMode = 'fully' + commitMessageLintEnabled = true + components = [ + [ + name: 'frontend', + root: 'frontend', + language: 'javascript', + dependenciesManager: 'npm', + npmPackageJsonFile: 'package.json', + buildCacheEnabled: true, + buildAgentImage: 'node:lts', + buildCommand: 'echo "Vue 3 & Webpack cause pod OOM, so we just skip it."', + buildArtifacts: ['Dockerfile'], + lintEnabled: false, + sastEnabled: false, + imageRegistry: 'docker.io', + imageRepository: 'sunzhenyucn', + imageName: 'magicleaps-frontend', + imageBuilder: 'dind', + dockerfilePath: 'Dockerfile', + imageBuildRoot: '.', + imageReleaseArchitectures: ['linux/amd64', 'linux/arm64/v8'], + registryCredentialsId: 'magicleaps-dockerhub-credentials', + semanticReleaseEnabled: true + ], + [ + name: 'backend', + root: 'backend', + language: 'python', + dependenciesManager: 'pip', + buildAgentImage: 'python:3.8-slim-buster', + buildArtifacts: ['.'], + buildCacheEnabled: true, + lintEnabled: false, + sastEnabled: false, + imageRegistry: 'docker.io', + imageRepository: 'sunzhenyucn', + imageName: 'magicleaps-backend', + imageBuilder: 'dind', + dockerfilePath: 'Dockerfile', + imageBuildRoot: '.', + imageReleaseArchitectures: ['linux/amd64', 'linux/arm64/v8'], + registryCredentialsId: 'magicleaps-dockerhub-credentials', + semanticReleaseEnabled: true + ] + ] +} \ No newline at end of file