-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe6ce72
commit bad233f
Showing
15 changed files
with
283 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
echo "running commitlint against git history" | ||
npx -p @commitlint/config-conventional -p @commitlint/cli -c "cat $1 | commitlint" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
echo "running yamllint against repository" | ||
yamllint . | ||
|
||
echo "running hadolint against Dockerfile" | ||
hadolint Dockerfile | ||
|
||
echo "running shellcheck against repository" | ||
shellcheck scripts/**.sh -f gcc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
on: [pull_request] # yamllint disable-line rule:truthy | ||
name: main | ||
jobs: | ||
|
||
commitlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
- run: npm install --save-dev @commitlint/{config-conventional,cli} | ||
- run: npx commitlint --from=${{ github.event.pull_request.base.sha }} | ||
|
||
golangci-lint: | ||
strategy: | ||
matrix: | ||
go-version: [1.20.x] | ||
os: [ubuntu-latest, macos-latest] | ||
name: lint | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.51.1 | ||
|
||
yamllint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: yaml-lint | ||
uses: ibiqlik/action-yamllint@v3 | ||
|
||
hadolint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: hadolint/[email protected] | ||
with: | ||
dockerfile: Dockerfile | ||
|
||
test: | ||
strategy: | ||
matrix: | ||
go-version: [1.20.x] | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Test | ||
run: go test ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
name: Release Version | ||
|
||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: 'Release to GitHub' | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
|
||
- name: Install Semantic Release Plugins | ||
run: npm install --save-dev @semantic-release/changelog @semantic-release/git conventional-changelog-conventionalcommits # yamllint disable-line rule:line-length | ||
|
||
- name: Release Version | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }} | ||
run: npx semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
name: Upload Image | ||
|
||
on: # yamllint disable-line rule:truthy | ||
release: | ||
types: | ||
- created | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
branches: | ||
- master | ||
- main | ||
plugins: | ||
- - "@semantic-release/commit-analyzer" | ||
- preset: conventionalcommits | ||
- - "@semantic-release/release-notes-generator" | ||
- preset: conventionalcommits | ||
- - "@semantic-release/github" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# archlinux is rolling release, not specifying version | ||
# hadolint ignore=DL3006 | ||
FROM --platform=$BUILDPLATFORM archlinux as stage1 | ||
|
||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
COPY scripts/ /scripts/ | ||
RUN /scripts/configure.sh | ||
|
||
FROM stage1 as stage2 | ||
RUN /scripts/install_packages.sh | ||
|
||
FROM stage2 as stage3 | ||
RUN /scripts/modify_shell.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Makefile | ||
all: setup hooks | ||
|
||
# requires `nvm use --lts` or `nvm use node` | ||
.PHONY: setup | ||
setup: | ||
npm install -g @commitlint/config-conventional @commitlint/cli | ||
brew install hadolint | ||
brew install shellcheck | ||
|
||
|
||
.PHONY: hooks | ||
hooks: | ||
@git config --local core.hooksPath .githooks/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
ignores: [ | ||
(message) => message.includes('Initial commit') | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
version: "3.3" | ||
|
||
services: | ||
konnect: | ||
build: . | ||
command: sleep infinity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
zsh | ||
inetutils | ||
redis | ||
mariadb | ||
clickhouse | ||
mongosh-bin | ||
google-cloud-cli | ||
croc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Address Security Concerns | ||
pacman-key --init | ||
|
||
# Update All Packages | ||
pacman -Syu --noconfirm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
# Install packages from pkglist.txt | ||
pacman -S --needed --noconfirm - < scripts/pkglist.txt | ||
|
||
# Yay temporary build directory and user creation | ||
mkdir -p /tmp/yay-build | ||
useradd -m -G wheel builder && passwd -d builder | ||
chown -R builder:builder /tmp/yay-build | ||
echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers | ||
|
||
# Install yay | ||
su - builder -c "git clone https://aur.archlinux.org/yay.git /tmp/yay-build/yay" | ||
su - builder -c "cd /tmp/yay-build/yay && makepkg -si --noconfirm" | ||
|
||
# Remove yay temporary build directory | ||
# rm -rf /tmp/yay-build | ||
|
||
# Add non-root user captain | ||
# useradd -m -G wheel captain && passwd -d captain | ||
|
||
# Install packages from aurlist.txt | ||
yay -S --noconfirm - < /scripts/aurlist.txt | ||
|
||
# Install evans | ||
unamestr=$(uname -m) | ||
if [ "$unamestr" = "x86_64" ]; then | ||
curl -sSLO https://github.com/ktr0731/evans/releases/download/v0.10.11/evans_linux_amd64.tar.gz | ||
tar -xvzf evans_linux_amd64.tar.gz | ||
mv evans /usr/local/bin | ||
rm -rf evans_linux_amd64.tar.gz | ||
elif [ "$unamestr" = "aarch64" ] || [ $unamestr = "arm64" ]; then | ||
curl -sSLO https://github.com/ktr0731/evans/releases/download/v0.10.11/evans_linux_arm64.tar.gz | ||
tar -xvzf evans_linux_arm64.tar.gz | ||
mv evans /usr/local/bin | ||
rm -rf evans_linux_arm64.tar.gz | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Change default shell to zsh | ||
chsh -s /bin/zsh | ||
|
||
# Install oh-my-zsh | ||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
base | ||
base-devel | ||
git | ||
sudo | ||
go | ||
coreutils |