Skip to content

Commit

Permalink
reusable
Browse files Browse the repository at this point in the history
  • Loading branch information
jbropho committed Feb 27, 2024
1 parent ca7b771 commit 156a3ce
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 44 deletions.
48 changes: 5 additions & 43 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,64 +9,26 @@ on:
- '[0-9]+.[0-9]+.[0-9]+'

jobs:
Explore-GitHub-Actions:
run_checks:
uses: ./.github/workflows/run_checks.yaml
deploy:
needs: run_checks
runs-on: ubuntu-latest
container: clojure:latest
environment: test
services:
kafka:
image: confluentinc/cp-kafka:5.1.3
env:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_AUTO_CREATE_TOPICS_ENABLE: true
KAFKA_BROKER_ID: 1
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
schema-registry:
image: confluentinc/cp-schema-registry:5.1.2
env:
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: 'zookeeper:2181'
kafka-rest:
image: confluentinc/cp-kafka-rest:6.1.1
env:
KAFKA_REST_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_REST_BOOTSTRAP_SERVERS: kafka:9092
KAFKA_REST_LISTENERS: http://0.0.0.0:8082
KAFKA_REST_SCHEMA_REGISTRY: http://schema-registry:8081
KAFKA_REST_HOST_NAME: kafka-rest
zookeeper:
image: confluentinc/cp-zookeeper:5.1.3
env:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 100
- name: build
run: |
git config --global --add safe.directory /__w/jackdaw/jackdaw
lein kaocha
env:
KAFKA_BOOTSTRAP_SERVERS: kafka
ZOOKEEPER_HOST: zoopkeeper
SCHEMA_REGISTRY_HOST: schema-registry
KAFKA_REST_PROXY_HOST: kafka-rest
- name: lint
run: lein clj-kondo --lint src test || true
- name: deploy
env:
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
run: |
git config --global --add safe.directory /__w/jackdaw/jackdaw
apt-get update
apt-get install -y gpg
echo $GPG_PRIVATE_KEY |base64 --decode |gpg --yes --batch --import
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/run_checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
run-name: Jackdaw build

on:
workflow_call:


jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
container: clojure:latest
services:
kafka:
image: confluentinc/cp-kafka:5.1.3
env:
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_AUTO_CREATE_TOPICS_ENABLE: true
KAFKA_BROKER_ID: 1
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
schema-registry:
image: confluentinc/cp-schema-registry:5.1.2
env:
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: 'zookeeper:2181'
kafka-rest:
image: confluentinc/cp-kafka-rest:6.1.1
env:
KAFKA_REST_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_REST_BOOTSTRAP_SERVERS: kafka:9092
KAFKA_REST_LISTENERS: http://0.0.0.0:8082
KAFKA_REST_SCHEMA_REGISTRY: http://schema-registry:8081
KAFKA_REST_HOST_NAME: kafka-rest
zookeeper:
image: confluentinc/cp-zookeeper:5.1.3
env:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 100
- name: build
run: |
git config --global --add safe.directory /__w/jackdaw/jackdaw
lein kaocha
env:
KAFKA_BOOTSTRAP_SERVERS: kafka
ZOOKEEPER_HOST: zoopkeeper
SCHEMA_REGISTRY_HOST: schema-registry
KAFKA_REST_PROXY_HOST: kafka-rest
- name: lint
run: lein clj-kondo --lint src test || true
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
:git-version
{:status-to-version
(fn [{:keys [tag branch ahead? dirty?] :as git}]
(if (and tag (not ahead?) (not dirty?))
(if (and tag (not ahead?) (not dirty?) (= "master" branch))
tag
(let [[_ prefix patch] (re-find #"(\d+\.\d+)\.(\d+)" tag)
patch (Long/parseLong patch)
Expand Down

0 comments on commit 156a3ce

Please sign in to comment.