diff --git a/components/builder-minio/README.md b/components/builder-minio/README.md index af122af9a3..6439a2b53f 100644 --- a/components/builder-minio/README.md +++ b/components/builder-minio/README.md @@ -2,12 +2,10 @@ This plans implements `builder-minio` - **AWS S3** compatible storage for the **Habitat Builder**. -# Configuration +## Configuration All important configuration is described in the `habitat/default.toml` file and it is good practice. -# Versioning +## Versioning Each commit produces increment version number which is good approach for the *Continues Integration*. - - diff --git a/components/builder-minio/habitat/config/hook-helper.sh b/components/builder-minio/habitat/config/hook-helper.sh index 64d15379ad..26839ad234 100755 --- a/components/builder-minio/habitat/config/hook-helper.sh +++ b/components/builder-minio/habitat/config/hook-helper.sh @@ -1,5 +1,4 @@ -# -*- mode: shell-script -*- -# shellcheck shell=bash +#!/bin/bash # shellcheck disable=SC2140 # {{#each cfg.env}} @@ -25,9 +24,11 @@ fi export AWS_ACCESS_KEY_ID="$MINIO_ACCESS_KEY" export AWS_SECRET_ACCESS_KEY="$MINIO_SECRET_KEY" +# shellcheck disable=SC2034 MEMBERS='{{#if cfg.members }}{{strJoin cfg.members " "}}{{else}}{{pkg.svc_data_path}}{{/if}}' BUCKET_NAME="{{cfg.bucket_name}}" +# shellcheck disable=SC2034 BIND_ADDRESS="{{cfg.bind_address}}" BIND_PORT="{{cfg.bind_port}}" @@ -39,7 +40,7 @@ create_bucket() { aws_s3="aws --endpoint-url http://localhost:$BIND_PORT s3api" fi - if $aws_s3 list-buckets | grep "$BUCKET_NAME" > /dev/null; then + if $aws_s3 list-buckets | grep "$BUCKET_NAME" >/dev/null; then echo "Minio bucket is up to date." else echo "Creating minio bucket $BUCKET_NAME." diff --git a/components/builder-minio/habitat/hooks/post-run b/components/builder-minio/habitat/hooks/post-run index aeefcaaa5b..0dc062d430 100755 --- a/components/builder-minio/habitat/hooks/post-run +++ b/components/builder-minio/habitat/hooks/post-run @@ -1,10 +1,10 @@ -# -*- mode: shell-script -*- -# shellcheck shell=bash +#!/bin/bash set -e exec 2>&1 +# shellcheck disable=SC1091 . "{{ pkg.svc_config_path }}/hook-helper.sh" # post-run is much faster than minio diff --git a/components/builder-minio/habitat/hooks/reconfigure b/components/builder-minio/habitat/hooks/reconfigure index 75708051b7..43afe94947 100755 --- a/components/builder-minio/habitat/hooks/reconfigure +++ b/components/builder-minio/habitat/hooks/reconfigure @@ -1,10 +1,10 @@ #!/bin/bash -# shellcheck disable=2154 set -e exec 2>&1 +# shellcheck disable=SC1091 . "{{ pkg.svc_config_path }}/hook-helper.sh" create_bucket diff --git a/components/builder-minio/habitat/hooks/run b/components/builder-minio/habitat/hooks/run index c740bdbfd6..373f793497 100755 --- a/components/builder-minio/habitat/hooks/run +++ b/components/builder-minio/habitat/hooks/run @@ -1,5 +1,4 @@ -# -*- mode: shell-script -*- -# shellcheck shell=bash +#!/bin/bash # When run hook changes restart is happen. # Any change to the environment variables requires restart: @@ -13,6 +12,7 @@ exec 2>&1 +# shellcheck disable=SC1091 . "{{ pkg.svc_config_path }}/hook-helper.sh" # shellcheck disable=SC2086,SC2154 diff --git a/components/builder-minio/habitat/plan.sh b/components/builder-minio/habitat/plan.sh index 76a84e9902..1eef2f3371 100644 --- a/components/builder-minio/habitat/plan.sh +++ b/components/builder-minio/habitat/plan.sh @@ -8,17 +8,16 @@ pkg_deps=(core/aws-cli core/bash core/cacerts core/curl core/jq-static core/mini pkg_build_deps=(core/git) pkg_exports=( - [port]=bind_port - [bucket-name]=bucket_name - [minio-access-key]=env.MINIO_ACCESS_KEY - [minio-secret-key]=env.MINIO_SECRET_KEY + [port]=bind_port + [bucket-name]=bucket_name + [minio-access-key]=env.MINIO_ACCESS_KEY + [minio-secret-key]=env.MINIO_SECRET_KEY ) pkg_version() { # TED: After migrating the builder repo we needed to add to # the rev-count to keep version sorting working -# echo "$(($(git rev-list HEAD --count) + 5000))" - echo "$(($(git rev-list HEAD --count) + 5001))" + echo "$(($(git rev-list HEAD --count) + 5000))" } do_before() { @@ -27,17 +26,17 @@ do_before() { } do_unpack() { - return 0 + return 0 } -do_build(){ - return 0 +do_build() { + return 0 } do_install() { - return 0 + return 0 } do_strip() { - return 0 + return 0 }