This file contains hidden or 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
| ssh -o StrictHostKeyChecking=no -t -t \ | |
| -i ./github_id_rsa "${SHH_USER}@${BASTION_IP}" \ | |
| -L "3306:${MYSQL_IP}:3306" & |
This file contains hidden or 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
| package reverse_proxy | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "github.com/viggin/svc-api-gateway/internal/models" | |
| "github.com/gin-gonic/gin" | |
| "github.com/google/uuid" | |
| "github.com/palantir/stacktrace" | |
| "github.com/sirupsen/logrus" |
This file contains hidden or 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
| { | |
| "version": 18, | |
| "totalPrice": { | |
| "type": "centPrecision", | |
| "fractionDigits": 2, | |
| "currencyCode": "USD", | |
| "centAmount": 77600 | |
| }, | |
| "taxRoundingMode": "HalfEven", | |
| "taxMode": "External", |
This file contains hidden or 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
| func calcTotalDiscount(currentCart *commercetools.Cart, response *cart_service.CartPriceSummeryResponse) { | |
| if len(currentCart.DiscountCodes) != 0 { | |
| for _, lineItem := range currentCart.LineItems { | |
| for _, discountedPrice := range lineItem.DiscountedPricePerQuantity { | |
| response.TotalDiscount += centAmount(discountedPrice.DiscountedPrice.Value) * int32(discountedPrice.Quantity) | |
| } | |
| } | |
| for _,code := range currentCart.DiscountCodes { | |
| if code.State == commercetools.DiscountCodeStateMatchesCart { | |
| for _, cartDiscount := range code.DiscountCode.Obj.CartDiscounts { |
This file contains hidden or 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
| { | |
| "version": 17, | |
| "totalPrice": { | |
| "type": "centPrecision", | |
| "fractionDigits": 2, | |
| "currencyCode": "USD", | |
| "centAmount": 4930000 | |
| }, | |
| "taxedPrice": { | |
| "totalNet": { |
This file contains hidden or 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
| apiVersion: v1 | |
| kind: ServiceAccount | |
| metadata: | |
| name: {{ .Release.Name }} | |
| namespace: {{ .Release.Namespace }} | |
| annotations: | |
| iam.gke.io/gcp-service-account: argocd-backup@<GCP-PROJECT_KEY>.iam.gserviceaccount.com | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1 | |
| kind: ClusterRole |
This file contains hidden or 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
| #!/bin/zsh | |
| gsutil mb gs://argocd-backup | |
| gcloud iam service-accounts create argocd-backup \ | |
| --description="argocd-backup utils" \ | |
| --display-name="argocd-backup" | |
| gsutil iam ch serviceAccount:argocd-backup@<PROJECT_KEY>.iam.gserviceaccount.com:objectAdmin gs://argocd-backup |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| set -x | |
| argocd-util -n argocd export > backup.yaml | |
| gsutil cp backup.yaml "gs://rgocd-backup/backup-$(date +%y-%m-%d).yaml" |
This file contains hidden or 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
| FROM argoproj/argocd:latest | |
| WORKDIR /app | |
| COPY do-backup.bash /app/app | |
| USER root | |
| RUN apt-get update -y | |
| RUN apt-get upgrade -y | |
| RUN apt install python curl bash -y | |
| RUN curl -sSL "https://sdk.cloud.google.com" | bash | |
| ENV PATH $PATH:/root/google-cloud-sdk/bin | |
| CMD ["/app/app"] |
This file contains hidden or 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
| docker run -v ~/.kube:/home/argocd/.kube \ | |
| --rm argoproj/argocd:latest \ | |
| argocd-util -n argocd export > backup.yaml |