Skip to content

Commit

Permalink
Revert "feat(provisioning): add cloudformation templates and related …
Browse files Browse the repository at this point in the history
…GHA (#42)"

This reverts commit acfa2d6.
  • Loading branch information
francesco-racciatti committed Jun 28, 2024
1 parent aa384c2 commit efd0e88
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 923 deletions.
72 changes: 0 additions & 72 deletions .github/workflows/promote.yml

This file was deleted.

93 changes: 21 additions & 72 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,96 +1,45 @@
name: release
name: Release agent-kilt

on:
workflow_dispatch:
inputs:
release_version:
description: 'The release version, e.g. 5.0.0.'
type: string
required: true
push:
tags:
- 'v*'

rc_number:
description: 'The release candidate number, e.g. 1.'
type: string
required: true

serverless_agent_version:
description: 'The version of the serverless-agent to be referenced by this release, e.g., 4.0.0. It will use the same version as the release if not specified.'
type: string
required: false
env:
GO_VERSION: 1.21.x

jobs:
release:
env:
RC_NAME: ${{ inputs.release_version }}-rc${{ inputs.rc_number }}
name: Release
runs-on: ubuntu-latest
steps:
- name: Verify inputs
shell: bash
run: |
if [[ ! "${{ inputs.release_version }}" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
echo "The provided release version is not valid"
exit 1
fi
if [[ ! "${{ inputs.rc_number }}" =~ ^([0-9])+$ ]]; then
echo "The provided rc tag is not valid"
exit 1
fi
docker pull "quay.io/sysdig/workload-agent:${{ inputs.serverless_agent_version }}" &> /dev/null
exit_code=$?
if [[ $exit_code -ne 0 ]]; then
echo "The provided serverless_agent_version does not exists."
exit 1
fi
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
id: go

- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Push RC tag
shell: bash
run: |
git fetch --tags
if git rev-parse "${RC_NAME}" &> /dev/null; then
echo "The tag ${RC_NAME} already exists"
exit 1
fi
git tag "${RC_NAME}"
git push -u origin "${RC_NAME}"
- name: Prepare dist package
shell: bash
run: |
rm -rf dist
mkdir -p dist/provisioning/cloudformation
- name: Add versioned CloudFormation templates
env:
RELEASE_VERSION: ${{ inputs.release_version }}
SERVERLESS_AGENT_VERSION: ${{ inputs.serverless_agent_version || inputs.release_version }}
shell: bash
- name: Build agent-kilt handler
run: |
script="s/(dev)/${RELEASE_VERSION}/g; s/agent:latest/agent:${SERVERLESS_AGENT_VERSION}/g"
sed "$script" provisioning/cloudformation/orchestrator-agent.yaml > dist/provisioning/cloudformation/orchestrator-agent.yaml
sed "$script" provisioning/cloudformation/instrumentation.yaml > dist/provisioning/cloudformation/instrumentation.yaml
make -C runtimes/cloudformation clean cmd/handler/handler
- name: Create prerelease attachments
shell: bash
- name: Archive build
run: |
pushd dist/provisioning; zip -r ../../cloudformation.zip .; popd
sha256sum cloudformation.zip > checksums.txt
zip -j agent-kilt.zip runtimes/cloudformation/cmd/handler/handler
sha256sum agent-kilt.zip > checksums.txt
- name: Create prerelease
uses: softprops/action-gh-release@v2
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
cloudformation.zip
agent-kilt.zip
checksums.txt
name: ${RC_NAME}
tag_name: ${RC_NAME}
prerelease: true
tag_name: ${{ github.ref }}
Loading

0 comments on commit efd0e88

Please sign in to comment.