--- apiVersion: tekton.dev/v1 kind: Task metadata: name: ruby-tracer-clone-task spec: params: - name: revision type: string workspaces: - name: task-pvc mountPath: /workspace steps: - name: clone # alpine/git:2.43.0 image: alpine/git@sha256:6ff4de047dcc8f0c7d75d2efff63fbc189e87d2f458305f2cc8f165ff83309cf script: | #!/bin/sh echo "Cloning repo" cd /workspace && git clone --depth 1 -b $(params.revision) https://github.com/instana/ruby-sensor ls -lah /workspace --- apiVersion: tekton.dev/v1 kind: Task metadata: name: ruby-tracer-unittest-rails-sqlite3-task spec: params: - name: imageDigest type: string - name: gemfile type: string workspaces: - name: task-pvc mountPath: /workspace steps: - name: unittest image: ruby@$(params.imageDigest) env: - name: TEST_CONFIGURATION value: rails - name: BUNDLE_GEMFILE value: $(params.gemfile) - name: DATABASE_URL value: "sqlite3::memory:" workingDir: /workspace/ruby-sensor/ command: - /workspace/ruby-sensor/.tekton/run_unittests.sh --- apiVersion: tekton.dev/v1 kind: Task metadata: name: ruby-tracer-unittest-rails-mysql2-task spec: sidecars: # MySQL (compatible Mariadb) - name: mariadb # mariadb:11.3.2 image: mariadb@sha256:851f05fe1e4cb290442c1b12b7108436a33fd8f6a733d4989950322d06d45c65 startupProbe: initialDelaySeconds: 10 tcpSocket: port: 3306 env: - name: MYSQL_ROOT_PASSWORD # or MARIADB_ROOT_PASSWORD value: passw0rd - name: MYSQL_DATABASE # or MARIADB_DATABASE value: ci_test params: - name: imageDigest type: string - name: gemfile type: string workspaces: - name: task-pvc mountPath: /workspace steps: - name: unittest image: ruby@$(params.imageDigest) env: - name: TEST_CONFIGURATION value: rails - name: BUNDLE_GEMFILE value: $(params.gemfile) - name: DATABASE_URL value: "mysql2://root:passw0rd@127.0.0.1:3306/ci_test" workingDir: /workspace/ruby-sensor/ command: - /workspace/ruby-sensor/.tekton/run_unittests.sh --- apiVersion: tekton.dev/v1 kind: Task metadata: name: ruby-tracer-unittest-rails-postgres-task spec: sidecars: - name: postgres # postgres:16.2-bookworm image: postgres@sha256:6b841c8f6a819884207402f1209a8116844365df15fca8cf556fc54a24c70800 startupProbe: initialDelaySeconds: 10 tcpSocket: port: 5432 env: - name: POSTGRES_DB value: 'ci_test' - name: POSTGRES_USER value: 'root' - name: POSTGRES_PASSWORD value: 'passw0rd' params: - name: imageDigest type: string - name: gemfile type: string workspaces: - name: task-pvc mountPath: /workspace steps: - name: unittest image: ruby@$(params.imageDigest) env: - name: TEST_CONFIGURATION value: rails - name: BUNDLE_GEMFILE value: $(params.gemfile) - name: DATABASE_URL value: "postgres://root:passw0rd@127.0.0.1:5432/ci_test" workingDir: /workspace/ruby-sensor/ command: - /workspace/ruby-sensor/.tekton/run_unittests.sh --- apiVersion: tekton.dev/v1 kind: Task metadata: name: ruby-tracer-unittest-aws-libraries-task spec: sidecars: # Amazon DynamoDB - name: dynamodb # amazon/dynamodb-local:2.3.0 image: amazon/dynamodb-local@sha256:0e42a967205042118277be031a59f7aa035c2f90b1695b1b3250d0ce03a7c8f0 startupProbe: tcpSocket: port: 8000 initialDelaySeconds: 10 # Amazon S3 - name: s3 # minio/minio:RELEASE.2024-03-07T00-43-48Z image: minio/minio@sha256:9224601c529f424e5efac79f95606f0c7e1fe234f3f45344a49deaccd66d5bf5 command: - /usr/bin/minio - server - /data # Amazon SNS - name: sns # s12v/sns:latest image: s12v/sns@sha256:a80f1cd6318d22419cab38650ee6824f72cc2dc902d2b38e4f997d0530fe4e07 # Amazon SQS - name: sqs # softwaremill/elasticmq-native:1.5.7 image: softwaremill/elasticmq-native@sha256:9183333a9ea4666686c37dc83a2b1f8cee9c15ffd161a219a131e171039f1ac3 params: - name: imageDigest type: string - name: gemfile type: string workspaces: - name: task-pvc mountPath: /workspace steps: - name: unittest image: ruby@$(params.imageDigest) env: - name: TEST_CONFIGURATION value: libraries - name: BUNDLE_GEMFILE value: $(params.gemfile) workingDir: /workspace/ruby-sensor/ command: - /workspace/ruby-sensor/.tekton/run_unittests.sh --- apiVersion: tekton.dev/v1 kind: Task metadata: name: ruby-tracer-unittest-redis-libraries-task spec: sidecars: # Redis - name: redis # redis:7.2.4-bookworm image: redis@sha256:fe98b2d39d462d06a7360e2860dd6ceff930745e3731eccb3c1406dd0dd7f744 startupProbe: initialDelaySeconds: 10 tcpSocket: port: 6379 params: - name: imageDigest type: string - name: gemfile type: string workspaces: - name: task-pvc mountPath: /workspace steps: - name: unittest image: ruby@$(params.imageDigest) env: - name: TEST_CONFIGURATION value: libraries - name: BUNDLE_GEMFILE value: $(params.gemfile) workingDir: /workspace/ruby-sensor/ command: - /workspace/ruby-sensor/.tekton/run_unittests.sh --- apiVersion: tekton.dev/v1 kind: Task metadata: name: ruby-tracer-unittest-memcached-libraries-task spec: sidecars: # Memcached - name: memcached # memcached:1.6.24-bookworm image: memcached@sha256:b2b562323463b6cda240a148fb2a5b7ea86e8017a8509e10a3c7f1681f259193 startupProbe: tcpSocket: port: 11211 initialDelaySeconds: 20 params: - name: imageDigest type: string - name: gemfile type: string workspaces: - name: task-pvc mountPath: /workspace steps: - name: unittest image: ruby@$(params.imageDigest) env: - name: TEST_CONFIGURATION value: libraries - name: BUNDLE_GEMFILE value: $(params.gemfile) workingDir: /workspace/ruby-sensor/ command: - /workspace/ruby-sensor/.tekton/run_unittests.sh --- apiVersion: tekton.dev/v1 kind: Task metadata: name: ruby-tracer-unittest-mongo-libraries-task spec: sidecars: - name: mongo # mongo:5.0.25-focal image: mongo@sha256:d1b8a7b77424347397653ab8ff500c66b1e9979b4cebf826951d37b0d3966721 startupProbe: initialDelaySeconds: 10 tcpSocket: port: 27017 params: - name: imageDigest type: string - name: gemfile type: string workspaces: - name: task-pvc mountPath: /workspace steps: - name: unittest image: ruby@$(params.imageDigest) env: - name: TEST_CONFIGURATION value: libraries - name: BUNDLE_GEMFILE value: $(params.gemfile) workingDir: /workspace/ruby-sensor/ command: - /workspace/ruby-sensor/.tekton/run_unittests.sh --- apiVersion: tekton.dev/v1 kind: Task metadata: name: ruby-tracer-unittest-default-libraries-task spec: params: - name: imageDigest type: string - name: configuration type: string - name: gemfile type: string workspaces: - name: task-pvc mountPath: /workspace steps: - name: unittest image: ruby@$(params.imageDigest) env: - name: TEST_CONFIGURATION value: $(params.configuration) - name: BUNDLE_GEMFILE value: $(params.gemfile) workingDir: /workspace/ruby-sensor/ command: - /workspace/ruby-sensor/.tekton/run_unittests.sh --- apiVersion: tekton.dev/v1 kind: Task metadata: name: ruby-tracer-unittest-sequel-sqlite3-task spec: params: - name: imageDigest type: string - name: gemfile type: string workspaces: - name: task-pvc mountPath: /workspace steps: - name: unittest image: ruby@$(params.imageDigest) env: - name: TEST_CONFIGURATION value: libraries - name: BUNDLE_GEMFILE value: $(params.gemfile) - name: DATABASE_URL value: "sqlite3::memory:" workingDir: /workspace/ruby-sensor/ command: - /workspace/ruby-sensor/.tekton/run_unittests.sh --- apiVersion: tekton.dev/v1 kind: Task metadata: name: ruby-tracer-unittest-sequel-mysql2-task spec: sidecars: # MySQL (compatible Mariadb) - name: mariadb # mariadb:11.3.2 image: mariadb@sha256:851f05fe1e4cb290442c1b12b7108436a33fd8f6a733d4989950322d06d45c65 startupProbe: initialDelaySeconds: 10 tcpSocket: port: 3306 env: - name: MYSQL_ROOT_PASSWORD # or MARIADB_ROOT_PASSWORD value: passw0rd - name: MYSQL_DATABASE # or MARIADB_DATABASE value: ci_test params: - name: imageDigest type: string - name: gemfile type: string workspaces: - name: task-pvc mountPath: /workspace steps: - name: unittest image: ruby@$(params.imageDigest) env: - name: TEST_CONFIGURATION value: libraries - name: BUNDLE_GEMFILE value: $(params.gemfile) - name: DATABASE_URL value: "mysql2://root:passw0rd@127.0.0.1:3306/ci_test" workingDir: /workspace/ruby-sensor/ command: - /workspace/ruby-sensor/.tekton/run_unittests.sh --- apiVersion: tekton.dev/v1 kind: Task metadata: name: ruby-generate-currency-report-task spec: workspaces: - name: task-pvc mountPath: /workspace steps: - name: generate-currency-report # 3.10.13-bookworm image: python@sha256:c970ff53939772f47b0672e380328afb50d8fd1c0568ed4f82c22effc54244fc script: | #!/usr/bin/env bash cd /workspace/ruby-sensor/.tekton/.currency python -m venv /tmp/venv source /tmp/venv/bin/activate pip install -r resources/requirements.txt python scripts/generate_report.py if [ $? -ne 0 ]; then echo "Error occured while generating the ruby tracer currency report." >&2 exit 1 fi cat docs/report.md --- apiVersion: tekton.dev/v1 kind: Task metadata: name: ruby-upload-currency-report-task spec: params: - name: github-token-secret default: instanacd-github-api-token workspaces: - name: task-pvc mountPath: /workspace steps: - name: upload-currency-report # alpine/git:2.43.0 image: alpine/git@sha256:6ff4de047dcc8f0c7d75d2efff63fbc189e87d2f458305f2cc8f165ff83309cf env: - name: GH_ENTERPRISE_TOKEN valueFrom: secretKeyRef: name: $(params.github-token-secret) key: "GH_ENTERPRISE_TOKEN" script: | #!/bin/sh cd /workspace git clone https://oauth2:$GH_ENTERPRISE_TOKEN@github.ibm.com/instana/tracer-reports.git if [ $? -ne 0 ]; then echo "The attempt to clone the tracer-reports repository failed, preventing the upload of ruby tracer currency report." >&2 exit 1 fi cd tracer-reports cp ../ruby-sensor/.tekton/.currency/docs/report.md ./automated/currency/ruby/report.md git config user.name "Instanacd PAT for GitHub Enterprise" git config user.email instana.ibm.github.enterprise@ibm.com git add . git commit -m "chore: Updated ruby currency report" git push origin main