Archived
1
0

Fix bugs in CI

This commit is contained in:
Anmol Sethi 2020-02-18 19:06:35 -05:00
parent 1aaa53622d
commit 5681c87e33
No known key found for this signature in database
GPG Key ID: 8CEF1878FF10ADEB
12 changed files with 40 additions and 51 deletions

View File

@ -1,2 +1,2 @@
extends: extends:
- stylelint-config-standard - stylelint-config-recommended

View File

@ -2,36 +2,26 @@ language: minimal
jobs: jobs:
include: include:
- stage: Code
name: Format
script: ./ci/image/run.sh "yarn && yarn vscode && yarn fmt"
- name: Lint
script: ./ci/image/run.sh "yarn && yarn vscode && yarn lint"
- name: Test - name: Test
script: ./ci/image/run.sh "yarn && yarn vscode && yarn test" script: ./ci/image/run.sh "yarn && yarn vscode && ./ci/ci.sh"
deploy: null
- stage: Release - name: Linux Release
name: Linux Release if: tag IS present
script: script:
- travis_wait 60 ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh" - travis_wait 60 ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh"
- ./ci/release-image/push.sh - ./ci/release-image/push.sh
- name: Linux ARM64 Release - name: Linux ARM64 Release
if: tag IS present
script: script:
- travis_wait 60 ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh" - travis_wait 60 ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh"
- ./ci/release-image/push.sh - ./ci/release-image/push.sh
arch: arm64 arch: arm64
- name: MacOS Release - name: MacOS Release
if: tag IS present
os: osx os: osx
language: node_js language: node_js
node_js: 12 node_js: 12
script: yarn && yarn vscode && travis_wait 60 ci/release.sh script: yarn && yarn vscode && travis_wait 60 ci/release.sh
- name: Docker Release
script: ./ci/release-image/push.sh
stages:
- name: Code
- name: Release
if: env(TRAVIS_TAG) IS present
deploy: deploy:
- provider: releases - provider: releases
@ -45,7 +35,6 @@ deploy:
- release/*.zip - release/*.zip
on: on:
tags: true tags: true
condition: $TRAVIS_BUILD_STAGE_NAME == Release
cache: cache:
timeout: 600 timeout: 600

12
ci/ci.sh Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail
main() {
cd "$(dirname "$0")/.."
yarn fmt
yarn lint
yarn test
}
main "$@"

View File

@ -1,4 +1,4 @@
FROM node:12 FROM node:12.14.0
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
libxkbfile-dev \ libxkbfile-dev \

10
ci/lib.sh Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
set_version() {
local code_server_version=${VERSION:-${TRAVIS_TAG:-}}
if [[ -z $code_server_version ]]; then
code_server_version=$(grep version ./package.json | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[:space:]')
fi
export VERSION=$code_server_version
}

View File

@ -4,7 +4,7 @@ set -euo pipefail
main() { main() {
eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js") eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js")
stylelint --fix $(git ls-files "*.css") stylelint $(git ls-files "*.css")
tsc --noEmit tsc --noEmit
} }

View File

@ -33,4 +33,4 @@ RUN rm -rf /var/lib/apt/lists/*
EXPOSE 8080 EXPOSE 8080
USER coder USER coder
WORKDIR /home/coder WORKDIR /home/coder
ENTRYPOINT ["dumb-init", "fixuid", "-q", "code-server", "--host", "0.0.0.0"] ENTRYPOINT ["dumb-init", "fixuid", "-q", "code-server", "--host=0.0.0.0", "--auth=none"]

View File

@ -4,6 +4,8 @@ set -euo pipefail
main() { main() {
cd "$(dirname "$0")/../.." cd "$(dirname "$0")/../.."
soruce ./ci/lib.sh
set_version
if [[ ${CI:-} ]]; then if [[ ${CI:-} ]]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin

View File

@ -6,12 +6,9 @@ set -euo pipefail
# This script assumes that yarn has already ran. # This script assumes that yarn has already ran.
function main() { function main() {
cd "$(dirname "${0}")/.." cd "$(dirname "${0}")/.."
source ./ci/lib.sh
local code_server_version=${VERSION:-${TRAVIS_TAG:-}} set_version
if [[ -z $code_server_version ]]; then
code_server_version=$(grep version ./package.json | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[:space:]')
fi
export VERSION=$code_server_version
# Always minify and package on CI since that's when releases are pushed. # Always minify and package on CI since that's when releases are pushed.
if [[ ${CI:-} ]]; then if [[ ${CI:-} ]]; then

View File

@ -39,7 +39,7 @@
"parcel-bundler": "^1.12.4", "parcel-bundler": "^1.12.4",
"prettier": "^1.18.2", "prettier": "^1.18.2",
"stylelint": "^13.0.0", "stylelint": "^13.0.0",
"stylelint-config-standard": "^19.0.0", "stylelint-config-recommended": "^3.0.0",
"ts-node": "^8.4.1", "ts-node": "^8.4.1",
"typescript": "3.7.2" "typescript": "3.7.2"
}, },

View File

@ -10,17 +10,8 @@ body {
background: #272727; background: #272727;
color: #f4f4f4; color: #f4f4f4;
margin: 0; margin: 0;
font-family: font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
-apple-system, "Segoe UI Emoji", "Segoe UI Symbol";
BlinkMacSystemFont,
"Segoe UI",
Roboto,
Helvetica,
Arial,
sans-serif,
"Apple Color Emoji",
"Segoe UI Emoji",
"Segoe UI Symbol";
overflow: hidden; overflow: hidden;
} }

View File

@ -1848,12 +1848,7 @@ chokidar@^2.1.5:
optionalDependencies: optionalDependencies:
fsevents "^1.2.7" fsevents "^1.2.7"
chownr@^1.1.1: chownr@^1.1.1, chownr@^1.1.3:
version "1.1.4"
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b"
integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==
chownr@^1.1.3:
version "1.1.4" version "1.1.4"
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b"
integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==
@ -6847,13 +6842,6 @@ stylelint-config-recommended@^3.0.0:
resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-3.0.0.tgz#e0e547434016c5539fe2650afd58049a2fd1d657" resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-3.0.0.tgz#e0e547434016c5539fe2650afd58049a2fd1d657"
integrity sha512-F6yTRuc06xr1h5Qw/ykb2LuFynJ2IxkKfCMf+1xqPffkxh0S09Zc902XCffcsw/XMFq/OzQ1w54fLIDtmRNHnQ== integrity sha512-F6yTRuc06xr1h5Qw/ykb2LuFynJ2IxkKfCMf+1xqPffkxh0S09Zc902XCffcsw/XMFq/OzQ1w54fLIDtmRNHnQ==
stylelint-config-standard@^19.0.0:
version "19.0.0"
resolved "https://registry.yarnpkg.com/stylelint-config-standard/-/stylelint-config-standard-19.0.0.tgz#66f0cf13f33b8a9e34965881493b38fc1313693a"
integrity sha512-VvcODsL1PryzpYteWZo2YaA5vU/pWfjqBpOvmeA8iB2MteZ/ZhI1O4hnrWMidsS4vmEJpKtjdhLdfGJmmZm6Cg==
dependencies:
stylelint-config-recommended "^3.0.0"
stylelint@^13.0.0: stylelint@^13.0.0:
version "13.2.0" version "13.2.0"
resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-13.2.0.tgz#b6f5b67b9a9a51f1fd105ab916952456d93826b4" resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-13.2.0.tgz#b6f5b67b9a9a51f1fd105ab916952456d93826b4"