Skip to content

Instantly share code, notes, and snippets.

@giang-pham
giang-pham / download_sentry_data.py
Last active December 21, 2022 15:45 — forked from siiramone/download_sentry_data.py
Download sentry events with a query for a project. Useful for data processing.
"""Download sentry data.
usage:
1. create auth token (https://sentry.io/settings/account/api/auth-tokens/).
2. make a directory for export if not exists.
$ mkdir data
3. fix query (L29).
4. install python and run pip3 install requests then execute
$ python download_sentry_data.py <org>/<project> <auth_token>
5. a CSV file with a name formatted as "./data/issues_YYYYmmDDHHMMSS.csv" is created.
"""
FROM alpine:3.10
RUN mkdir /opt/output && \
apk add --no-cache curl jq
ADD extract_report_count.sh /opt/run.sh
RUN chmod +x /opt/run.sh
ADD resources /opt/resources
WORKDIR /opt
ENTRYPOINT ["/opt/run.sh"]
version: '2'
services:
asia-log-scipt:
container_name: asia-log-script
build: .
image: /speeda/asia-log-script:1.0.0
volumes:
- /data/log/asia-log-script/:/opt/output/
FROM debian:bullseye-slim
ADD extract_report_count.sh /opt/run.sh
RUN chmod +x /opt/run.sh
ADD resources /opt/resources
RUN mkdir /opt/output && \
apt-get update && apt-get -y install curl jq
ENTRYPOINT ["/opt/run.sh"]
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: [APP_VS]
namespace: [APP]
spec:
gateways:
- default/default-gateway
hosts:
- [HOST]
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: [APP_VS]
namespace: [APP]
spec:
gateways:
- default/default-gateway
hosts:
- [HOST]
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: [APP_VS]
namespace: [APP]
spec:
gateways:
- default/default-gateway
hosts:
- [HOST]
apiVersion: v1
kind: Service
metadata:
name: [SERVICE]
labels:
app: [APP]
spec:
selector:
app: [APP]
ports:
def switchToBlue() {
sh(returnStdout: true, script: "kubectl apply -f deploy/k8s/prod/switch/vs-blue.yaml")
}
def switchToGreen() {
sh(returnStdout: true, script: "kubectl apply -f deploy/k8s/prod/switch/vs-green.yaml")
}
pipeline {
agent any
gcloud iam service-accounts keys create ~/key.json \
--iam-account [SA-NAME]@[PROJECT-ID].iam.gserviceaccount.com