From a0b15d31a428372d5730a180833717ac1fda0220 Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Sun, 12 Feb 2023 13:44:00 -0600 Subject: [PATCH] More CI setup --- .circleci/config.yml | 12 ++++++------ bin/{codeship_assets => ci_assets} | 4 ++-- bin/{codeship_db => ci_db} | 0 bin/{codeship_deploy => ci_deploy} | 0 bin/{codeship_deps => ci_deps} | 0 bin/setup | 12 ++++++------ codeship-steps.yml | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) rename bin/{codeship_assets => ci_assets} (80%) rename bin/{codeship_db => ci_db} (100%) rename bin/{codeship_deploy => ci_deploy} (100%) rename bin/{codeship_deps => ci_deps} (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0867ac0..218e11f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,14 +19,14 @@ jobs: - browser-tools/install-chromedriver - checkout - run: - name: Install hex - command: mix local.hex --force + name: Install dependencies + command: bin/ci_deps - run: - name: Install rebar - command: mix local.rebar --force + name: Build assets + command: bin/ci_assets - run: - name: Install mix deps - command: mix deps.get + name: Create database + command: bin/ci_db - run: name: Run tests command: mix test diff --git a/bin/codeship_assets b/bin/ci_assets similarity index 80% rename from bin/codeship_assets rename to bin/ci_assets index 040012c..1a08ffe 100755 --- a/bin/codeship_assets +++ b/bin/ci_assets @@ -1,7 +1,7 @@ #!/usr/bin/env bash echo "Building assets" -cd assets +pushd assets yarn install yarn run deploy -cd .. +popd diff --git a/bin/codeship_db b/bin/ci_db similarity index 100% rename from bin/codeship_db rename to bin/ci_db diff --git a/bin/codeship_deploy b/bin/ci_deploy similarity index 100% rename from bin/codeship_deploy rename to bin/ci_deploy diff --git a/bin/codeship_deps b/bin/ci_deps similarity index 100% rename from bin/codeship_deps rename to bin/ci_deps diff --git a/bin/setup b/bin/setup index 7281e17..0b54de6 100755 --- a/bin/setup +++ b/bin/setup @@ -1,21 +1,21 @@ #!/usr/bin/env sh -echo "Removing previous build artifacts" +echo "๐Ÿงน Removing previous build artifacts" rm -rf deps _build -echo "Installing dependencies and compiling" +echo "๐ŸŽ Installing dependencies and compiling" mix local.hex --force mix deps.get mix deps.compile mix compile # Set up database -echo "Setting up the database" +echo "๐Ÿ’พ Setting up the database" mix ecto.create mix ecto.migrate # Grab JS dependencies from NPM -echo "Installing js dependencies" -cd assets +echo "๐Ÿ•ธ๏ธ Installing js dependencies" +pushd assets yarn install -cd .. +popd diff --git a/codeship-steps.yml b/codeship-steps.yml index 3ab569b..113b677 100644 --- a/codeship-steps.yml +++ b/codeship-steps.yml @@ -2,7 +2,7 @@ # The build passes as long as every test step returns with a non-zero exit code. # See here for more: https://documentation.codeship.com/pro/builds-and-configuration/steps/ - name: build_assets - command: bin/codeship_assets + command: bin/ci_assets service: app - name: run_mix_test command: /bin/bash -c 'mix ecto.create && mix test'