Skip to content

Commit

Permalink
Hardcode bucket name and get tag from env
Browse files Browse the repository at this point in the history
  • Loading branch information
luckslovez committed Nov 28, 2023
1 parent 1dfddc0 commit 7a4c0cf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 51 deletions.
63 changes: 17 additions & 46 deletions .github/workflows/merge-to-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@ jobs:
# tag: "tmp-pr-${{ steps.get_pr_number.outputs.result }}"
steps:
- name: Get PR number
uses: actions/github-script@v6
# uses: actions/github-script@v6
id: get_pr_number
with:
script: |
return (
await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
})
).data[0].number;
result-encoding: string
run: |
echo 'what'
# with:
# script: |
# return (
# await github.rest.repos.listPullRequestsAssociatedWithCommit({
# commit_sha: context.sha,
# owner: context.repo.owner,
# repo: context.repo.repo,
# })
# ).data[0].number;
# result-encoding: string

# publish-linux:
# name: Publish linux packages to staging and production buckets
Expand Down Expand Up @@ -67,38 +69,7 @@ jobs:
publish-windows:
name: Publish windows packages to logging's production bucket
needs: get-release-tag
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read

steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-duration-seconds: 10800 # default to 1 hour, which might not suffice https://github.com/aws-actions/configure-aws-credentials#credential-lifetime
aws-region: us-east-2

- name: Launch Fargate task
uses: newrelic/fargate-runner-action@main
with:
aws_region: us-east-2
container_make_target: "upload-win-packages"
ecs_cluster_name: infra-agent-fb-e2e-testing
task_definition_name: infra-agent-fb-e2e-testing
cloud_watch_logs_group_name: infra-agent-fb-e2e-testing
# The log stream name must follow the {cloudwatch_log_prefix}/{container_name}
# that was used to create the ECS infrastructure. "ecs" is the default cloudwatch_log_prefix
# when not specified, and our container_name is infra-agent-fb-e2e-testing
cloud_watch_logs_stream_name: ecs/infra-agent-fb-e2e-testing
aws_vpc_subnet: subnet-06240c469195932cf
aws_vpc_security_groups: |
sg-0c4318be91bbe3cba
repo_name: "newrelic/fluent-bit-package"
ref: ${{ needs.get-release-tag.outputs.tag }}
task_environment:
- name: TAG
value: ${{ needs.get-release-tag.outputs.tag }}
- name: AWS_S3_BUCKET_NAME
value: "logging-fb-windows-packages"
uses: ./.github/workflows/run_task.yml
with:
container_make_target: "upload-win-packages"
secrets: inherit
9 changes: 4 additions & 5 deletions upload-win-packages/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ def upload_file(file_name, bucket):
logging.error(e)

if __name__ == "__main__":
token = os.environ['GITHUB_TOKEN']
asset_names = download_win_packages_from_gh_release(token)
bucket_name = os.environ['AWS_S3_BUCKET_NAME']
for asset_name in asset_names:
upload_file(asset_name, 'fluent-bit-package')
print(os.environ['REF'])
# asset_names = download_win_packages_from_gh_release(os.environ['GITHUB_TOKEN'], os.environ['REF'])
# for asset_name in asset_names:
# upload_file(asset_name, 'logging-fb-windows-packages')

0 comments on commit 7a4c0cf

Please sign in to comment.