common.tsx 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. import aws from "../assets/aws.png";
  2. import digitalOcean from "../assets/do.png";
  3. import gcp from "../assets/gcp.png";
  4. import github from "../assets/github.png";
  5. import azure from "assets/azure.png";
  6. export const infraNames: any = {
  7. ecr: "Elastic Container Registry (ECR)",
  8. eks: "Elastic Kubernetes Service (EKS)",
  9. gcr: "Google Container Registry (GCR)",
  10. gke: "Google Kubernetes Engine (GKE)",
  11. docr: "DigitalOcean Container Registry",
  12. doks: "DigitalOcean Kubernetes Service",
  13. };
  14. export const integrationList: any = {
  15. kubernetes: {
  16. icon:
  17. "https://upload.wikimedia.org/wikipedia/labs/thumb/b/ba/Kubernetes-icon-color.svg/2110px-Kubernetes-icon-color.svg.png",
  18. label: "Kubernetes",
  19. buttonText: "Add a Cluster",
  20. },
  21. repo: {
  22. icon: "https://git-scm.com/images/logos/downloads/Git-Icon-1788C.png",
  23. label: "Git Repository",
  24. buttonText: "Link a Github Account",
  25. },
  26. slack: {
  27. icon:
  28. "https://user-images.githubusercontent.com/5147537/54070671-0a173780-4263-11e9-8946-09ac0e37d8c6.png",
  29. label: "Slack",
  30. buttonText: "Install application",
  31. },
  32. registry: {
  33. icon:
  34. "https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/97_Docker_logo_logos-512.png",
  35. label: "Docker registry",
  36. buttonText: "Add a registry",
  37. },
  38. gke: {
  39. icon: "https://sysdig.com/wp-content/uploads/2016/08/GKE_color.png",
  40. label: "Google Kubernetes Engine (GKE)",
  41. },
  42. eks: {
  43. icon: "https://img.stackshare.io/service/7991/amazon-eks.png",
  44. label: "Amazon Elastic Kubernetes Service (EKS)",
  45. },
  46. test: {
  47. icon:
  48. "https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/97_Docker_logo_logos-512.png",
  49. label: "Testing",
  50. },
  51. kube: {
  52. icon:
  53. "https://uxwing.com/wp-content/themes/uxwing/download/10-brands-and-social-media/kubernetes.png",
  54. label: "Upload Kubeconfig",
  55. },
  56. dockerhub: {
  57. icon:
  58. "https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/97_Docker_logo_logos-512.png",
  59. label: "Docker Hub",
  60. },
  61. gcr: {
  62. icon:
  63. "https://carlossanchez.files.wordpress.com/2019/06/21046548.png?w=640",
  64. label: "Google Container Registry (GCR)",
  65. },
  66. gar: {
  67. icon:
  68. "https://carlossanchez.files.wordpress.com/2019/06/21046548.png?w=640",
  69. label: "Google Artifact Registry (GAR)",
  70. },
  71. ecr: {
  72. icon:
  73. "https://avatars2.githubusercontent.com/u/52505464?s=400&u=da920f994c67665c7ad6c606a5286557d4f8555f&v=4",
  74. label: "Elastic Container Registry (ECR)",
  75. },
  76. doks: {
  77. icon:
  78. "https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/97_Docker_logo_logos-512.png",
  79. label: "Digital Ocean Kubernetes Service (DOKS)",
  80. },
  81. docr: {
  82. icon:
  83. "https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/97_Docker_logo_logos-512.png",
  84. label: "Digital Ocean Container Registry (DOCR)",
  85. },
  86. aks: {
  87. icon:
  88. "https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/97_Docker_logo_logos-512.png",
  89. label: "Azure Kubernetes Service (AKS)",
  90. },
  91. acr: {
  92. icon:
  93. "https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/97_Docker_logo_logos-512.png",
  94. label: "Azure Container Registry (ACR)",
  95. },
  96. aws: {
  97. icon: aws,
  98. label: "AWS",
  99. },
  100. gcp: {
  101. icon: gcp,
  102. label: "GCP",
  103. tagline: "Email contact@porter.run"
  104. },
  105. azure: {
  106. icon: azure,
  107. label: "Azure",
  108. tagline: "Email contact@porter.run"
  109. },
  110. do: {
  111. icon: digitalOcean,
  112. label: "DigitalOcean",
  113. },
  114. github: {
  115. icon: github,
  116. label: "GitHub",
  117. },
  118. gitlab: {
  119. icon: "https://about.gitlab.com/images/press/logo/png/gitlab-icon-rgb.png",
  120. label: "GitLab",
  121. buttonText: "Add an Instance",
  122. },
  123. rds: {
  124. icon:
  125. "https://cdn2.iconfinder.com/data/icons/amazon-aws-stencils/100/Database_copy_Amazon_RDS-512.png",
  126. label: "Amazon Relational Database Service",
  127. },
  128. s3: {
  129. icon:
  130. "https://cdn2.iconfinder.com/data/icons/amazon-aws-stencils/100/Database_copy_Amazon_RDS-512.png",
  131. label: "Amazon S3 Bucket",
  132. },
  133. };
  134. export const isAlphanumeric = (x: string | null) => {
  135. let re = /^[a-z0-9-]+$/;
  136. if (!x || x.length == 0 || x.search(re) === -1) {
  137. return false;
  138. }
  139. return true;
  140. };
  141. export const getIgnoreCase = (object: any, key: string) => {
  142. return object[
  143. Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase())
  144. ];
  145. };
  146. export const PORTER_IMAGE_TEMPLATES = [
  147. "porterdev/hello-porter-job",
  148. "porterdev/hello-porter-job:latest",
  149. "public.ecr.aws/o1j4x7p4/hello-porter-job",
  150. "public.ecr.aws/o1j4x7p4/hello-porter-job:latest",
  151. "public.ecr.aws/o1j4x7p4/hello-porter",
  152. "public.ecr.aws/o1j4x7p4/hello-porter:latest",
  153. ];