File tree Expand file tree Collapse file tree 14 files changed +267
-5
lines changed Expand file tree Collapse file tree 14 files changed +267
-5
lines changed Original file line number Diff line number Diff line change 16
16
features :
17
17
- bitwarden-cli
18
18
- bitwarden-secrets-manager
19
+ - vault
19
20
baseImage :
20
21
- debian:latest
21
22
- ubuntu:latest
29
30
- name : " Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'"
30
31
run : devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} .
31
32
33
+ test-autogenerated-ruby :
34
+ runs-on : ubuntu-latest
35
+ continue-on-error : false
36
+ strategy :
37
+ fail-fast : false
38
+ matrix :
39
+ features :
40
+ - kamal
41
+ baseImage :
42
+ - mcr.microsoft.com/devcontainers/ruby:latest
43
+ - ghcr.io/rails/devcontainer/images/ruby:3.4.2
44
+ steps :
45
+ - uses : actions/checkout@v4
46
+
47
+ - name : " Install latest devcontainer CLI"
48
+ run : npm install -g @devcontainers/cli
49
+
50
+ - name : " Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'"
51
+ run : devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} .
52
+
53
+
32
54
test-scenarios :
33
55
runs-on : ubuntu-latest
34
56
continue-on-error : false
37
59
features :
38
60
- bitwarden-cli
39
61
- bitwarden-secrets-manager
62
+ - vault
63
+ - kamal
40
64
steps :
41
65
- uses : actions/checkout@v4
42
66
Original file line number Diff line number Diff line change @@ -7,14 +7,31 @@ set -o nounset
7
7
SCRIPT_PATH=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd )
8
8
BASE_PATH=$( cd -- " $( dirname -- " ${SCRIPT_PATH} " ) " & > /dev/null && pwd )
9
9
10
- BASE_IMAGE=" ${BASE_IMAGE:- mcr.microsoft.com/ devcontainers/ base: ubuntu} "
10
+ BASE_IMAGE_DEFAULT=" mcr.microsoft.com/devcontainers/base:ubuntu"
11
+ BASE_IMAGES=' {
12
+ "kamal": "mcr.microsoft.com/devcontainers/ruby:latest"
13
+ }'
11
14
12
- PARAM_FEATURES=
15
+ error () {
16
+ echo " ERROR: $@ "
17
+ echo " USAGE: $0 <feature>"
18
+ exit 1
19
+ }
13
20
14
- if [ $# -gt 0 ]; then
15
- PARAM_FEATURES=" --features $@ "
21
+ if [ $# -eq 0 ]; then
22
+ error " missing feature name"
23
+ elif [ $# -gt 1 ]; then
24
+ error " you can only test one feature at a time"
25
+ elif [[ $1 == + ([0-9]) ]]; then
26
+ error " a number can't be a features name"
16
27
fi
17
28
29
+ FEATURE=" $1 "
30
+ BASE_IMAGE=" ${BASE_IMAGE:- $(echo $BASE_IMAGES | jq --raw-output " .$FEATURE // empty" )} "
31
+ BASE_IMAGE=" ${BASE_IMAGE:- $BASE_IMAGE_DEFAULT } "
32
+
18
33
cd $BASE_PATH
19
34
20
- devcontainer features test --skip-scenarios --skip-duplicated $PARAM_FEATURES --base-image $BASE_IMAGE .
35
+ echo $BASE_IMAGE
36
+
37
+ devcontainer features test --skip-scenarios --skip-duplicated --features $FEATURE --base-image $BASE_IMAGE --project-folder $BASE_PATH
Original file line number Diff line number Diff line change
1
+
2
+ # Kamal Deploy (kamal)
3
+
4
+ Installs Kamal Deploy directly via rubygems.
5
+
6
+ ## Example Usage
7
+
8
+ ``` json
9
+ "features" : {
10
+ "ghcr.io/RouL/devcontainer-features/kamal:1" : {}
11
+ }
12
+ ```
13
+
14
+ ## Options
15
+
16
+ | Options Id | Description | Type | Default Value |
17
+ | -----| -----| -----| -----|
18
+ | version | Provides the version to be installed. Defaults to newest available version. | string | - |
19
+
20
+
21
+
22
+ ---
23
+
24
+ _ Note: This file was auto-generated from the [ devcontainer-feature.json] ( https://github.com/RouL/devcontainer-features/blob/main/src/kamal/devcontainer-feature.json ) . Add additional notes to a ` NOTES.md ` ._
Original file line number Diff line number Diff line change
1
+ {
2
+ "id" : " kamal" ,
3
+ "version" : " 1.0.0" ,
4
+ "name" : " Kamal Deploy" ,
5
+ "description" : " Installs Kamal Deploy directly via rubygems." ,
6
+ "installsAfter" : [
7
+ " ghcr.io/devcontainers/features/ruby" ,
8
+ " ghcr.io/devcontainers-extra/features/ruby-asdf"
9
+ ],
10
+ "options" : {
11
+ "version" : {
12
+ "description" : " Provides the version to be installed. Defaults to newest available version." ,
13
+ "type" : " string" ,
14
+ "default" : " "
15
+ }
16
+ }
17
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ set -e
3
+
4
+ GEM_NAME=" kamal"
5
+ VERSION=" ${VERSION} "
6
+ USERNAME=" ${USERNAME:- " ${_REMOTE_USER:- " automatic" } " } "
7
+
8
+ error () {
9
+ echo " $1 " >&2
10
+ echo " Exiting..." >&2
11
+ exit 1
12
+ }
13
+
14
+ check_ruby_env () {
15
+ if command -v ruby > /dev/null; then
16
+ export RUBY_ENV=" ruby"
17
+ elif command -v rbenv > /dev/null; then
18
+ export RUBY_ENV=" rbenv"
19
+ else
20
+ error " ERROR: Couldn't find ruby"
21
+ fi
22
+ }
23
+
24
+ gem_install () {
25
+ PARAMS=" $@ "
26
+
27
+ case $RUBY_ENV in
28
+ ruby)
29
+ su $USERNAME -c " gem install $PARAMS "
30
+ ;;
31
+ rbenv)
32
+ su $USERNAME -c " rbenv exec gem install $PARAMS "
33
+ ;;
34
+ esac
35
+ }
36
+
37
+ install () {
38
+ VERSION_PARAM=
39
+ if [ " $VERSION " != " " ]; then
40
+ VERSION_PARAM=" --version $VERSION "
41
+ fi
42
+
43
+ gem_install --no-document $VERSION_PARAM $GEM_NAME
44
+ }
45
+
46
+ check_ruby_env
47
+
48
+ echo " (*) Installing Kamal Deploy ($RUBY_ENV )..."
49
+
50
+ install
51
+
52
+ # Clean up
53
+ rm -rf /var/lib/apt/lists/*
54
+
55
+ echo " Done!"
Original file line number Diff line number Diff line change
1
+ set -e
2
+
3
+ check_kamal_version () {
4
+ VERSION=" $1 "
5
+
6
+ check " kamal version == $VERSION " bash -c " kamal version | grep -E '^${VERSION// \. / \\ .} \$ ' > /dev/null"
7
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ source dev-container-features-test-lib
5
+ source functions.sh
6
+
7
+ check_kamal_version " 1.9.2"
8
+
9
+ reportResults
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ source dev-container-features-test-lib
5
+ source functions.sh
6
+
7
+ check_kamal_version " 2.4.0"
8
+
9
+ reportResults
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ source dev-container-features-test-lib
5
+ source functions.sh
6
+
7
+ check_kamal_version " 2.5.0"
8
+
9
+ reportResults
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ source dev-container-features-test-lib
5
+ source functions.sh
6
+
7
+ check_kamal_version " 2.5.0"
8
+
9
+ reportResults
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ source dev-container-features-test-lib
5
+ source functions.sh
6
+
7
+ check_kamal_version " 1.9.2"
8
+
9
+ reportResults
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ source dev-container-features-test-lib
5
+ source functions.sh
6
+
7
+ check_kamal_version " 2.5.0"
8
+
9
+ reportResults
Original file line number Diff line number Diff line change
1
+ {
2
+ "mcr-ruby3.3-kamal2.5.0" : {
3
+ "image" : " mcr.microsoft.com/devcontainers/ruby:3.3" ,
4
+ "features" : {
5
+ "kamal" : {
6
+ "version" : " 2.5.0"
7
+ }
8
+ }
9
+ },
10
+ "mcr-ruby3.3-kamal2.4.0" : {
11
+ "image" : " mcr.microsoft.com/devcontainers/ruby:3.3" ,
12
+ "features" : {
13
+ "kamal" : {
14
+ "version" : " 2.4.0"
15
+ }
16
+ }
17
+ },
18
+ "mcr-ruby3.3-kamal1.9.2" : {
19
+ "image" : " mcr.microsoft.com/devcontainers/ruby:3.3" ,
20
+ "features" : {
21
+ "kamal" : {
22
+ "version" : " 1.9.2"
23
+ }
24
+ }
25
+ },
26
+ "rails-ruby3.4.2-kamal2.5.0" : {
27
+ "image" : " ghcr.io/rails/devcontainer/images/ruby:3.4.2" ,
28
+ "features" : {
29
+ "kamal" : {
30
+ "version" : " 2.5.0"
31
+ }
32
+ }
33
+ },
34
+ "rails-ruby3.4.2-kamal1.9.2" : {
35
+ "image" : " ghcr.io/rails/devcontainer/images/ruby:3.4.2" ,
36
+ "features" : {
37
+ "kamal" : {
38
+ "version" : " 1.9.2"
39
+ }
40
+ }
41
+ },
42
+ "rails-ruby3.3.7-kamal2.5.0" : {
43
+ "image" : " ghcr.io/rails/devcontainer/images/ruby:3.3.7" ,
44
+ "features" : {
45
+ "kamal" : {
46
+ "version" : " 2.5.0"
47
+ }
48
+ }
49
+ }
50
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ sudo apt-get update -y > /dev/null
5
+ sudo apt-get install -y curl jq ca-certificates > /dev/null
6
+
7
+ CURRENT_VERSION=" $( curl -L --no-progress-meter https://rubygems.org/api/v1/gems/kamal.json | jq --raw-output ' .version' ) "
8
+
9
+ source dev-container-features-test-lib
10
+ source functions.sh
11
+
12
+ check_kamal_version " $CURRENT_VERSION "
13
+
14
+ reportResults
You can’t perform that action at this time.
0 commit comments