diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..0e21a63 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,43 @@ +--- +kind: pipeline +type: docker +name: Check_Requirement + +steps: + - name: base_check + image: gradle:jdk11-alpine + commands: + - ./gradlew clean + - ./gradlew build + - ./gradlew test + +--- +kind: pipeline +type: docker +name: master_build + +steps: + - name: make_archive + image: alpine:latest + volumes: + - name: archives + path: /build + commands: + - tar cvzf /build/$(git log -n 1 --format="%h")_school_archive.gz.tar app/ gradle/ gradlew/ gradlew.bat README.md settings.gradle + trigger: + - branch: + - master + event: + - include: + - push +volumes: + - name: archives + host: + path: /srv/drone/school_project/archive/ +depends_on: + - Check_Requirement +--- +kind: signature +hmac: 82ce5e9bc63570a5614c4e7b3ddc888fadb36f7660ab0ab521d0cda3c5842e05 + +... diff --git a/README.md b/README.md index 80a3590..1babb91 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # School_Project +[![Build Status](http://drone.herisson.ovh/api/badges/undefined_name/School_Project/status.svg)](http://drone.herisson.ovh/undefined_name/School_Project) + School Project based on Cats Organized Neatly \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..943f0cb Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 42defcc..f398c33 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 79a61d4..65dcd68 100755 --- a/gradlew +++ b/gradlew @@ -144,7 +144,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +152,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac diff --git a/misc/pre-commit.sh b/misc/pre-commit.sh new file mode 100755 index 0000000..33b41fb --- /dev/null +++ b/misc/pre-commit.sh @@ -0,0 +1,82 @@ +#!/bin/sh + +echo 'Lovely Idea'; + +BASE_DIR="$(dirname $(readlink -f $0))/.." +cd $BASE_DIR +echo $BASE_DIR + +function clean() { + echo "Cleaning the folder" + $BASE_DIR/gradlew clean + +} + +function build() { + echo "Building the project" + $BASE_DIR/gradlew build + +} + +function test() { + echo "Testing the project" + $BASE_DIR/gradlew test + +} + +function run() { + echo "Running the project" + $BASE_DIR/gradlew run & + _PID=$! + sleep 3 + killpid $_PID +} + +function check_syntax() { + echo "Checking the syntax" + echo 'TODO Tonitch: check syntax script' + +} + +function make_archive() { + echo "Creating the archive on the parent folder" + tar --create --gzip --exclude-vcs --exclude-vcs-ignores -f ../archive.tar.gz "${BASE_DIR}/{app/, gradle/, gralew, gradlew.bat, settings.gradle}" +} + +case $1 in + + clean ) + clean ;; + + build ) + build ;; + + test ) + test ;; + + run ) + run ;; + + syntax ) + check_syntax ;; + + archive ) + clean && + build && + test && + run && + check_syntax && + make_archive ;; + + all ) + clean && + build && + test && + run && + check_syntax ;; + * ) + clean && + build && + test && + check_syntax ;; +esac