From d27617c7a52ac6cca308e04947117f5a5c860d6e Mon Sep 17 00:00:00 2001 From: Ayane Satomi Date: Sat, 21 Sep 2019 03:37:03 +0800 Subject: [PATCH 1/4] [doc/quickstart] use version from GH-379 This is the same PR but with some fixes for v2. Co-Authored-by: nwtnsqrd Signed-off-by: Ayane Satomi --- doc/quickstart.md | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/doc/quickstart.md b/doc/quickstart.md index b7e3afb23f7a..db76d15fcafb 100644 --- a/doc/quickstart.md +++ b/doc/quickstart.md @@ -59,27 +59,23 @@ In some cases you might need to run code-server automatically once the host star ```ini [Unit] - -Description=VSCode in a browser - +Description=Code Server IDE After=network.target [Service] - Type=simple - -ExecStart=/usr/bin/code-server $(pwd) - -WorkingDirectory=$HOME/projects - -ExecStop=/sbin/start-stop-daemon --stop -x /usr/bin/code-server - +User= +EnvironmentFile=$HOME/.profile +WorkingDirectory=$HOME Restart=on-failure +RestartSec=10 -User=1000 +ExecStart= $(pwd) -[Install] +StandardOutput=file:/var/log/code-server-output.log +StandardError=file:/var/log/code-server-error.log +[Install] WantedBy=multi-user.target ``` From ac6eb0d7c4b44589f434f9e5c8f5b5d019278b2e Mon Sep 17 00:00:00 2001 From: Ayane Satomi Date: Tue, 1 Oct 2019 00:56:54 +0800 Subject: [PATCH 2/4] [ci] make docker-exec compensate for ARM containers now Signed-off-by: Ayane Satomi --- scripts/ci.bash | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/scripts/ci.bash b/scripts/ci.bash index c5863b2f4008..6c33ba51feba 100755 --- a/scripts/ci.bash +++ b/scripts/ci.bash @@ -9,20 +9,26 @@ function docker-build() { local minify="${MINIFY:-}" if [[ "${target}" == "linux" ]] ; then image="codercom/nbin-centos" - fi + fi local containerId containerId=$(docker create --network=host --rm -it -v "$(pwd)"/.cache:/src/.cache "${image}") docker start "${containerId}" docker exec "${containerId}" mkdir -p /src - # TODO: temporary as long as we are rebuilding modules. - if [[ "${image}" == "codercom/nbin-alpine" ]] ; then - docker exec "${containerId}" apk add libxkbfile-dev libsecret-dev - else - # TODO: at some point git existed but it seems to have disappeared. - docker exec "${containerId}" yum install -y libxkbfile-devel libsecret-devel git - fi + + case "${image}" in + codercom/nbin-alpine-arm | codercom/nbin-apline-arm64 ) + docker exec "${containerId}" apk add libxkbfile-dev libsecret-dev git + ;; + codercom/nbin-arm | codercom-nbin-arm64) + docker exec "${containerId}" apt -y install libxkbfile-dev libsecret-dev git + ;; + *) + # Assume anything else is CentOS/Fedora/RHEL + docker exec "${containerId}" yum install -y libxkbfile-devel libsecret-devel git + ;; + esac function docker-exec() { local command="${1}" ; shift @@ -34,6 +40,8 @@ function docker-build() { docker cp ./. "${containerId}":/src docker-exec build if [[ -n "${package}" ]] ; then + #FIXME: Packages is not being preloaded in-container. + docker exec "${containerId}" bash -c "cd /src && yarn" docker-exec binary docker-exec package mkdir -p release @@ -52,6 +60,8 @@ function local-build() { local-exec build if [[ -n "${package}" ]] ; then + # FIXME: initialize node_modules as always + yarn local-exec binary local-exec package fi @@ -81,4 +91,4 @@ function main() { fi } -main "$@" +main "$@" \ No newline at end of file From 2907677e5e94b9b9b3ebd0d6642620987fa74694 Mon Sep 17 00:00:00 2001 From: Ayane Satomi Date: Tue, 1 Oct 2019 01:10:22 +0800 Subject: [PATCH 3/4] [ci] prepare CI script for ARM targets they will be seperate images from now on. Signed-off-by: Ayane Satomi --- scripts/ci.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ci.bash b/scripts/ci.bash index 6c33ba51feba..e1ddf5b70474 100755 --- a/scripts/ci.bash +++ b/scripts/ci.bash @@ -13,6 +13,7 @@ function docker-build() { local containerId containerId=$(docker create --network=host --rm -it -v "$(pwd)"/.cache:/src/.cache "${image}") + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes docker start "${containerId}" docker exec "${containerId}" mkdir -p /src From f8d9f2eeb05030ca0057633296fd068765a4b786 Mon Sep 17 00:00:00 2001 From: Ayane Satomi Date: Tue, 1 Oct 2019 01:15:05 +0800 Subject: [PATCH 4/4] [ci] add codercom/nbin-alpine to the APK command we might be doing something really bad by not putting it on the same rules as Alpine ARM Signed-off-by: Ayane Satomi --- scripts/ci.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci.bash b/scripts/ci.bash index e1ddf5b70474..a2915763c227 100755 --- a/scripts/ci.bash +++ b/scripts/ci.bash @@ -19,7 +19,7 @@ function docker-build() { case "${image}" in - codercom/nbin-alpine-arm | codercom/nbin-apline-arm64 ) + codercom/nbin-alpine-arm | codercom/nbin-apline-arm64 | codercom/nbin-alpine) docker exec "${containerId}" apk add libxkbfile-dev libsecret-dev git ;; codercom/nbin-arm | codercom-nbin-arm64)