Skip to content

Commit

Permalink
Bamboo to Coverflex hex (#1)
Browse files Browse the repository at this point in the history
* Adding configuration to publish Bamboo to Hex

* mix.lock

Co-authored-by: Daniel Costa <[email protected]>
  • Loading branch information
danielscosta and Daniel Costa committed Nov 7, 2022
1 parent f868812 commit b8a80e7
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 12 deletions.
87 changes: 76 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,91 @@
version: 2
# Elixir CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-elixir/ for more details

version: 2.1

jobs:
build:
run-tests:
parallelism: 1
docker:
- image: circleci/elixir:1.8.1
- image: cimg/elixir:1.13.4
environment:
MIX_ENV: test
- image: circleci/postgres:10.1-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_DB: core_test
POSTGRES_PASSWORD: postgres
resource_class: small

working_directory: ~/app

working_directory: ~/repo
steps:
- run: mix local.hex --force
- run: mix local.rebar --force
- run: mix hex.organization auth coverflex_engineering --key $HEX_API_KEY

- checkout
- run: mix local.hex --force # install Hex locally (without prompt)
- run: mix local.rebar --force # fetch a copy of rebar (without prompt)

- restore_cache:
keys:
- mix-cache-{{ checksum "mix.lock" }}

- run: mix do deps.get
- v1-mix-cache-{{ .Branch }}-{{ checksum "mix.lock" }}
- v1-mix-cache-{{ .Branch }}
- v1-mix-cache
- restore_cache:
keys:
- v1-build-cache-{{ .Branch }}
- v1-build-cache
- run: mix hex.repo add oban https://getoban.pro/repo --fetch-public-key $OBAN_KEY_FINGERPRINT --auth-key $OBAN_LICENSE_KEY
- run: mix do deps.get, deps.compile
- save_cache:
key: mix-cache-{{ checksum "mix.lock" }}
key: v1-mix-cache-{{ .Branch }}-{{ checksum "mix.lock" }}
paths: "deps"
- save_cache:
key: v1-build-cache-{{ .Branch }}
paths: "_build"

- run:
name: Wait for DB
command: dockerize -wait tcp:https://localhost:5432 -timeout 1m

- run: mix ecto.create
- run: mix format --check-formatted
- run: mix credo
- run: mix test
- run: MIX_ENV=prod mix compile

- store_test_results:
path: _build/test/lib/bamboo

publish-package:
docker:
- image: cimg/elixir:1.13.4
resource_class: small
working_directory: ~/app

steps:
- run: mix local.hex --force
- run: mix local.rebar --force
- run: mix hex.organization auth coverflex_engineering --key $HEX_API_KEY
- checkout
- run: mix hex.repo add oban https://getoban.pro/repo --fetch-public-key $OBAN_KEY_FINGERPRINT --auth-key $OBAN_LICENSE_KEY
- run: mix do deps.get, deps.compile
- run: HEX_API_KEY=$HEX_API_KEY mix hex.publish package --yes

workflows:
test_and_publish:
jobs:
- run-tests:
context:
- Oban
- Hex
- publish-package:
context:
- Oban
- Hex
filters:
tags:
only:
- /^v\d+\.\d+\.\d+$/
branches:
ignore: /.*/
3 changes: 2 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ defmodule Bamboo.Mixfile do
{:floki, "~> 0.29", only: :test},
{:ex_doc, "~> 0.23", only: :dev},
{:hackney, ">= 1.15.2"},
{:jason, "~> 1.0", optional: true}
{:jason, "~> 1.0", optional: true},
{:version_tasks, "~> 0.12.0", only: :dev}
]
end
end
2 changes: 2 additions & 0 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"ex_machina": {:hex, :ex_machina, "2.4.0", "09a34c5d371bfb5f78399029194a8ff67aff340ebe8ba19040181af35315eabb", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm", "a20bc9ddc721b33ea913b93666c5d0bdca5cbad7a67540784ae277228832d72c"},
"excoveralls": {:hex, :excoveralls, "0.13.2", "5ca05099750c086f144fcf75842c363fc15d7d9c6faa7ad323d010294ced685e", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "1e7ed75c158808a5a8f019d3ad63a5efe482994f2f8336c0a8c77d2f0ab152ce"},
"floki": {:hex, :floki, "0.29.0", "b1710d8c93a2f860dc2d7adc390dd808dc2fb8f78ee562304457b75f4c640881", [:mix], [{:html_entities, "~> 0.5.0", [hex: :html_entities, repo: "hexpm", optional: false]}], "hexpm", "008585ce64b9f74c07d32958ec9866f4b8a124bf4da1e2941b28e41384edaaad"},
"git_cli": {:hex, :git_cli, "0.3.0", "a5422f9b95c99483385b976f5d43f7e8233283a47cda13533d7c16131cb14df5", [:mix], [], "hexpm", "78cb952f4c86a41f4d3511f1d3ecb28edb268e3a7df278de2faa1bd4672eaf9b"},
"hackney": {:hex, :hackney, "1.16.0", "5096ac8e823e3a441477b2d187e30dd3fff1a82991a806b2003845ce72ce2d84", [:rebar3], [{:certifi, "2.5.2", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.1", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.0", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.6", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "3bf0bebbd5d3092a3543b783bf065165fa5d3ad4b899b836810e513064134e18"},
"html_entities": {:hex, :html_entities, "0.5.1", "1c9715058b42c35a2ab65edc5b36d0ea66dd083767bef6e3edb57870ef556549", [:mix], [], "hexpm", "30efab070904eb897ff05cd52fa61c1025d7f8ef3a9ca250bc4e6513d16c32de"},
"idna": {:hex, :idna, "6.0.1", "1d038fb2e7668ce41fbf681d2c45902e52b3cb9e9c77b55334353b222c2ee50c", [:rebar3], [{:unicode_util_compat, "0.5.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a02c8a1c4fd601215bb0b0324c8a6986749f807ce35f25449ec9e69758708122"},
Expand All @@ -26,4 +27,5 @@
"ranch": {:hex, :ranch, "1.3.2", "e4965a144dc9fbe70e5c077c65e73c57165416a901bd02ea899cfd95aa890986", [:rebar3], [], "hexpm", "6e56493a862433fccc3aca3025c946d6720d8eedf6e3e6fb911952a7071c357f"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
"unicode_util_compat": {:hex, :unicode_util_compat, "0.5.0", "8516502659002cec19e244ebd90d312183064be95025a319a6c7e89f4bccd65b", [:rebar3], [], "hexpm", "d48d002e15f5cc105a696cf2f1bbb3fc72b4b770a184d8420c8db20da2674b38"},
"version_tasks": {:hex, :version_tasks, "0.12.0", "df384f454369f5f922a541cdc21da2db643c7424c03994986dab2b1702a5b724", [:mix], [{:git_cli, "~> 0.2", [hex: :git_cli, repo: "hexpm", optional: false]}], "hexpm", "c85e0ec9ad498795609ad849b6dbc668876cecb993fce1f4073016a5b87ee430"},
}

0 comments on commit b8a80e7

Please sign in to comment.