Skip to content

Commit

Permalink
feat: Add Illumos support
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Oct 21, 2021
1 parent 0d72f50 commit 5d2fb13
Show file tree
Hide file tree
Showing 10 changed files with 186 additions and 4 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,23 @@ jobs:
- name: Test
run: |
( cd assets/vagrant && ./test.sh openbsd6 )
test-openindiana:
runs-on: macos-latest
env:
VAGRANT_BOX: openindiana
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache Vagrant Boxes
uses: actions/cache@v2
with:
path: ~/.vagrant.d
key: ${{ runner.os }}-vagrant-${{ env.VAGRANT_BOX }}-${{ hashFiles('assets/vagrant/*.Vagrantfile') }}
restore-keys: |
${{ runner.os }}-vagrant-${{ env.VAGRANT_BOX }}-
- name: Test
run: |
( cd assets/vagrant && ./test.sh openindiana )
test-ubuntu:
runs-on: ubuntu-18.04
steps:
Expand Down Expand Up @@ -169,6 +186,11 @@ jobs:
with:
name: chezmoi-darwin-arm64
path: dist/chezmoi-nocgo_darwin_arm64/chezmoi
- name: Upload artifact chezmoi-illumos-amd64
uses: actions/upload-artifact@v2
with:
name: chezmoi-illumos-amd64
path: dist/chezmoi-nocgo_illumos_amd64/chezmoi
- name: Upload artifact chezmoi-linux-amd64
uses: actions/upload-artifact@v2
with:
Expand Down
1 change: 1 addition & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ builds:
env:
- CGO_ENABLED=0
goos:
- illumos
- linux
- darwin
- freebsd
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ test-docker:

.PHONY: test-vagrant
test-vagrant:
( cd assets/vagrant && ./test.sh debian11-i386 freebsd13 openbsd6 )
( cd assets/vagrant && ./test.sh debian11-i386 freebsd13 openbsd6 openindiana )

.PHONY: coverage-html
coverage-html: coverage
Expand Down
1 change: 1 addition & 0 deletions assets/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ check_goos_goarch() {
freebsd/amd64) return 0 ;;
freebsd/arm) return 0 ;;
freebsd/arm64) return 0 ;;
illumos/amd64) return 0 ;;
linux/386) return 0 ;;
linux/amd64) return 0 ;;
linux/arm) return 0 ;;
Expand Down
9 changes: 9 additions & 0 deletions assets/vagrant/openindiana.Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Vagrant.configure("2") do |config|
config.vm.box = "openindiana/hipster"
config.vm.box_version = "202109"
config.vm.synced_folder ".", "/chezmoi", type: "rsync"
config.vm.provision "shell", inline: <<-SHELL
pkg install -q compress/zip developer/gcc-7 developer/golang developer/versioning/git
SHELL
config.vm.provision "file", source: "assets/vagrant/openindiana.test-chezmoi.sh", destination: "test-chezmoi.sh"
end
5 changes: 5 additions & 0 deletions assets/vagrant/openindiana.test-chezmoi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -eufo pipefail

( cd /chezmoi && go test ./... )
1 change: 1 addition & 0 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ documentation, and shell completions.
| OS | Architectures | Archive |
| ---------- | --------------------------------------------------- | -------------------------------------------------------------- |
| FreeBSD | `amd64`, `arm`, `arm64`, `i386` | [`tar.gz`](https://github.com/twpayne/chezmoi/releases/latest) |
| Illumos | `amd64` | [`tar.gz`](https://github.com/twpayne/chezmoi/releases/latest) |
| Linux | `amd64`, `arm`, `arm64`, `i386`, `ppc64`, `ppc64le` | [`tar.gz`](https://github.com/twpayne/chezmoi/releases/latest) |
| macOS | `amd64`, `arm64` | [`tar.gz`](https://github.com/twpayne/chezmoi/releases/latest) |
| OpenBSD | `amd64`, `arm`, `arm64`, `i386` | [`tar.gz`](https://github.com/twpayne/chezmoi/releases/latest) |
Expand Down
127 changes: 127 additions & 0 deletions go.sum

Large diffs are not rendered by default.

19 changes: 17 additions & 2 deletions internal/cmd/testdata/scripts/archivetar.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ mksourcedir

chezmoi archive --output=archive.tar
exec tar -tf archive.tar
[!openbsd] cmp stdout golden/archive-tar
[!(illumos||openbsd)] cmp stdout golden/archive-tar
[illumos] cmp stdout golden/archive-tar-illumos
[openbsd] cmp stdout golden/archive-tar-openbsd

chezmoi archive --gzip --output=archive.tar.gz
exec tar -tzf archive.tar.gz
[!openbsd] cmp stdout golden/archive-tar
[!(illumos||openbsd)] cmp stdout golden/archive-tar
[illumos] cmp stdout golden/archive-tar-illumos
[openbsd] cmp stdout golden/archive-tar-openbsd

-- golden/archive-tar --
Expand All @@ -25,6 +27,19 @@ exec tar -tzf archive.tar.gz
.readonly
.symlink
.template
-- golden/archive-tar-illumos --
.create
.dir/
.dir/file
.dir/subdir/
.dir/subdir/file
.empty
.executable
.file
.private
.readonly
.symlink symbolic link to .dir/subdir/file
.template
-- golden/archive-tar-openbsd --
.create
.dir
Expand Down
3 changes: 2 additions & 1 deletion internal/cmd/testdata/scripts/templatefuncs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ stdout 2656FF1E876E9973

# test that the output function returns an error if the command fails
[!windows] ! chezmoi execute-template '{{ output "false" }}'
[!windows] stderr 'error calling output: exit status 1'
[!(windows||illumos)] stderr 'error calling output: exit status 1'
[illumos] stderr 'error calling output: exit status 255'

# test stat template function
chezmoi execute-template '{{ (stat ".").isDir }}'
Expand Down

0 comments on commit 5d2fb13

Please sign in to comment.