diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml deleted file mode 100644 index 03ceded..0000000 --- a/.github/workflows/main.yaml +++ /dev/null @@ -1,19 +0,0 @@ -on: [push] - -jobs: - new_relic: - runs-on: ubuntu-latest - name: New Relic Deployment Marker GitHub Action - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Test deployment marker - uses: ./ - with: - apiKey: ${{ secrets.NEW_RELIC_API_KEY }} - applicationId: ${{ secrets.APPLICATION_ID }} - revision: "deployment-marker-action-test-${{ github.sha }}" - user: "${{ github.actor }}" # optional - region: US # optional - accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }} # optional diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..edbfa5b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + basic_test: + runs-on: ubuntu-latest + name: Release marker example + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set Release Version from Tag + run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF:10} + + - name: Test deployment marker + uses: ./ + with: + apiKey: ${{ secrets.NEW_RELIC_API_KEY }} + applicationId: ${{ secrets.APPLICATION_ID }} + revision: "deployment-marker-action-release:${{ env.RELEASE_VERSION }}" + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..1bbbba2 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,54 @@ +name: Test Suite + +on: + pull_request: + push: + branches: + - master + +jobs: +# should_fail_test: +# runs-on: ubuntu-latest +# name: Should Fail Test +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# +# - name: Test deployment marker +# uses: ./ +# with: +# apiKey: ${{ secrets.NEW_RELIC_API_KEY }} +# applicationId: 0 +# revision: "deployment-marker-action-should-fail-test:${{ github.ref }}" + + basic_test: + runs-on: ubuntu-latest + name: Basic Usage Test + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Test deployment marker + uses: ./ + with: + apiKey: ${{ secrets.NEW_RELIC_API_KEY }} + applicationId: ${{ secrets.APPLICATION_ID }} + revision: "deployment-marker-action-basic-test:${{ github.ref }}" + + all_inputs_test: + runs-on: ubuntu-latest + name: All Inputs Test + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Test deployment marker + uses: ./ + with: + apiKey: ${{ secrets.NEW_RELIC_API_KEY }} + applicationId: ${{ secrets.APPLICATION_ID }} + revision: "deployment-marker-action-all-input-test-${{ github.sha }}" + user: "hardcoded-test-username" # optional + region: US # optional + accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }} # optional + diff --git a/README.md b/README.md index 74abaf8..9009e78 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ +[![Community Project header](https://github.com/newrelic/open-source-office/raw/master/examples/categories/images/Community_Project.png)](https://github.com/newrelic/open-source-office/blob/master/examples/categories/index.md#category-community-project) + # New Relic Application Deployment Marker -New Relic App Deployment Marker [![GitHub Marketplace version](https://img.shields.io/github/release/newrelic/deployment-marker-action.svg?label=Marketplace&logo=github)](https://github.com/marketplace/actions/new-relic-application-deployment-marker) diff --git a/entrypoint.sh b/entrypoint.sh index 87bcc0c..c9bae25 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,14 +1,11 @@ #!/bin/sh -RED='\033[0;31m' -NO_COLOR='\033[0m' - result=$(newrelic apm deployment create --applicationId "${APPLICATION_ID}" --revision "${REVISION}" --accountId "${NEW_RELIC_ACCOUNT_ID}" --user "${NEW_RELIC_DEPLOYMENT_USER}" 2>&1) exitStatus=$? if [ $exitStatus -ne 0 ]; then - printf "${RED}Error:${NO_COLOR} $result" + echo "::error:: $result" fi exit $exitStatus