From 47d50c91632cdd2a8cb58daa99cbd96f214f2cb2 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sun, 17 May 2020 20:45:48 -0400 Subject: [PATCH] Downgrade CI to Debian 8 for glibc 2.19 Closes #1656 --- .github/workflows/ci.yaml | 4 +-- README.md | 2 +- ci/README.md | 5 ++-- ci/container/Dockerfile | 22 +++++++++++---- ci/container/arm64/Dockerfile | 53 +++++++++++++++++++++++++++++++++++ ci/container/arm64/README.md | 6 ++++ ci/dev/lint.sh | 5 +++- 7 files changed, 85 insertions(+), 12 deletions(-) create mode 100644 ci/container/arm64/Dockerfile create mode 100644 ci/container/arm64/README.md diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 257d4ccf..1191768b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -75,7 +75,7 @@ jobs: name: npm-package path: ./release - name: Run ./ci/steps/release-static.sh - uses: ./ci/container + uses: ./ci/container/arm64 with: args: ./ci/steps/release-static.sh - name: Upload release artifacts @@ -138,7 +138,7 @@ jobs: name: release-packages path: ./release-packages - name: Run ./ci/steps/build-docker-image.sh - uses: ./ci/container + uses: ./ci/container/arm64 with: args: ./ci/steps/build-docker-image.sh - name: Upload release image diff --git a/README.md b/README.md index 536344ba..553faa94 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ systemctl --user enable --now code-server ### npm We recommend installing from `npm` if we don't have a precompiled release for your machine's -platform or architecture. +platform or architecture or your glibc < v2.19. **note:** Installing via `npm` builds native modules on install and so requires C dependencies. See [./doc/npm.md](./doc/npm.md) for installing these dependencies. diff --git a/ci/README.md b/ci/README.md index 3fc3e7ff..64c9c193 100644 --- a/ci/README.md +++ b/ci/README.md @@ -23,11 +23,12 @@ Make sure you have `$GITHUB_TOKEN` set and [hub](https://github.com/github/hub) 5. Run `yarn release:github-assets` to download the `release-packages` artifact and then upload them to the draft release. 6. Run some basic sanity tests on one of the released packages. -7. Publish the release. +7. Make sure the github release tag is the commit with the artifacts. +8. Publish the release. 1. CI will automatically grab the artifacts and then: 1. Publish the NPM package from `npm-package`. 2. Publish the Docker Hub image from `release-images`. -8. Update the homebrew and AUR packages. +9. Update the homebrew and AUR packages. ## dev diff --git a/ci/container/Dockerfile b/ci/container/Dockerfile index a609ae8a..24acbcdd 100644 --- a/ci/container/Dockerfile +++ b/ci/container/Dockerfile @@ -1,4 +1,4 @@ -FROM debian +FROM debian:8 RUN apt-get update @@ -24,13 +24,23 @@ RUN apt-get install -y build-essential \ RUN apt-get install -y gettext-base # Misc build dependencies. -RUN apt-get install -y jq git rsync +RUN apt-get install -y git rsync + +# We need latest jq from debian buster for date support. +RUN ARCH="$(dpkg --print-architecture)" && \ + curl -sSOL http://http.us.debian.org/debian/pool/main/libo/libonig/libonig5_6.9.1-1_$ARCH.deb && \ + dpkg -i libonig*.deb && \ + curl -sSOL http://http.us.debian.org/debian/pool/main/j/jq/libjq1_1.5+dfsg-2+b1_$ARCH.deb && \ + dpkg -i libjq*.deb && \ + curl -sSOL http://http.us.debian.org/debian/pool/main/j/jq/jq_1.5+dfsg-2+b1_$ARCH.deb && \ + dpkg -i jq*.deb && rm *.deb # Installs shellcheck. -RUN curl -sSL https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.linux.$(uname -m).tar.xz | \ - tar -xJ && \ - mv shellcheck*/shellcheck /usr/local/bin && \ - rm -R shellcheck* +# Unfortunately coredumps on debian:8 so disabled for now. +#RUN curl -sSL https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.linux.$(uname -m).tar.xz | \ +# tar -xJ && \ +# mv shellcheck*/shellcheck /usr/local/bin && \ +# rm -R shellcheck* # Install Go dependencies RUN ARCH="$(dpkg --print-architecture)" && \ diff --git a/ci/container/arm64/Dockerfile b/ci/container/arm64/Dockerfile new file mode 100644 index 00000000..d9e23258 --- /dev/null +++ b/ci/container/arm64/Dockerfile @@ -0,0 +1,53 @@ +FROM debian:9 + +RUN apt-get update + +# Needed for debian repositories added below. +RUN apt-get install -y curl gnupg + +# Installs node. +RUN curl -sSL https://deb.nodesource.com/setup_14.x | bash - && \ + apt-get install -y nodejs + +# Installs yarn. +RUN curl -sSL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && apt-get install -y yarn + +# Installs VS Code build deps. +RUN apt-get install -y build-essential \ + libsecret-1-dev \ + libx11-dev \ + libxkbfile-dev + +# Installs envsubst. +RUN apt-get install -y gettext-base + +# Misc build dependencies. +RUN apt-get install -y git rsync + +# We need latest jq from debian buster for date support. +RUN ARCH="$(dpkg --print-architecture)" && \ + curl -sSOL http://http.us.debian.org/debian/pool/main/libo/libonig/libonig5_6.9.1-1_$ARCH.deb && \ + dpkg -i libonig*.deb && \ + curl -sSOL http://http.us.debian.org/debian/pool/main/j/jq/libjq1_1.5+dfsg-2+b1_$ARCH.deb && \ + dpkg -i libjq*.deb && \ + curl -sSOL http://http.us.debian.org/debian/pool/main/j/jq/jq_1.5+dfsg-2+b1_$ARCH.deb && \ + dpkg -i jq*.deb && rm *.deb + +# Installs shellcheck. +# Unfortunately coredumps on debian:8 so disabled for now. +#RUN curl -sSL https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.linux.$(uname -m).tar.xz | \ +# tar -xJ && \ +# mv shellcheck*/shellcheck /usr/local/bin && \ +# rm -R shellcheck* + +# Install Go dependencies +RUN ARCH="$(dpkg --print-architecture)" && \ + curl -sSL "https://dl.google.com/go/go1.14.3.linux-$ARCH.tar.gz" | tar -C /usr/local -xz +ENV PATH=/usr/local/go/bin:/root/go/bin:$PATH +ENV GO111MODULE=on +RUN go get mvdan.cc/sh/v3/cmd/shfmt +RUN go get github.com/goreleaser/nfpm/cmd/nfpm + +RUN curl -fsSL https://get.docker.com | sh diff --git a/ci/container/arm64/README.md b/ci/container/arm64/README.md new file mode 100644 index 00000000..388572ca --- /dev/null +++ b/ci/container/arm64/README.md @@ -0,0 +1,6 @@ +# arm64 + +Unfortunately there is no arm64 build of `debian:8` so +we need to use `debian:9` instead. + +This is just an exact copy of [../Dockerfile](../Dockerfile) with the base image change. diff --git a/ci/dev/lint.sh b/ci/dev/lint.sh index fb044c42..3ad7fff8 100755 --- a/ci/dev/lint.sh +++ b/ci/dev/lint.sh @@ -7,7 +7,10 @@ main() { eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js") stylelint $(git ls-files "*.css") tsc --noEmit - shellcheck -e SC2046,SC2164,SC2154 $(git ls-files "*.sh") + # See comment in ./ci/container/Dockerfile + if [[ ! ${CI-} ]]; then + shellcheck -e SC2046,SC2164,SC2154 $(git ls-files "*.sh") + fi } main "$@"