Skip to content

ci: Add support for FreeBSD to the build process #2466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ You can disable minification by setting `MINIFY=`.
- Will build a standalone release with node and node_modules bundled into `./release-standalone`.
- [./ci/build/clean.sh](./build/clean.sh) (`yarn clean`)
- Removes all build artifacts.
- Will also `git reset --hard lib/vscode`.
- Useful to do a clean build.
- [./ci/build/code-server.sh](./build/code-server.sh)
- Copied into standalone releases to run code-server with the bundled node binary.
Expand Down
2 changes: 2 additions & 0 deletions ci/build/build-code-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ main() {

if ! [ -f ./lib/coder-cloud-agent ]; then
OS="$(uname | tr '[:upper:]' '[:lower:]')"
set +e
curl -fsSL "https://storage.googleapis.com/coder-cloud-releases/agent/latest/$OS/cloud-agent" -o ./lib/coder-cloud-agent
chmod +x ./lib/coder-cloud-agent
set -e
fi

parcel build \
Expand Down
1 change: 0 additions & 1 deletion ci/build/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ main() {

pushd lib/vscode
git clean -xffd
git reset --hard
popd
}

Expand Down
2 changes: 1 addition & 1 deletion ci/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ arch() {
aarch64)
echo arm64
;;
x86_64)
x86_64 | amd64)
echo amd64
;;
*)
Expand Down
7 changes: 6 additions & 1 deletion ci/steps/release-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ main() {
NODE_VERSION=v12.18.4
NODE_OS="$(uname | tr '[:upper:]' '[:lower:]')"
NODE_ARCH="$(uname -m | sed 's/86_64/64/; s/aarch64/arm64/')"
curl -L "https://nodejs.org/dist/$NODE_VERSION/node-$NODE_VERSION-$NODE_OS-$NODE_ARCH.tar.gz" | tar -xz
if [ "$NODE_OS" = "freebsd" ]; then
mkdir -p "$PWD/node-$NODE_VERSION-$NODE_OS-$NODE_ARCH/bin"
cp "$(which node)" "$PWD/node-$NODE_VERSION-$NODE_OS-$NODE_ARCH/bin"
else
curl -L "https://nodejs.org/dist/$NODE_VERSION/node-$NODE_VERSION-$NODE_OS-$NODE_ARCH.tar.gz" | tar -xz
fi
PATH="$PWD/node-$NODE_VERSION-$NODE_OS-$NODE_ARCH/bin:$PATH"

# https://github.com/actions/upload-artifact/issues/38
Expand Down
8 changes: 8 additions & 0 deletions doc/npm.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [Ubuntu, Debian](#ubuntu-debian)
- [Fedora, CentOS, RHEL](#fedora-centos-rhel)
- [macOS](#macos)
- [FreeBSD](#freebsd)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand Down Expand Up @@ -40,3 +41,10 @@ npm config set python python2
```bash
xcode-select --install
```

## FreeBSD

```sh
pkg install -y git python npm-node12 yarn-node12 pkgconf
pkg install -y libsecret libxkbfile libx11 libinotify
```
13 changes: 13 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ echo_latest_version() {
echo "$version"
}

echo_npm_postinstall() {
echoh
cath << EOF
The npm package has been installed successfully!
Please extend your path to use code-server:
PATH="$NPM_BIN_DIR:\$PATH"
Please run with:
code-server
EOF
}

echo_standalone_postinstall() {
echoh
cath << EOF
Expand Down Expand Up @@ -392,6 +403,7 @@ install_npm() {
echoh "Installing with yarn."
echoh
"$sh_c" yarn global add code-server --unsafe-perm
NPM_BIN_DIR="$(yarn global bin)" echo_npm_postinstall
return
elif command_exists npm; then
sh_c="sh_c"
Expand All @@ -401,6 +413,7 @@ install_npm() {
echoh "Installing with npm."
echoh
"$sh_c" npm install -g code-server --unsafe-perm
NPM_BIN_DIR="$(npm bin -g)" echo_npm_postinstall
return
fi
echoh
Expand Down
1 change: 0 additions & 1 deletion lib/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
"css-loader": "^3.2.0",
"debounce": "^1.0.0",
"deemon": "^1.4.0",
"electron": "9.3.3",
"eslint": "6.8.0",
"eslint-plugin-jsdoc": "^19.1.0",
"eslint-plugin-mocha": "8.0.0",
Expand Down
Loading