使用Docker镜像构建和部署作为构建矩阵的一部分

时间:2016-06-09 09:11:19

标签: docker travis-ci

是否可以使用Docker镜像作为构建矩阵的一部分进行测试和部署?

我有一个标准的,功能正常的构建矩阵和部署版本的步骤,但我需要换掉特定容器的Linux版本(在quay.io上可用)。

matrix:
  include:
    - os: osx
      rust: stable
      env: TARGET=x86_64-apple-darwin
    - os: linux
      rust: stable
      env: TARGET=x86_64-unknown-linux-gnu
    # and some more

before_deploy:
  - bash ci/before_deploy.sh

before_install:
  - export PATH="$PATH:$HOME/.cargo/bin"

install:
  - bash ci/install.sh

script:
  - bash ci/script.sh

deploy:
  provider: releases
  api_key:
        - secure: xxx
  file_glob: true
  file: ${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}.*
  # don't delete the artifacts from previous phases
  skip_cleanup: true
  # deploy when a new tag is pushed
  on:
    tags: true

我想做的是将Docker镜像替换为os: linux版本,并在其中运行脚本。这有可能吗?我见过的所有示例都使用docker命令预先添加脚本步骤,并将其作为service提供,对于非Docker构建将失败。

0 个答案:

没有答案
相关问题