commit 2041de4fd388c6035fa85f585b1b22b276eee29b Author: Nick Dumas Date: Fri Feb 3 19:23:21 2023 +0000 initial commit diff --git a/.Dockerfile.swp b/.Dockerfile.swp new file mode 100644 index 0000000..4954d90 Binary files /dev/null and b/.Dockerfile.swp differ diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..7e2c2a0 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,9 @@ +kind: pipeline +name: build-smart-commit + +steps: +- name: "build-and-push" + image: alpine/docker + commands: + - docker build -t code.ndumas.com/ndumas/smart-commit:latest . + - docker push code.ndumas.com/ndumas/smart-commit:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c3be59c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM alpine/git + +COPY ./smart-commit /bin/smart-commit +ENTRYPOINT ["sh /bin/smart-commit"] diff --git a/smart-commit b/smart-commit new file mode 100755 index 0000000..45adb08 --- /dev/null +++ b/smart-commit @@ -0,0 +1,10 @@ +#! /bin/bash + +STATUS=$(git status --porcelain) +STATUS_LEN=${#STATUS} +if [ $STATUS_LEN = 0 ]; then + exit 0 +else + git add . + git commit -qm "CI/CD Commit: $(date -Iseconds)" +fi diff --git a/smart-commit.sh b/smart-commit.sh new file mode 100644 index 0000000..e724356 --- /dev/null +++ b/smart-commit.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +STATUS=$(git status --porcelain) +STATUS_LEN=${#STATUS} +if [ $STATUS_LEN = 0 ]; then + exit 0 +else + git add . + git commit -qm "CI/CD Commit: $(date -Iseconds)" +fi