Skip to content

feat: one-line install script #1924

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 21 commits into from
Jun 1, 2022
Merged

feat: one-line install script #1924

merged 21 commits into from
Jun 1, 2022

Conversation

bpmct
Copy link
Member

@bpmct bpmct commented May 31, 2022

Fixes #1852 The install script was originally used for code-server so many similar elements were used. I took inspiration from the code-server and kubectx docs for the installation guide as well.

  • remove unsupported methods leftover from code-server script
  • use proper package names for the coder/coder repo
  • test all methods and operating systems
    • Ubuntu/Debian amd64, arm64, armv7
    • MacOS (m1, amd64)
    • Fedora
    • Alpine Linux
    • Unsupported Linux (Arch)
  • fix has_standalone to reflect Coder's supported arcs
  • use accurate postinstall instructions for system services
  • Update README
    • Windows is not supported
  • host on coder.com/install.sh
  • fix lint rules

Test it:

Dry run

curl -L https://coder.com/install.sh | sh -s -- --dry-run

Install

curl -L https://coder.com/install.sh | sh

@bpmct bpmct requested review from khorne3, jsjoeio and kylecarbs June 1, 2022 03:35
@bpmct
Copy link
Member Author

bpmct commented Jun 1, 2022

Gonna work with @kylecarbs to get https://coder.com/install.sh up and running

Edit: done

@bpmct bpmct marked this pull request as ready for review June 1, 2022 03:37
install.sh Outdated
Comment on lines 351 to 355
# MacOS releases are packaged as .zip
case $OS in
darwin) STANDALONE_ARCHIVE_FORMAT=zip ;;
*) STANDALONE_ARCHIVE_FORMAT=tar.gz ;;
esac
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super happy with this implementation, had to make some adjustments since our OSX releases are published as .zips

Comment on lines +55 to +56
env:
SHELLCHECK_OPTS: --external-sources
Copy link
Member Author

@bpmct bpmct Jun 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This resolved some warnings around unspecified inputs. See https://www.mankier.com/1/shellcheck#-x and koalaman/shellcheck#902

The error was only for `/etc/os-release` in the script
$ make lint/shellcheck
In install.sh line 424:
                        . /etc/os-release
                          ^-------------^ SC1091: Not following: /etc/os-release was not specified as input (see shellcheck -x).


In install.sh line 450:
                        . /etc/os-release
                          ^-------------^ SC1091: Not following: /etc/os-release was not specified as input (see shellcheck -x).

```sh
coder server --dev
```

## docker-compose
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@khorne3 I feel like this section is a bit too long. Thoughts on stopping after docker-compose up?

Copy link
Contributor

@khorne3 khorne3 Jun 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think after docker-compose up say, "Follow the on-screen instructions" so people aren't left hanging and then omit the remainder

@bpmct bpmct force-pushed the bpmct/installscript branch from ae88c6c to a16a04a Compare June 1, 2022 14:44
@bpmct bpmct enabled auto-merge (squash) June 1, 2022 14:44
@bpmct bpmct disabled auto-merge June 1, 2022 14:45
install.sh Outdated
Comment on lines 45 to 49
--prefix <dir>
Sets the prefix used by standalone release archives. Defaults to ~/.local
The release is unarchived into ~/.local/lib/coder-X.X.X
and the binary symlinked into ~/.local/bin/coder
To install system wide pass ---prefix=/usr/local
Copy link
Member Author

@bpmct bpmct Jun 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kylecarbs actually, what do you think of defaulting to /usr/local/bin? code-server defaults to the home-directory one, but it's often not in PATH. helm's install script does this, so I wouldn't consider it too invasive.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 6879752

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-requested review on 6879752 and 8cba04c

@bpmct bpmct requested a review from kylecarbs June 1, 2022 17:50
@bpmct bpmct merged commit 46ffb67 into main Jun 1, 2022
@bpmct bpmct deleted the bpmct/installscript branch June 1, 2022 19:15
kylecarbs pushed a commit that referenced this pull request Jun 10, 2022
* feat: one-line install script

* remove homebrew support

* remove arch linux

* use proper filename for packages

* fix variable format

* fix systemd instructions

* fixes to standalone script

* fix missing var bugs

* fix standalone install

* fix for MacOS

* format

* fix armv7 assets and zips

* remove windows

* update install docs

* support external sources with shellcheck

* shfmt

* add external sources to GitHub action & unfold

* change wording

* first template docs

* default to /usr/local instead

* add option for binary name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: one-line curl ... | sh install script
3 participants