Skip to content

Commit

Permalink
Initial files
Browse files Browse the repository at this point in the history
  • Loading branch information
egonbraun committed Jun 11, 2024
1 parent cb44f73 commit bcaf265
Show file tree
Hide file tree
Showing 15 changed files with 842 additions and 1 deletion.
47 changes: 47 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "devcontainer",
"postAttachCommand": ".devcontainer/hooks/post_attach.sh",
"remoteUser": "dev",

"build": {
"dockerfile": "../src/Dockerfile",
"context": ".."
},

"customizations": {
"vscode": {
"settings": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.rulers": [80, 120],
"editor.wordBasedSuggestions": "off",
"explorer.excludeGitIgnore": true,
"extensions.ignoreRecommendations": true,
"git.enableCommitSigning": true,
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.shellIntegration.decorationsEnabled": "never",

"terminal.integrated.profiles.linux": {
"bash": {
"path": "/usr/bin/bash"
}
}
},

"extensions": [
"eamodio.gitlens",
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
"jetmartin.bats",
"ms-azuretools.vscode-docker",
"ms-vscode.makefile-tools"
]
}
},

"mounts": [
"type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock",
"type=bind,consistency=cached,source=${localWorkspaceFolder}/.tmp/history,target=/home/dev/.history",
"type=bind,consistency=cached,source=${localEnv:HOME}/.aws,target=/home/dev/.aws"
]
}
11 changes: 11 additions & 0 deletions .devcontainer/hooks/post_attach.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

direnv allow /workspaces/*

sudo chown root:docker /var/run/docker.sock
sudo chmod g+w /var/run/docker.sock

ls -d /workspaces/* | xargs git config --global --add safe.directory

starship preset plain-text-symbols -o ~/.config/starship.toml
starship config container.disabled true
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.gitkeep
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

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

[*.{yml,yaml,json}]
indent_size = 2

[Makefile]
indent_style = tab
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export PROJECT_AWS_ACCOUNT_ID="000000000000"
export PROJECT_BUILD_DATE="0000-00-00 00:00:00+00:00"
export PROJECT_NAME="devcontainer"
113 changes: 113 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Pipeline

on:
pull_request:
push:
tags:
- "v*"
workflow_dispatch:

env:
DOCKER_BUILDKIT: 1
PROJECT_DOCKER_PLATFORMS: ${{ vars.PROJECT_DOCKER_PLATFORMS }}
PROJECT_NAME: ${{ vars.PROJECT_NAME }}

jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare
uses: schubergphilis/prepare-action@v1
with:
type: container
job: lint

- name: Lint
run: |
make lint
scan:
name: Scan
runs-on: ubuntu-22.04
needs: lint
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare
uses: schubergphilis/prepare-action@v1
with:
type: container
job: scan

- name: Scan
run: |
make scan
pre-ci:
name: Pre-CI
runs-on: ubuntu-22.04
needs: scan
outputs:
platforms: ${{ steps.platforms.outputs.value }}
steps:
- name: Get Platforms as JSON
id: platforms
run: |
echo "value=[\"$(echo $PROJECT_DOCKER_PLATFORMS | sed 's/,/\",\"/g')\"]" >> $GITHUB_OUTPUT
ci:
name: CI
runs-on: ubuntu-22.04
needs: pre-ci
strategy:
matrix:
platforms: ${{ fromJSON(needs.pre-ci.outputs.platforms) }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare
uses: schubergphilis/prepare-action@v1
with:
type: container
job: ci

- name: Build
env:
PROJECT_DOCKER_PLATFORMS: ${{ matrix.platforms }}
run: |
make build
- name: Test
env:
PROJECT_DOCKER_PLATFORMS: ${{ matrix.platforms }}
run: |
make test
cd:
name: CD
runs-on: ubuntu-22.04
needs: ci
environment: dev
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare
uses: schubergphilis/prepare-action@v1
with:
type: container
job: cd

- name: Release
run: |
make release
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# MACOS
#

.apdisk
.AppleDB
.AppleDesktop
.AppleDouble
.com.apple.timemachine.donotpresent
.DocumentRevisions-V100
.DS_Store
.fseventsd
.LSOverride
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
*.icloud
Icon
Network Trash Folder
Temporary Items

#
# PROJECT
#

.tmp/history/
!.tmp/history/.gitkeep
7 changes: 7 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ignored:
- DL3008 # Pin versions in apt get install
- DL3050 # Superfluous label(s) present
- DL3059 # Multiple consecutive `RUN` instructions
failure-threshold: style
format: tty
strict-labels: true
Loading

0 comments on commit bcaf265

Please sign in to comment.