Skip to content

Commit

Permalink
Add Infisical CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
schroedan committed May 13, 2024
1 parent 21da00d commit 44d1d9c
Show file tree
Hide file tree
Showing 27 changed files with 256 additions and 602 deletions.
19 changes: 12 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
{
"name": "devcontainer-features",
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest"
}
},
"customizations": {
"vscode": {
"extensions": [
"editorconfig.editorconfig",
"github.vscode-github-actions",
"mads-hartmann.bash-ide-vscode"
],
"settings": {
"json.schemas": [
{
Expand All @@ -11,15 +22,9 @@
"url": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainerFeature.schema.json"
}
]
},
"extensions": [
"mads-hartmann.bash-ide-vscode"
]
}
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"remoteUser": "node",
"updateContentCommand": "npm install -g @devcontainers/cli"
}
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false

[*.yaml]
indent_size = 2
9 changes: 9 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2

updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
time: '08:00'
timezone: 'Europe/Berlin'
31 changes: 18 additions & 13 deletions .github/workflows/release.yaml → .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
name: "Release dev container features & Generate Documentation"
name: Generate Documentation

on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
generate:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write
packages: write

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: "Publish Features"
- name: Generate documentation
uses: devcontainers/action@v1
with:
publish-features: "true"
base-path-to-features: "./src"
generate-docs: "true"

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
base-path-to-features: ./src
generate-docs: 'true'

- name: Create PR for Documentation
id: push_image_info
- name: Create PR for documentation
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
echo "Start."
# Configure git and Push updates
git config --global user.email github-actions[bot]@users.noreply.github.com
git config --global user.name github-actions[bot]
git config pull.rebase false
branch=automated-documentation-update-$GITHUB_RUN_ID
git checkout -b $branch
message='Automated documentation update'
# Add / update and commit
git add */**/README.md
git commit -m 'Automated documentation update [skip ci]' || export NO_UPDATES=true
# Push
if [ "$NO_UPDATES" != "true" ] ; then
git push origin "$branch"
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish Features

on:
push:
branches:
- main
workflow_dispatch:

jobs:
publish:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest

permissions:
packages: write

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Publish features
uses: devcontainers/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
publish-features: 'true'
base-path-to-features: ./src
39 changes: 25 additions & 14 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: "CI - Test Features"
name: Test Features

on:
push:
branches:
Expand All @@ -10,49 +11,59 @@ jobs:
test-autogenerated:
runs-on: ubuntu-latest
continue-on-error: true

strategy:
matrix:
features:
- color
- hello
- infisical-cli
baseImage:
- alpine:latest
- debian:latest
- fedora:latest
- ubuntu:latest
- mcr.microsoft.com/devcontainers/base:alpine
- mcr.microsoft.com/devcontainers/base:debian
- mcr.microsoft.com/devcontainers/base:ubuntu

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: "Install latest devcontainer CLI"
- name: Install latest devcontainer CLI
run: npm install -g @devcontainers/cli

- name: "Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'"
- name: Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'
run: devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} .

test-scenarios:
runs-on: ubuntu-latest
continue-on-error: true

strategy:
matrix:
features:
- color
- hello
- infisical-cli

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: "Install latest devcontainer CLI"
- name: Install latest devcontainer CLI
run: npm install -g @devcontainers/cli

- name: "Generating tests for '${{ matrix.features }}' scenarios"
- name: Generating tests for '${{ matrix.features }}' scenarios
run: devcontainer features test -f ${{ matrix.features }} --skip-autogenerated --skip-duplicated .

test-global:
runs-on: ubuntu-latest
continue-on-error: true

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: "Install latest devcontainer CLI"
- name: Install latest devcontainer CLI
run: npm install -g @devcontainers/cli

- name: "Testing global scenarios"
- name: Testing global scenarios
run: devcontainer features test --global-scenarios-only .
19 changes: 19 additions & 0 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Validate Features

on:
pull_request:
workflow_dispatch:

jobs:
validate:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Validate devcontainer-feature.json files
uses: devcontainers/action@v1
with:
validate-only: 'true'
base-path-to-features: ./src
16 changes: 0 additions & 16 deletions .github/workflows/validate.yml

This file was deleted.

Loading

0 comments on commit 44d1d9c

Please sign in to comment.