Skip to content

Commit

Permalink
workflows WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jj22ee committed Nov 29, 2024
1 parent 499afb1 commit 7e5c36a
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/release-ocb-components.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Automation - Release OLTP components

on:
push:
workflow_dispatch:
inputs:
candidate-version:
required: true
description: Release candidate version (beta, like 0.70.0)

jobs:
prepare-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: opentelemetry-collector-contrib
ref: aws-ocb-dev
- name: get hash
working-directory: opentelemetry-collector-contrib
run: |
RELEASE_HASH=$(git rev-parse HEAD)
echo RELEASE_HASH="$RELEASE_HASH" >> $GITHUB_ENV
echo "$RELEASE_HASH"
- name: build OCB
run: |
echo "hi"
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.ECR_ACCOUNT_ROLE_ARN }}
aws-region: us-east-1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to private AWS ECR
if: ${{ inputs.push_image == true || inputs.push_image == 'true' }}
uses: docker/login-action@v3
with:
registry: ${{ inputs.image_registry }}
env:
AWS_REGION: us-east-1

# Per https://docs.aws.amazon.com/AmazonECR/latest/public/docker-pull-ecr-image.html, it is possible to
# make unauthorized calls to get public ECR images (needed to build the ADOT Node docker image), but
# it can fail if you previously authenticated to a public repo. Adding this step to log out, so we
# ensure we can make unauthenticated call. This is important for making the pr_build workflow run on
# PRs created from forked repos.
- name: Logout of public AWS ECR
shell: bash
run: docker logout public.ecr.aws

- name: Build and push image according to input
working-directory: opentelemetry-collector-contrib/.github/workflows/ocb-utils/
uses: docker/build-push-action@v5
with:
push: true
context: .
file: ./Dockerfile
platforms: linux/amd64
tags: ${{ secrets.ECR_REPO }}:${{ env.RELEASE_HASH }}
load: false

# - name: trigger test in other repo
# run: |
# echo "hi"

# - name: if test passed, create tags PR
# run: |
# echo "hi"

# - name: if test passed, upload OCB to staging repo with latest as tag
# run: |
# echo "hi"

0 comments on commit 7e5c36a

Please sign in to comment.