Test a Clojure application with GitLab CI/CD

原文:https://docs.gitlab.com/ee/ci/examples/test-clojure-application.html

注意:本文档最近未更新,可能已过期. 有关最新文档,请参见GitLab CI / CD页面和《 GitLab CI / CD 管道配置参考》 .

Test a Clojure application with GitLab CI/CD

本示例将指导您如何在 Clojure 应用程序上运行测试.

您可以查看或派生示例源,并查看其过去的CI 作业的日志.

Configure the project

这是此项目的.gitlab-ci.yml文件的外观:

variables:
  POSTGRES_DB: sample-test
  DATABASE_URL: "postgresql://postgres@postgres:5432/sample-test"

before_script:
  - apt-get update -y
  - apt-get install default-jre postgresql-client -y
  - wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
  - chmod a+x lein
  - export LEIN_ROOT=1
  - PATH=$PATH:.
  - lein deps
  - lein migratus migrate

test:
  script:
    - lein test 

before_script ,我们安装了 JRE 和Leiningen .

该示例项目使用migratus库管理数据库迁移,并且在before_script的最后一步中添加了数据库迁移.

您可以使用gitlab.com可用的公共gitlab.com程序来使用此配置测试您的应用程序.

Copyright © 温玉 2021 | 浙ICP备2020032454号 all right reserved,powered by Gitbook该文件修订时间: 2021-03-27 13:48:25

results matching ""

    No results matching ""