diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8f81e55 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +lint: + docker-compose run --rm lint \ No newline at end of file diff --git a/README.md b/README.md index fb4433a..c288138 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,7 @@ steps: - label: "Single Deployment Step" key: "deployment:${ENVIRONMENT}:${REGION}:single-deployment-step" plugins: - - rokt/tag-release#v1.0.0: - mark_pending: true + - ROKT/tag-release#v1.0.3-beta: mark_completed: true ``` @@ -41,12 +40,13 @@ steps: - label: "First Deployment Step" key: "deployment:${ENVIRONMENT}:${REGION}:first-deployment-step" plugins: - - rokt/tag-release#v1.0.0: + - ROKT/tag-release#v1.0.3-beta: mark_pending: true - label: "Final Deployment Step" key: "deployment:${ENVIRONMENT}:${REGION}:last-deployment-step" - - rokt/tag-release#v1.0.0: + plugins: + - ROKT/tag-release#v1.0.3-beta: mark_completed: true ``` @@ -61,21 +61,21 @@ steps: - label: "Deploy Service One" key: "deployment:${ENVIRONMENT}:${REGION}:deploy-service-one" plugins: - - rokt/tag-release#v1.0.0: + - ROKT/tag-release#v1.0.3-beta: mark_pending: true - mark_completed: true tag_identifier: service-one - label: "Begin Deployment of Service Two" key: "deployment:${ENVIRONMENT}:${REGION}:begin-deploy-service-two" plugins: - - rokt/tag-release#v1.0.0: + - ROKT/tag-release#v1.0.3-beta: mark_pending: true tag_identifier: service-two - label: "Complete Deployment of Service Two" key: "deployment:${ENVIRONMENT}:${REGION}:complete-deployment-service-two" - - rokt/tag-release#v1.0.0: + plugins: + - ROKT/tag-release#v1.0.3-beta: mark_completed: true tag_identifier: service-two ``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8997cf9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,6 @@ +services: + lint: + image: buildkite/plugin-linter + command: ['--id', 'ROKT/tag-release'] + volumes: + - ".:/plugin:ro" \ No newline at end of file diff --git a/hooks/post-command b/hooks/post-command index 592b988..0ac3ba6 100644 --- a/hooks/post-command +++ b/hooks/post-command @@ -3,7 +3,7 @@ set -eo pipefail basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" -if [ "${BUILDKITE_PLUGIN_BUILDKITE_TAG_RELEASE_MARK_COMPLETED}" == "true" ] +if [ "${BUILDKITE_PLUGIN_TAG_RELEASE_MARK_COMPLETED}" == "true" ] then - $basedir/lib/tag-release.sh "current" "pending" "previous" "${BUILDKITE_PLUGIN_BUILDKITE_TAG_RELEASE_TAG_IDENTIFIER}" + $basedir/lib/tag-release.sh "current" "pending" "previous" "${BUILDKITE_PLUGIN_TAG_RELEASE_TAG_IDENTIFIER}" fi diff --git a/hooks/pre-command b/hooks/pre-command index 01824ea..552d910 100644 --- a/hooks/pre-command +++ b/hooks/pre-command @@ -3,7 +3,7 @@ set -eo pipefail basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" -if [ "${BUILDKITE_PLUGIN_BUILDKITE_TAG_RELEASE_MARK_PENDING}" == "true" ] +if [ "${BUILDKITE_PLUGIN_TAG_RELEASE_MARK_PENDING}" == "true" ] then - $basedir/lib/tag-release.sh "pending" "" "" "${BUILDKITE_PLUGIN_BUILDKITE_TAG_RELEASE_TAG_IDENTIFIER}" + $basedir/lib/tag-release.sh "pending" "" "" "${BUILDKITE_PLUGIN_TAG_RELEASE_TAG_IDENTIFIER}" fi diff --git a/plugin.yml b/plugin.yml index ba8a79a..d05adf7 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,5 +1,6 @@ -name: "buildkite_tag_release" +name: Tag Release description: Tag commits with release tag when deploying +author: https://github.com/ROKT public: true requirements: - bash @@ -12,9 +13,9 @@ configuration: type: boolean # Should we mark the commit as current / previous tag_identifier: type: string # An identifier to include in the tag to distinguish deployment of different services within the same repository - oneOf: - - required: - - mark_pending - - required: - - mark_completed + oneOf: + - required: + - mark_pending + - required: + - mark_completed additionalProperties: false