Skip to content

Commit

Permalink
feat: adds support for arm64 (M1) architecture while installing goss (#…
Browse files Browse the repository at this point in the history
…168)

* Adds support for arm64 architecture while installing goss

* Add tests

* Keep new lines
  • Loading branch information
fruit authored Dec 6, 2022
1 parent 253987c commit 68c004d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ promotion_requires: &promotion_requires
test-install-docker-tools-macos-old,
test-install-docker-tools-machine-latest,
test-install-docker-tools-machine-old,
test-install-docker-tools-machine-arm,
test-install-docker-compose-with-checksums,
test-install-docker-compose-with-sha256,
test-install-docker-compose-with-checksums-and-sha256,
Expand Down Expand Up @@ -90,12 +91,17 @@ jobs:
debug:
type: boolean
default: false
goss-architecture:
type: enum
default: amd64
enum: [ amd64, arm64 ]
executor: <<parameters.executor>>
steps:
- checkout
- jq/install
- docker/install-docker-tools:
install-goss-dgoss: << parameters.install-goss >>
goss-architecture: << parameters.goss-architecture >>
test-pull:
executor: docker-latest
steps:
Expand Down Expand Up @@ -514,6 +520,14 @@ workflows:
matrix:
parameters:
executor: [docker-latest, docker-old, machine-latest, machine-old]
goss-architecture: [amd64]
filters: *filters
- test-install-docker-tools:
name: test-install-docker-tools-<< matrix.executor >>
matrix:
parameters:
executor: [machine-arm]
goss-architecture: [arm64]
filters: *filters
- test-install-docker-tools:
name: test-install-docker-tools-<< matrix.executor >>
Expand Down Expand Up @@ -574,5 +588,9 @@ executors:
machine-latest:
machine:
image: ubuntu-2004:current
machine-arm:
resource_class: arm.medium
machine:
image: ubuntu-2004:202101-01

# VS Code Extension Version: 1.3.0
8 changes: 8 additions & 0 deletions src/commands/install-docker-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ parameters:
description: >
Extra output for orb developers
goss-architecture:
type: enum
default: amd64
enum: [ amd64, arm64 ]
description: >
Which Goss architecture to use. Supports `arm64` architecture from `v0.3.18` and newer.
steps:
- when:
condition: <<parameters.install-docker>>
Expand Down Expand Up @@ -131,3 +138,4 @@ steps:
version: <<parameters.goss-version>>
install-dir: <<parameters.goss-install-dir>>
debug: <<parameters.debug>>
architecture: <<parameters.goss-architecture>>
8 changes: 8 additions & 0 deletions src/commands/install-goss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,20 @@ parameters:
description: >
Extra output for orb developers
architecture:
type: enum
default: amd64
enum: [ amd64, arm64 ]
description: >
Which Goss architecture to use. Supports `arm64` architecture from `v0.3.18` and newer.
steps:
- run:
name: Install Goss and dgoss
environment:
PARAM_VERSION: <<parameters.version>>
PARAM_INSTALL_DIR: <<parameters.install-dir>>
PARAM_DEBUG: <<parameters.debug>>
PARAM_ARCHITECTURE: <<parameters.architecture>>
SCRIPT_UTILS: <<include(scripts/utils.sh)>>
command: << include(scripts/install-goss.sh) >>
4 changes: 2 additions & 2 deletions src/scripts/install-goss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ fi
# download/install
# goss
curl -O --silent --show-error --location --fail --retry 3 \
"https://github.com/aelsabbahy/goss/releases/download/$VERSION/goss-linux-amd64"
"https://github.com/aelsabbahy/goss/releases/download/$VERSION/goss-linux-$PARAM_ARCHITECTURE"

$SUDO mv goss-linux-amd64 "$PARAM_INSTALL_DIR"/goss
$SUDO mv goss-linux-$PARAM_ARCHITECTURE "$PARAM_INSTALL_DIR"/goss
$SUDO chmod +rx /usr/local/bin/goss

# test/verify goss
Expand Down

0 comments on commit 68c004d

Please sign in to comment.