diff --git a/.circleci/config.yml b/.circleci/config.yml index 751aba36..d10845f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -411,30 +411,6 @@ jobs: command: | FALCO_VERSION=$(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//') /source/falco/scripts/publish-deb -f /build/release/falco-${FALCO_VERSION}-x86_64.deb -r deb-dev - # Clenup the Falco development release packages - "cleanup/packages-dev": - docker: - - image: docker.bintray.io/jfrog/jfrog-cli-go:latest - steps: - - checkout: - path: /source/falco - - run: - name: Prepare env - command: | - apk add --no-cache --update - apk add curl jq - - run: - name: Only keep the 10 most recent Falco development release tarballs - command: | - /source/falco/scripts/cleanup -p ${BINTRAY_SECRET} -r bin-dev - - run: - name: Only keep the 50 most recent Falco development release RPMs - command: | - /source/falco/scripts/cleanup -p ${BINTRAY_SECRET} -r rpm-dev - - run: - name: Only keep the 50 most recent Falco development release DEBs - command: | - /source/falco/scripts/cleanup -p ${BINTRAY_SECRET} -r deb-dev # Publish docker packages "publish/docker-dev": docker: @@ -685,17 +661,6 @@ workflows: only: master requires: - "tests/integration" - # todo(leogr): the cleanup job is intende to work with bintray, now deprecated, - # do we still need it? - # - "cleanup/packages-dev": - # context: falco - # filters: - # tags: - # ignore: /.*/ - # branches: - # only: master - # requires: - # - "publish/packages-dev" - "publish/docker-dev": context: falco filters: diff --git a/scripts/cleanup b/scripts/cleanup deleted file mode 100755 index 92ba4f1e..00000000 --- a/scripts/cleanup +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash - -usage() { - echo "usage: $0 -p 0987654321 -r " - exit 1 -} - -user=poiana - -# Get the versions to delete. -# -# $1: repository to lookup -# $2: number of versions to skip. -get_versions() { - # The API endpoint returns the Falco package versions sort by most recent. - IFS=$'\n' read -r -d '' -a all < <(curl -s --header "Content-Type: application/json" "https://api.bintray.com/packages/falcosecurity/$1/falco" | jq -r '.versions | .[]' | tail -n "+$2") -} - -# Remove all the versions (${all[@]} array). -# -# $1: repository containing the versions. -rem_versions() { - for i in "${!all[@]}"; - do - JFROG_CLI_LOG_LEVEL=DEBUG jfrog bt vd --quiet --user "${user}" --key "${pass}" "falcosecurity/$1/falco/${all[$i]}" - done -} - -while getopts ":p::r:" opt; do - case "${opt}" in - p ) - pass=${OPTARG} - ;; - r ) - repo="${OPTARG}" - [[ "${repo}" == "deb-dev" || "${repo}" == "rpm-dev" || "${repo}" == "bin-dev" ]] || usage - ;; - : ) - echo "invalid option: ${OPTARG} requires an argument" 1>&2 - exit 1 - ;; - \?) - echo "invalid option: ${OPTARG}" 1>&2 - exit 1 - ;; - esac -done -shift $((OPTIND-1)) - -if [ -z "${pass}" ] || [ -z "${repo}" ]; then - usage -fi - -skip=51 -if [[ "${repo}" == "bin-dev" ]]; then - skip=11 -fi - -get_versions "${repo}" ${skip} -echo "number of versions to delete: ${#all[@]}" -rem_versions "${repo}" \ No newline at end of file