From 3ce71294921b37818437bbf2fdb6bd72ddb7d199 Mon Sep 17 00:00:00 2001 From: Ayane Satomi Date: Thu, 16 Jan 2020 03:14:05 +0800 Subject: [PATCH] Drone CI migration (#1261) --- .drone.yml | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 12 ----- Dockerfile | 5 ++ 3 files changed, 140 insertions(+), 12 deletions(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..a0b1a97 --- /dev/null +++ b/.drone.yml @@ -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 diff --git a/.travis.yml b/.travis.yml index 32f785e..c7b5a30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 6eb3ff7..bf8964a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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