Skip to content

fnichol/workstation

Repository files navigation

Workstation Automation

CI CI Status
License Crate license

Table of Contents

Supported Platforms

Currently, the following platforms are supported (older and newer version may also work):

  • Alpine Linux (3.15)
  • Arch Linux (rolling latest)
  • CentOS (8)
  • FreeBSD (13.0)
  • macOS (10.15)
  • OpenBSD (7.1)
  • Ubuntu Linux (20.04)
  • Windows 10 (21H2)

Installation

There are probably 2 use cases: running on a brand new system (before Git is even installed), and on an existing system (presumably with Git installed).

New System

Unix Platforms

wget https://github.com/fnichol/workstation/archive/master.tar.gz
tar xfz master.tar.gz
cd workstation-master

Alternatively, if wget is not present you can use curl:

curl -LO https://github.com/fnichol/workstation/archive/master.tar.gz
tar xfz master.tar.gz
cd workstation-master

Windows Platforms

From a non-administrative PowerShell session:

irm https://github.com/fnichol/workstation/archive/master.zip -OutFile master.zip
Expand-Archive master.zip
cd master\workstation-master

Existing System

On either Windows or Unix platforms:

git clone https://github.com/fnichol/workstation.git
cd workstation

Usage

Unix Platforms

To run the workstation prep with the graphical profile and set a hostname, provide your FQDN as the argument:

./bin/prep <FQDN>

If an FQDN isn't provided, then your hostname is left as-is.

There are currently 3 profiles to select from base, headless, and graphical with each profile building on the previous one. For example, running the headless profile can be done with:

./bin/prep --profile=headless <FQDN>

A full usage is reported with the --help flag:

prep --help
prep 0.5.0

Workstation Setup

USAGE:
    prep [FLAGS] [OPTIONS] [--] [<FQDN>]

FLAGS:
    -h, --help      Prints help information
    -V, --version   Prints version information
    -v, --verbose   Prints verbose output

OPTIONS:
    -p, --profile=<PROFILE> Setup profile name
                            [values: base, headless, graphical]
                            [default: graphical]
    -o, --only=<T>[,<T>..]  Only run specific tasks
                            [values: hostname, pkg-init, update-system,
                            base-pkgs, preferences, keys, bashrc,
                            base-dot-configs, base-finalize,
                            headless-pkgs, rust, ruby, go, node,
                            headless-finalize, graphical-pkgs,
                            graphical-dot-configs, graphical-finalize, vim,
                            finish-base, finish-headless, finish-graphical]
    -s, --skip=<T>[,<T>..]  Skip specific tasks
                            [values: hostname, pkg-init, update-system,
                            base-pkgs, preferences, keys, bashrc,
                            base-dot-configs, base-finalize,
                            headless-pkgs, rust, ruby, go, node,
                            headless-finalize, graphical-pkgs,
                            graphical-dot-configs, graphical-finalize, vim,
                            finish-base, finish-headless, finish-graphical]

ARGS:
    <FQDN>  The name for this workstation
    <T>     Task name to include or skip

AUTHOR:
    Fletcher Nichol <[email protected]>

To update the codebase to the current state of the main branch you can run:

./bin/update

Windows Platforms

On new Windows platforms, you'll need to update your execution policy to allow the current user to run external PowerShell scripts:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force

To run the workstation prep with the graphical profile and set a hostname, provide your hostname with the -Hostname option:

.\bin\prep -Hostname <HOSTNAME>

If a hostname isn't provided, then your hostname is left as-is.

There are currently 3 profiles to select from: base, headless, and graphical with each profile building on the previous one. For example, running the headless profile can be done with:

.\bin\prep -Profile headless

A full usage is provided using the Get-Help cmdlet with:

PS workstation> Get-Help .\bin\prep

NAME
    .\bin\prep.ps1

SYNOPSIS
    Workstation setup


SYNTAX
    .\bin\prep.ps1 [[-Profile] <String>] [[-Skip] <String[]>]
		[[-Only] <String[]>] [[-Hostname] <String>] [-NoReboot]
    [<CommonParameters>]


DESCRIPTION
    This program sets up a workstation


RELATED LINKS

REMARKS
    To see the examples, type: "get-help .\bin\prep.ps1 -examples".
    For more information, type: "get-help .\bin\prep.ps1 -detailed".
    For technical information, type: "get-help .\bin\prep.ps1 -full".

To update the codebase to the current state of the main branch you can run:

.\bin\update

Development and Testing

Alpine Linux

Build the headless profile using Docker by running:

./support/bin/ci docker build alpine 3.12 headless

You can log into the instance with:

./support/bin/ci docker run -D '--rm -ti' alpine 3.12 headless

Arch Linux

Build the headless profile using Docker by running:

./support/bin/ci docker build arch latest headless

You can log into the instance with:

./support/bin/ci docker run -D '--rm -ti' arch latest headless

CentOS Linux

Build the headless profile using Docker by running:

./support/bin/ci docker build centos 8 headless

You can log into the instance with:

./support/bin/ci docker run -D '--rm -ti' centos 8 headless

FreeBSD

Build the headless profile using Vagrant by running:

./support/bin/ci vagrant build freebsd 12.1 headless

You can log into the instance with:

./support/bin/ci vagrant console freebsd 12.1 headless

macOS

The Vagrant box will need to be built via the Bento project and added before this box will work.

Build the headless profile using Vagrant by running:

./support/bin/ci vagrant build macos 10.12 headless

You can log into the instance with:

./support/bin/ci vagrant console macos 10.12 headless

OpenBSD

Build the headless profile using Vagrant by running:

./support/bin/ci vagrant build openbsd 6.8 headless

You can log into the instance with:

./support/bin/ci vagrant console openbsd 6.8 headless

Ubuntu Linux

Build the headless profile using Docker by running:

./support/bin/ci docker build ubuntu 20.04 headless

You can log into the instance with:

./support/bin/ci docker run -D '--rm -ti' ubuntu 20.04 headless

Code of Conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

Issues

If you have any problems with or questions about this project, please contact us through a GitHub issue.

Contributing

You are invited to contribute to new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

Before you start to code, we recommend discussing your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.

Authors

Created and maintained by Fletcher Nichol ([email protected]).

License

Licensed under the Mozilla Public License Version 2.0 (LICENSE.txt).

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the MPL-2.0 license, shall be licensed as above, without any additional terms or conditions.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published