diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 6453bfda..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,206 +0,0 @@ ---- -version: 2 - -references: - repo_cache_key: &repo_cache_key - v1-jackdaw-repo-{{ .Branch }}-{{ .Revision }} - - repo_cache_backup_1: &repo_cache_backup_1 - v1-jackdaw-repo-{{ .Branch }} - - repo_cache_backup_2: &repo_cache_backup_2 - v1-jackdaw-repo - - restore_repo: &restore_repo - restore_cache: - keys: - - *repo_cache_key - - *repo_cache_backup_1 - - *repo_cache_backup_2 - - mvn_cache_key: &mvn_cache_key - v1-jackdaw-deps-{{ checksum "project.clj" }} - - mvn_cache_backup: &mvn_cache_backup - v1-jackdaw-deps - - restore_mvn: &restore_mvn - restore_cache: - keys: - - *mvn_cache_key - - *mvn_cache_backup - - build_config: &build_config - docker: - - image: circleci/clojure:lein-2.9.1 - working_directory: /home/circleci/jackdaw - - deploy_config: &deploy_config - docker: - - image: circleci/clojure:lein-2.9.1 - working_directory: /home/circleci/jackdaw - - test_config: &test_config - docker: - - image: circleci/clojure:lein-2.9.1 - - image: confluentinc/cp-zookeeper:6.1.1 - environment: - ZOOKEEPER_CLIENT_PORT: 2181 - - image: confluentinc/cp-kafka:6.1.1 - environment: - KAFKA_BROKER_ID: 1 - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 - KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092 - KAFKA_ZOOKEEPER_CONNECT: localhost:2181 - - image: confluentinc/cp-schema-registry:6.1.1 - environment: - SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: localhost:2181 - SCHEMA_REGISTRY_HOST_NAME: localhost - SCHEMA_REGISTRY_LISTENERS: http://localhost:8081 - - image: confluentinc/cp-kafka-rest:6.1.1 - environment: - KAFKA_REST_ZOOKEEPER_CONNECT: localhost:2181 - KAFKA_REST_BOOTSTRAP_SERVERS: localhost:9092 - KAFKA_REST_LISTENERS: http://0.0.0.0:8082 - KAFKA_REST_SCHEMA_REGISTRY: http://localhost:8081 - KAFKA_REST_HOST_NAME: localhost - working_directory: ~/jackdaw - -jobs: - checkout_code: - <<: *build_config - steps: - - *restore_repo - - checkout - - save_cache: - key: v1-jackdaw-repo-{{ .Branch }}-{{ .Revision }} - paths: - - . - checkout_tags: - <<: *deploy_config - steps: - - *restore_repo - # Workaround required for https://discuss.circleci.com/t/22437 - # - # This is required to prevent the warning that appears about connecting - # to a host for the first time when we attempt to fetch the tags from - # github. - # - # The `add-key` script checks the fingerprint of the ssh key returned - # by github against the fingerprint published below on their website - # to protect against MITM attacks - # - # https://help.github.com/en/articles/githubs-ssh-key-fingerprints - # - - run: | - .circleci/bin/add-key github.com $GITHUB_SSH_FINGERPRINT - git fetch --force origin "refs/tags/${CIRCLE_TAG}:refs/tags/${CIRCLE_TAG}" - git checkout --force "$CIRCLE_TAG" - - save_cache: - key: v1-jackdaw-repo-{{ .Branch }}-{{ .Revision }} - paths: - - . - lint: - machine: true - working_directory: /home/circleci/jackdaw - steps: - - checkout - - run: ls -la - - run: docker run --volume `pwd`:/project --rm --workdir /project cljkondo/clj-kondo sh -c 'clj-kondo --lint src test' || true - - deps: - <<: *build_config - steps: - - *restore_repo - - *restore_mvn - - run: - lein with-profiles +test deps - - save_cache: - key: *mvn_cache_key - paths: - - /home/circleci/.m2 - - - test: - <<: *test_config - steps: - - *restore_repo - - *restore_mvn - - setup_remote_docker: - docker_layer_caching: true - - run: - lein kaocha --plugin kaocha.plugin/junit-xml --junit-xml-file test-results/kaocha/results.xml - - store_artifacts: - path: ./logs - - store_artifacts: - path: target/coverage - - store_test_results: - path: test-results - - deploy: - <<: *deploy_config - steps: - - *restore_repo - - *restore_mvn - - run: - name: Prepare signing key - command: | - echo $GPG_PRIVATE_KEY |base64 --decode |gpg --yes --batch --import - - - run: - name: Deploy to Clojars - command: | - export LEIN_GPG=/home/circleci/jackdaw/.circleci/bin/gpg - export REAL_GPG=$(which gpg) - - lein do jar, pom, deploy clojars - - deploy_snapshot: - <<: *deploy_config - steps: - - *restore_repo - - *restore_mvn - - run: - name: Deploy to Clojars - command: | - [ -z "$CLOJARS_USERNAME" ] || lein do jar, pom, deploy clojars - -workflows: - version: 2 - build_and_test: - jobs: - - lint - - checkout_code - - deps: - requires: - - checkout_code - - test: - requires: - - deps - - deploy_snapshot: - context: clojars-deploy - requires: - - test - filters: - tags: - ignore: /.*/ - branches: - ignore: /master/ - - checkout_and_deploy: - jobs: - - checkout_tags: - filters: - tags: - only: /.*/ - branches: - ignore: /.*/ - - deploy: - context: clojars-deploy - requires: - - checkout_tags - filters: - tags: - only: /^\d+\.\d+\.\d+$/ - branches: - ignore: /.*/ diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 3b3de1f0..0c8b4c15 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -29,7 +29,7 @@ jobs: apt-get update apt-get install -y gpg echo $GPG_PRIVATE_KEY |base64 --decode |gpg --yes --batch --import - export LEIN_GPG=/__w/jackdaw/jackdaw/.circleci/bin/gpg + export LEIN_GPG=/__w/jackdaw/jackdaw/bin/gpg export REAL_GPG=$(which gpg) lein do jar, pom, deploy clojars diff --git a/.circleci/bin/add-key b/bin/add-key similarity index 100% rename from .circleci/bin/add-key rename to bin/add-key diff --git a/.circleci/bin/gpg b/bin/gpg similarity index 62% rename from .circleci/bin/gpg rename to bin/gpg index 8b41d98f..83b45a37 100755 --- a/.circleci/bin/gpg +++ b/bin/gpg @@ -1,6 +1,6 @@ #!/bin/sh # -# Invoked by `LEIN_GPG=$app/.circleci/bin/gpg lein deploy clojars` +# Invoked by `LEIN_GPG=$app/bin/gpg lein deploy clojars` echo $GPG_PASSPHRASE \ | $REAL_GPG --pinentry-mode loopback --yes --batch --passphrase-fd=0 $@