|
| 1 | +name: Build and Push Staging AWSOpenTelemetryDistroJs Layer |
| 2 | +description: | |
| 3 | + This action assumes that the repo was checked out. Builds and push Lambda Layer and sample app to S3 bucket for |
| 4 | + the further end to end tests. |
| 5 | +
|
| 6 | +inputs: |
| 7 | + aws-region: |
| 8 | + required: false |
| 9 | + description: 'AWS Region, required only if push_image is true' |
| 10 | + node_version: |
| 11 | + required: true |
| 12 | + description: 'The node version used in actions' |
| 13 | + layer_directory: |
| 14 | + required: true |
| 15 | + description: 'The role use to publish lambda layer' |
| 16 | + staging_s3_bucket: |
| 17 | + required: true |
| 18 | + description: 'S3 bucket holds SDK artifact tarball' |
| 19 | + staging_tarball: |
| 20 | + required: true |
| 21 | + description: 'tarball file for building' |
| 22 | + |
| 23 | +runs: |
| 24 | + using: 'composite' |
| 25 | + steps: |
| 26 | + - name: Download Tarball to GitHub Actions |
| 27 | + uses: actions/download-artifact@v3 |
| 28 | + with: |
| 29 | + name: ${{ inputs.staging_tarball}} |
| 30 | + path: ./aws-distro-opentelemetry-node-autoinstrumentation/ |
| 31 | + - name: Setup Layer Tools |
| 32 | + shell: bash |
| 33 | + run: npm install |
| 34 | + working-directory: ${{ inputs.layer_directory }} |
| 35 | + - name: Build Lambda Layer |
| 36 | + shell: bash |
| 37 | + run: npm install |
| 38 | + working-directory: ${{ inputs.layer_directory }}/packages/layer |
| 39 | + - name: Build Lambda Sample App |
| 40 | + shell: bash |
| 41 | + run: npm install |
| 42 | + working-directory: ${{ inputs.layer_directory }}/sample-apps/aws-sdk |
| 43 | + - name: Upload Layer to S3 |
| 44 | + shell: bash |
| 45 | + run: | |
| 46 | + aws s3 cp ./build/layer.zip s3://${{ env.STAGING_S3_BUCKET }}/layer-${{ github.run_id }}.zip |
| 47 | + working-directory: ${{ inputs.layer_directory }}/packages/layer |
| 48 | + - name: Upload Sample App to S3 |
| 49 | + shell: bash |
| 50 | + run: | |
| 51 | + aws s3 cp ./build/function.zip s3://${{ env.STAGING_S3_BUCKET }}/function-${{ github.run_id }}.zip |
| 52 | + working-directory: ${{ inputs.layer_directory }}/sample-apps/aws-sdk |
0 commit comments