.travis.yml 2.5 KB
Newer Older
K
Kyle Carberry 已提交
1 2
language: node_js
node_js:
A
Asher 已提交
3
  - 12.14.0
K
Kyle Carberry 已提交
4
services:
A
Asher 已提交
5 6
  - docker

A
Asher 已提交
7
before_install:
A
Asher 已提交
8
  - export MAJOR_VERSION="2"
A
Asher 已提交
9
  - export VSCODE_VERSION="1.41.1"
A
Asher 已提交
10
  - export VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER"
A
Asher 已提交
11
  - export TAG="$VERSION-vsc$VSCODE_VERSION"
A
Asher 已提交
12 13 14 15 16 17 18 19 20
  - if [[ "$TRAVIS_BRANCH" == "master" ]]; then export MINIFY="true"; fi
  - if [[ "$TRAVIS_BRANCH" == "master" ]]; then export PACKAGE="true"; fi

# Don't build on tags because we'll already have built the commit.
jobs:
  include:
    - name: "Linux build"
      os: linux
      dist: trusty
A
Asher 已提交
21
      env: TARGET="linux" PUSH_DOCKER="true"
A
Asher 已提交
22
      if: tag IS blank
23
      script: scripts/ci.bash
A
Asher 已提交
24 25 26 27 28
    - name: "Alpine build"
      os: linux
      dist: trusty
      env: TARGET="alpine"
      if: tag IS blank
29
      script: scripts/ci.bash
A
Asher 已提交
30 31 32
    - name: "MacOS build"
      os: osx
      if: tag IS blank
A
Asher 已提交
33
      script: travis_wait 60 scripts/ci.bash
A
Asher 已提交
34 35 36 37

git:
  depth: 3

K
Kyle Carberry 已提交
38
before_deploy:
A
Asher 已提交
39
  - echo "$TAG" "$TRAVIS_COMMIT"
A
Asher 已提交
40 41
  - git config --local user.name "$USER_NAME"
  - git config --local user.email "$USER_EMAIL"
A
Asher 已提交
42
  - if ! git tag "$TAG" "$TRAVIS_COMMIT" ; then echo "$TAG already exists"; fi
A
Asher 已提交
43
  - if [[ -n "$PUSH_DOCKER" ]] ; then echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin ; fi
A
Asher 已提交
44

K
Kyle Carberry 已提交
45
deploy:
46 47
  - provider: releases
    file_glob: true
48
    draft: true
A
Asher 已提交
49
    tag_name: "$TAG"
50
    target_commitish: "$TRAVIS_COMMIT"
A
Asher 已提交
51
    name: "$TAG"
52 53 54 55 56 57 58 59 60
    skip_cleanup: true
    api_key:
      secure: YL/x24KjYjgYXPcJWk3FV7FGxI79Mh6gBECQEcdlf3fkLEoKFVgzHBoUNWrFPzyR4tgLyWNAgcpD9Lkme1TRWTom7UPjXcwMNyLcLa+uec7ciSAnYD9ntLTpiCuPDD1u0LtRGclSi/EHQ+F8YVq+HZJpXTsJeAmOmihma3GVbGKSZr+BRum+0YZSG4w+o4TOlYzw/4bLWS52MogZcwpjd+hemBbgXLuGU2ziKv2vEKCZFbEeA16II4x1WLI4mutDdCeh7+3aLzGLwDa49NxtsVYNjyNFF75JhCTCNA55e2YMiLz9Uq69IXe/mi5F7xUaFfhIqqLNyKBnKeEOzu3dYnc+8n3LjnQ+00PmkF05nx9kBn3UfV1kwQGh6QbyDmTtBP07rtUMyI14aeQqHjxsaVRdMnwj9Q2DjXRr8UDqESZF0rmK3pHCXS2fBhIzLE8tLVW5Heiba2pQRFMHMZW+KBE97FzcFh7is90Ait3T8enfcd/PWFPYoBejDAdjwxwOkezh5N5ZkYquEfDYuWrFi6zRFCktsruaAcA+xGtTf9oilBBzUqu8Ie+YFWH5me83xakcblJWdaW/D2rLJAJH3m6LFm8lBqyUgDX5t/etob6CpDuYHu5D1J3XINOj/+aLAcadq6qlh70PMZS3zYffUu3JlzaD2amlSHIT8b5YXFc=
    file:
      - release/*.tar.gz
      - release/*.zip
    on:
      repo: cdr/code-server
      branch: master
A
Asher 已提交
61

62
  - provider: script
A
Asher 已提交
63
    skip_cleanup: true
64
    script: docker build -f ./scripts/ci.dockerfile -t codercom/code-server:"$TAG" . && docker push codercom/code-server:"$TAG"
65 66 67
    on:
      repo: cdr/code-server
      branch: master
A
Asher 已提交
68
      condition: -n "$PUSH_DOCKER"
A
Asher 已提交
69

K
Kyle Carberry 已提交
70
cache:
A
Asher 已提交
71
  timeout: 1000
K
Kyle Carberry 已提交
72 73
  yarn: true
  directories:
A
Asher 已提交
74
    - source