install using official debs

This commit is contained in:
aptalca 2022-02-20 15:51:53 -05:00 committed by Ryan Kuba
parent 16909c6274
commit a1fa7f021e
9 changed files with 24 additions and 127 deletions

View File

@ -18,7 +18,7 @@ jobs:
fi
echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_CODE_SERVER_MASTER\". ****"
echo "**** Retrieving external version ****"
EXT_RELEASE=$(curl -sX GET https://registry.yarnpkg.com/code-server | jq -r '."dist-tags".latest' | sed 's|^|v|')
EXT_RELEASE=$(curl -u ${{ secrets.CR_USER }}:${{ secrets.CR_PAT }} -sX GET https://api.github.com/repos/coder/code-server/releases/latest | jq -r '.tag_name' | sed 's|^v||')
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
echo "**** Can't retrieve external version, exiting ****"
FAILURE_REASON="Can't retrieve external version for code-server branch master"

View File

@ -11,51 +11,16 @@ LABEL maintainer="aptalca"
ENV HOME="/config"
RUN \
echo "**** install node repo ****" && \
apt-get update && \
apt-get install -y \
gnupg && \
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
echo 'deb https://deb.nodesource.com/node_14.x focal main' \
> /etc/apt/sources.list.d/nodesource.list && \
curl -s https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo 'deb https://dl.yarnpkg.com/debian/ stable main' \
> /etc/apt/sources.list.d/yarn.list && \
echo "**** install build dependencies ****" && \
apt-get update && \
apt-get install -y \
build-essential \
libx11-dev \
libxkbfile-dev \
pkg-config \
python3 && \
echo "**** install runtime dependencies ****" && \
apt-get install -y \
git \
jq \
nano \
net-tools \
nodejs \
sudo \
yarn && \
echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET https://registry.yarnpkg.com/code-server \
| jq -r '."dist-tags".latest' | sed 's|^|v|'); \
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \
| awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \
fi && \
CODE_VERSION=$(echo "$CODE_RELEASE" | awk '{print substr($1,2); }') && \
npm config set python python3 && \
yarn config set network-timeout 600000 -g && \
yarn --production --verbose --frozen-lockfile global add code-server@"$CODE_VERSION" && \
yarn cache clean && \
curl -o \
/tmp/code-server.deb -L \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server_${CODE_RELEASE}_amd64.deb" && \
dpkg -i /tmp/code-server.deb && \
echo "**** clean up ****" && \
apt-get purge --auto-remove -y \
build-essential \
libx11-dev \
libxkbfile-dev \
libsecret-1-dev \
pkg-config && \
apt-get clean && \
rm -rf \
/config/* \
/tmp/* \

View File

@ -11,51 +11,16 @@ LABEL maintainer="aptalca"
ENV HOME="/config"
RUN \
echo "**** install node repo ****" && \
apt-get update && \
apt-get install -y \
gnupg && \
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
echo 'deb https://deb.nodesource.com/node_14.x focal main' \
> /etc/apt/sources.list.d/nodesource.list && \
curl -s https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo 'deb https://dl.yarnpkg.com/debian/ stable main' \
> /etc/apt/sources.list.d/yarn.list && \
echo "**** install build dependencies ****" && \
apt-get update && \
apt-get install -y \
build-essential \
libx11-dev \
libxkbfile-dev \
pkg-config \
python3 && \
echo "**** install runtime dependencies ****" && \
apt-get install -y \
git \
jq \
nano \
net-tools \
nodejs \
sudo \
yarn && \
echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET https://registry.yarnpkg.com/code-server \
| jq -r '."dist-tags".latest' | sed 's|^|v|'); \
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \
| awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \
fi && \
CODE_VERSION=$(echo "$CODE_RELEASE" | awk '{print substr($1,2); }') && \
npm config set python python3 && \
yarn config set network-timeout 600000 -g && \
yarn --production --verbose --frozen-lockfile global add code-server@"$CODE_VERSION" && \
yarn cache clean && \
curl -o \
/tmp/code-server.deb -L \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server_${CODE_RELEASE}_arm64.deb" && \
dpkg -i /tmp/code-server.deb && \
echo "**** clean up ****" && \
apt-get purge --auto-remove -y \
build-essential \
libx11-dev \
libxkbfile-dev \
libsecret-1-dev \
pkg-config && \
apt-get clean && \
rm -rf \
/config/* \
/tmp/* \

View File

@ -11,51 +11,16 @@ LABEL maintainer="aptalca"
ENV HOME="/config"
RUN \
echo "**** install node repo ****" && \
apt-get update && \
apt-get install -y \
gnupg && \
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
echo 'deb https://deb.nodesource.com/node_14.x focal main' \
> /etc/apt/sources.list.d/nodesource.list && \
curl -s https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo 'deb https://dl.yarnpkg.com/debian/ stable main' \
> /etc/apt/sources.list.d/yarn.list && \
echo "**** install build dependencies ****" && \
apt-get update && \
apt-get install -y \
build-essential \
libx11-dev \
libxkbfile-dev \
pkg-config \
python3 && \
echo "**** install runtime dependencies ****" && \
apt-get install -y \
git \
jq \
nano \
net-tools \
nodejs \
sudo \
yarn && \
echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sX GET https://registry.yarnpkg.com/code-server \
| jq -r '."dist-tags".latest' | sed 's|^|v|'); \
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \
| awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \
fi && \
CODE_VERSION=$(echo "$CODE_RELEASE" | awk '{print substr($1,2); }') && \
npm config set python python3 && \
yarn config set network-timeout 600000 -g && \
yarn --production --verbose --frozen-lockfile global add code-server@"$CODE_VERSION" && \
yarn cache clean && \
curl -o \
/tmp/code-server.deb -L \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server_${CODE_RELEASE}_armhf.deb" && \
dpkg -i /tmp/code-server.deb && \
echo "**** clean up ****" && \
apt-get purge --auto-remove -y \
build-essential \
libx11-dev \
libxkbfile-dev \
libsecret-1-dev \
pkg-config && \
apt-get clean && \
rm -rf \
/config/* \
/tmp/* \

2
Jenkinsfile vendored
View File

@ -104,7 +104,7 @@ pipeline {
steps{
script{
env.EXT_RELEASE = sh(
script: ''' curl -sX GET https://registry.yarnpkg.com/code-server | jq -r '."dist-tags".latest' | sed 's|^|v|' ''',
script: ''' curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest | jq -r '.tag_name' | sed 's|^v||' ''',
returnStdout: true).trim()
env.RELEASE_LINK = 'custom_command'
}

View File

@ -266,6 +266,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
## Versions
* **20.02.22:** - Install using the official debs.
* **29.12.21:** - Add `install-extension` as a helper for mods to install extensions.
* **06.12.21:** - Add `DEFAULT_WORKSPACE` env var.
* **29.11.21:** - Rebase to Ubuntu focal.

View File

@ -3,7 +3,7 @@
# jenkins variables
project_name: docker-code-server
external_type: na
custom_version_command: "curl -sX GET https://registry.yarnpkg.com/code-server | jq -r '.\"dist-tags\".latest' | sed 's|^|v|'"
custom_version_command: "curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest | jq -r '.tag_name' | sed 's|^v||'"
release_type: stable
release_tag: latest
ls_branch: master

View File

@ -77,6 +77,7 @@ app_setup_block: |
# changelog
changelogs:
- { date: "20.02.22:", desc: "Install using the official debs." }
- { date: "29.12.21:", desc: "Add `install-extension` as a helper for mods to install extensions." }
- { date: "06.12.21:", desc: "Add `DEFAULT_WORKSPACE` env var." }
- { date: "29.11.21:", desc: "Rebase to Ubuntu focal." }

View File

@ -15,7 +15,7 @@ fi
exec \
s6-setuidgid abc \
/usr/local/bin/code-server \
/usr/lib/code-server/bin/code-server \
--bind-addr 0.0.0.0:8443 \
--user-data-dir /config/data \
--extensions-dir /config/extensions \