code-server/.travis.yml

81 lines
2.8 KiB
YAML
Raw Normal View History

language: node_js
node_js:
2019-09-17 19:26:59 +03:00
- 10.16.0
2019-04-26 17:00:15 +03:00
services:
2019-09-17 19:26:59 +03:00
- docker
before_install:
2019-09-17 19:26:59 +03:00
- export MAJOR_VERSION="2"
- export VSCODE_VERSION="1.38.1"
- export VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER"
- export TAG="$VERSION-vsc$VSCODE_VERSION"
2019-09-17 19:26:59 +03:00
- 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
env: TARGET="linux"
if: tag IS blank
script: scripts/ci.bash
2019-09-17 19:26:59 +03:00
- name: "Alpine build"
os: linux
dist: trusty
env: TARGET="alpine"
if: tag IS blank
script: scripts/ci.bash
2019-09-17 19:26:59 +03:00
- name: "MacOS build"
os: osx
if: tag IS blank
script: travis_wait 30 scripts/ci.bash
- name: "Docker build"
os: linux
dist: trusty
env: DOCKER_BUILD="true"
if: branch == master AND tag IS blank
2019-09-17 23:25:17 +03:00
script: docker build --build-arg githubToken="$GITHUB_TOKEN" --build-arg codeServerVersion="$VERSION" --build-arg vscodeVersion="$VSCODE_VERSION" -t codercom/code-server:"$TAG" -t codercom/code-server:v2 .
2019-09-17 19:26:59 +03:00
git:
depth: 3
2019-03-05 03:21:29 +03:00
before_deploy:
- echo "$TAG" "$TRAVIS_COMMIT"
2019-09-17 19:26:59 +03:00
- git config --local user.name "$USER_NAME"
- git config --local user.email "$USER_EMAIL"
- if ! git tag "$TAG" "$TRAVIS_COMMIT" ; then echo "$TAG already exists"; fi
2019-09-17 22:59:01 +03:00
- if [[ -n "$DOCKER_BUILD" ]] ; then echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin ; fi
2019-09-17 19:26:59 +03:00
2019-03-05 03:21:29 +03:00
deploy:
- provider: releases
file_glob: true
draft: true
tag_name: "$TAG"
target_commitish: "$TRAVIS_COMMIT"
name: "$TAG"
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
- provider: script
2019-09-17 22:21:23 +03:00
skip_cleanup: true
2019-09-17 23:25:17 +03:00
script: docker push codercom/code-server:"$TAG" ; docker push codercom/code-server:v2
on:
repo: cdr/code-server
branch: master
2019-09-17 23:12:47 +03:00
condition: -n "$DOCKER_BUILD"
2019-09-17 19:26:59 +03:00
cache:
yarn: true
timeout: 1000
directories:
2019-09-17 20:31:40 +03:00
- .cache