Drone CI migration (#1261)

This commit is contained in:
Ayane Satomi 2020-01-16 03:14:05 +08:00 committed by Asher
parent 336ee28888
commit 3ce7129492
3 changed files with 140 additions and 12 deletions

135
.drone.yml Normal file
View file

@ -0,0 +1,135 @@
kind: pipeline
type: docker
name: build-amd64
platform:
arch: amd64
steps:
- name: build
image: node:12
commands:
- apt update && apt install -y build-essential git libsecret-1-dev libx11-dev libxkbfile-dev
- if [ -z $DRONE_TAG ]; then yarn build 1.41.1 daily ; else yarn build 1.41.1 $DRONE_TAG; fi
- if [ -z $DRONE_TAG ]; then yarn binary 1.41.1 daily ; else yarn binary 1.41.1 $DRONE_TAG; fi
- if [ -z $DRONE_TAG ]; then yarn package 1.41.1 daily ; else yarn package 1.41.1 $DRONE_TAG; fi
- name: build-alpine
image: node:12-alpine
commands:
- apk add libxkbfile-dev libsecret-dev build-base git
- if [ -z $DRONE_TAG ]; then yarn build 1.41.1 daily ; else yarn build 1.41.1 $DRONE_TAG; fi
- if [ -z $DRONE_TAG ]; then yarn binary 1.41.1 daily ; else yarn binary 1.41.1 $DRONE_TAG; fi
- if [ -z $DRONE_TAG ]; then yarn package 1.41.1 daily ; else yarn package 1.41.1 $DRONE_TAG; fi
- name: publish
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files: release/*.tar.gz
when:
event: tag
- name: docker-publish
image: banzaicloud/drone-kaniko
settings:
username:
from_secret: docker_user
password:
from_secret: docker_password
tags:
- latest
- ${DRONE_TAG}
build_args:
- codeServerVersion=${DRONE_TAG}
- vscodeVersion=1.41.1
when:
event: tag
---
kind: pipeline
type: docker
name: build-arm64
platform:
arch: arm64
steps:
- name: build
image: node:12
commands:
- apt update && apt install -y build-essential git libsecret-1-dev libx11-dev libxkbfile-dev
- if [ -z $DRONE_TAG ]; then yarn build 1.41.1 daily ; else yarn build 1.41.1 $DRONE_TAG; fi
- if [ -z $DRONE_TAG ]; then yarn binary 1.41.1 daily ; else yarn binary 1.41.1 $DRONE_TAG; fi
- if [ -z $DRONE_TAG ]; then yarn package 1.41.1 daily ; else yarn package 1.41.1 $DRONE_TAG; fi
- name: build-alpine
image: node:12-alpine
commands:
- apk add libxkbfile-dev libsecret-dev build-base git
- if [ -z $DRONE_TAG ]; then yarn build 1.41.1 daily ; else yarn build 1.41.1 $DRONE_TAG; fi
- if [ -z $DRONE_TAG ]; then yarn binary 1.41.1 daily ; else yarn binary 1.41.1 $DRONE_TAG; fi
- if [ -z $DRONE_TAG ]; then yarn package 1.41.1 daily ; else yarn package 1.41.1 $DRONE_TAG; fi
- name: publish
image: plugins/github-release
settings:
api_key:
from_secret: github_token
files: release/*.tar.gz
when:
event: tag
- name: docker-publish
image: banzaicloud/drone-kaniko
settings:
username:
from_secret: docker_user
password:
from_secret: docker_password
tags:
- latest-arm64
- ${DRONE_TAG}-arm64
build_args:
- codeServerVersion=$DRONE_TAG
- vscodeVersion=1.41.1
when:
event: tag
# ---
# kind: pipeline
# type: docker
# name: build-arm
#
# platform:
# arch: arm
#
# steps:
#
# - name: build
# image: node:12
# commands:
# - apt update && apt install -y build-essential git libsecret-1-dev libx11-dev libxkbfile-dev
# - yarn
# - if [ -z $DRONE_TAG ]; then yarn build 1.41.1 daily ; else yarn build 1.41.1 $DRONE_TAG; fi
# - if [ -z $DRONE_TAG ]; then yarn binary 1.41.1 daily ; else yarn binary 1.41.1 $DRONE_TAG; fi
#
# - name: build-alpine
# image: node:12-alpine
# commands:
# - apk add libxkbfile-dev libsecret-dev build-base git
# - if [ -z $DRONE_TAG ]; then yarn build 1.41.1 daily ; else yarn build 1.41.1 $DRONE_TAG; fi
# - if [ -z $DRONE_TAG ]; then yarn binary 1.41.1 daily ; else yarn binary 1.41.1 $DRONE_TAG; fi
# - if [ -z $DRONE_TAG ]; then yarn package 1.41.1 daily ; else yarn package 1.41.1 $DRONE_TAG; fi
#
# - name: publish
# image: plugins/github-release
# settings:
# api_key:
# from_secret: github_token
# files: release/*.tar.gz
# when:
# event: tag

View file

@ -15,18 +15,6 @@ before_install:
# 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" PUSH_DOCKER="true"
if: tag IS blank
script: scripts/ci.bash
- name: "Alpine build"
os: linux
dist: trusty
env: TARGET="alpine"
if: tag IS blank
script: scripts/ci.bash
- name: "MacOS build"
os: osx
if: tag IS blank

View file

@ -49,6 +49,11 @@ RUN mkdir -p /home/coder/project
# To avoid EACCES issues on f.ex Crostini (ChromeOS)
RUN mkdir -p /home/coder/.local/share/code-server
# FIXME: permission fix required for bind-mounts
# See GH-1270
RUN sudo chmod -R g+rw /home/coder/project && sudo chmod -R g+rw /home/coder/.local/share/code-server && \
sudo chown -R coder:coder /home/coder
WORKDIR /home/coder/project
# This ensures we have a volume mounted even if the user forgot to do bind