-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added pipeline added brew.sh script
- Loading branch information
Showing
6 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Testnet CD for graphix | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
deploy: | ||
uses: ./.github/workflows/template-deploy.yaml | ||
with: | ||
ENVIRONMENT: testnet | ||
secrets: | ||
GCP_SECRET: ${{ secrets.GCP_GRAPH_NETWORK }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Template Deploy | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
GCP_PROJECT_ID: | ||
required: false | ||
type: string | ||
default: graph-mainnet | ||
ENVIRONMENT: | ||
required: false | ||
type: string | ||
default: testnet | ||
ENABLE_DIFF: | ||
required: false | ||
type: boolean | ||
default: true | ||
ENABLE_APPLY: | ||
required: false | ||
type: boolean | ||
default: false | ||
secrets: | ||
GCP_SECRET: | ||
required: true | ||
TRANSCRYPT: | ||
required: true | ||
|
||
jobs: | ||
template-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v3 | ||
|
||
- id: "auth" | ||
uses: "google-github-actions/auth@v0" | ||
with: | ||
credentials_json: ${{ secrets.GCP_SECRET }} | ||
|
||
- name: Set up Cloud SDK | ||
uses: google-github-actions/setup-gcloud@v0 | ||
with: | ||
project_id: ${{ inputs.GCP_PROJECT_ID }} | ||
|
||
- name: Enable homebrew | ||
uses: raviqqe/[email protected] | ||
|
||
- name: Install infrastructure tools | ||
run: ./brew.sh | ||
|
||
- name: Diff ${{ inputs.ENVIRONMENT }} | ||
if: inputs.ENABLE_DIFF | ||
working-directory: k8s/${{ inputs.ENVIRONMENT }} | ||
run: ./diff.sh | ||
|
||
- name: Deploy to ${{ inputs.ENVIRONMENT }} cluster | ||
if: inputs.ENABLE_APPLY | ||
working-directory: k8s/${{ inputs.ENVIRONMENT }} | ||
run: ./apply.sh |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
# brew install transcrypt # encrypt/decrypt secrets | ||
brew install jsonnet # jsonnet is a superset of json | ||
brew install jsonnet-bundler # manage jsonnet packages with lock file | ||
brew install helm | ||
brew install jq | ||
|
||
brew install cask google-cloud-sdk | ||
gcloud components install gke-gcloud-auth-plugin | ||
|
||
curl -fSL -o "/usr/local/bin/tk" "https://github.com/grafana/tanka/releases/download/v0.22.1/tk-linux-amd64" | ||
chmod a+x "/usr/local/bin/tk" | ||
|
||
curl -LO "https://dl.k8s.io/release/v1.24.1/bin/linux/amd64/kubectl" | ||
chmod +x ./kubectl | ||
mv ./kubectl /usr/local/bin/kubectl |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: graphix | ||
labels: | ||
app: graphix | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: graphix | ||
template: | ||
metadata: | ||
labels: | ||
app: graphix | ||
annotations: | ||
prometheus.io/scrape: "true" | ||
prometheus.io/path: "/metrics" | ||
prometheus.io/port: "7300" | ||
spec: | ||
# tolerations: | ||
# - key: "graphix" | ||
# operator: "Exists" | ||
# effect: "NoSchedule" | ||
# affinity: | ||
# nodeAffinity: | ||
# requiredDuringSchedulingIgnoredDuringExecution: | ||
# nodeSelectorTerms: | ||
# - matchExpressions: | ||
# - key: "graphix" | ||
# operator: In | ||
# values: | ||
# - "1" | ||
imagePullSecrets: | ||
- name: docker-registry | ||
|
||
volumes: | ||
- name: graphix-config | ||
secret: | ||
secretName: graphix-config | ||
- name: redpanda-certificates | ||
secret: | ||
secretName: redpanda-certificates | ||
|
||
containers: | ||
- name: graphix | ||
image: graphix:to-be-replaced-by-kustomize | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- name: graphix | ||
containerPort: 80 | ||
- name: metrics | ||
containerPort: 7300 | ||
# readinessProbe: | ||
# httpGet: | ||
# path: / | ||
# port: graphix | ||
# timeoutSeconds: 5 | ||
# volumeMounts: | ||
# - name: graphix-config | ||
# mountPath: /opt/graphix/config | ||
# readOnly: true | ||
# - name: redpanda-certificates | ||
# mountPath: /redpanda_config | ||
# readOnly: true | ||
# env: | ||
# - name: RUST_LOG | ||
# value: info,graph_graphix=debug,indexer_selection=debug | ||
command: | ||
- sleep | ||
- infinte | ||
# args: | ||
# - "/opt/graphix/config/config" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- deployment.yaml | ||
# - service.yaml | ||
# - ingress.yaml | ||
# - servicemonitor.yaml | ||
|
||
images: | ||
- name: graphix | ||
newName: edgeandnode/graphix-cross-checker | ||
newTag: latest |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
bases: | ||
- ../base |