Skip to content

Commit

Permalink
Merge branch 'master' into improvement/AAE-25854-docker-build-with-pu…
Browse files Browse the repository at this point in the history
…ll-push-tokens
  • Loading branch information
wojciech-piotrowiak authored Nov 8, 2024
2 parents 9a6a462 + d02b5ce commit ee9c989
Show file tree
Hide file tree
Showing 34 changed files with 328 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .github/actions/calculate-next-internal-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:
using: "composite"
steps:
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-pysemver@v8.2.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-pysemver@v8.3.0
- id: next-prerelease-resolver
run: ${{ github.action_path }}/next-prerelease.sh
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/dbp-charts/publish-chart/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ runs:
with:
fetch-depth: 0
- name: Get branch name
uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v8.2.0
uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v8.3.0
- name: Publish
run: ${{ github.action_path }}/publish_chart.sh
shell: bash
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/dbp-charts/verify-helm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ runs:
password: ${{ inputs.docker_password }}
- name: Get branch name
uses: >-
Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v8.2.0
Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v8.3.0
- name: Get commit msg
uses: >-
Alfresco/alfresco-build-tools/.github/actions/get-commit-message@v8.2.0
Alfresco/alfresco-build-tools/.github/actions/get-commit-message@v8.3.0
- name: Get a namespace to deploy on
id: k8sns
uses: >-
Alfresco/alfresco-build-tools/.github/actions/dbp-charts/kubernetes-valid-ns@v8.2.0
Alfresco/alfresco-build-tools/.github/actions/dbp-charts/kubernetes-valid-ns@v8.3.0
with:
branch_name: ${{ env.BRANCH_NAME }}
release_prefix: ${{ inputs.release_prefix }}
Expand All @@ -111,7 +111,7 @@ runs:
- name: Upload helm deployments logs as artifacts
if: always()
uses: >-
Alfresco/alfresco-build-tools/.github/actions/kubectl-keep-nslogs@v8.2.0
Alfresco/alfresco-build-tools/.github/actions/kubectl-keep-nslogs@v8.3.0
with:
namespace: ${{ steps.k8sns.outputs.namespace }}
- name: Uninstall Helm releases
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/docker-build-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ runs:

- name: Anchore Scan API Image
if: inputs.grype-scan-enabled == 'true'
uses: anchore/scan-action@ef0b0b023552a0c077534074723a9915280284bb # v5.1.0
uses: anchore/scan-action@f2ba85e044c8f5e5014c9a539328a9c78d3bfa49 # v5.2.1
id: scan
with:
fail-build: ${{ inputs.grype-fail-build }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/enforce-pr-conventions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:
using: composite
steps:
- name: Get branch name
uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v8.2.0
uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v8.3.0

- name: Check is Dependabot PR or Propagation PR
id: check
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/get-build-info/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: "Get build-related info from GitHub and load it as generically name
runs:
using: composite
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v8.2.0
- uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v8.3.0
- name: "Get build info"
run: |
[[ $GITHUB_EVENT_NAME == "pull_request" ]] && IS_PULL_REQUEST="true" || IS_PULL_REQUEST="false"
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/github-check-upcoming-runs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:
using: "composite"
steps:
- name: Get branch name
uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v8.2.0
uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v8.3.0

- name: Check upcoming runs
id: check
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/github-deployment-create/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ runs:
- name: Update Deployment State
if: ${{ inputs.state != '' }}
uses: Alfresco/alfresco-build-tools/.github/actions/github-deployment-status-update@v8.2.0
uses: Alfresco/alfresco-build-tools/.github/actions/github-deployment-status-update@v8.3.0
with:
github-token: ${{ inputs.github-token }}
deployment-id: ${{ steps.create.outputs.id }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/helm-integration-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ runs:
using: composite
steps:
- name: Setup rancher
uses: Alfresco/alfresco-build-tools/.github/actions/setup-rancher-cli@v8.2.0
uses: Alfresco/alfresco-build-tools/.github/actions/setup-rancher-cli@v8.3.0
with:
url: ${{ inputs.test-rancher-url }}
access-key: ${{ inputs.test-rancher-access-key }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/helm-publish-chart/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ runs:
fi
- name: Commit changes
uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@v8.2.0
uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@v8.3.0
with:
username: ${{ inputs.git-username }}
add-options: .
Expand Down
10 changes: 5 additions & 5 deletions .github/actions/helm-release-and-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,22 @@ runs:
run: |
echo "VERSION=$VERSION" >> $GITHUB_ENV
- uses: Alfresco/alfresco-build-tools/.github/actions/git-check-existing-tag@v8.2.0
- uses: Alfresco/alfresco-build-tools/.github/actions/git-check-existing-tag@v8.3.0
id: check-tag
with:
tag: ${{ env.VERSION }}
repository-directory: ${{ inputs.chart-repository-dir }}

- name: Update chart version
if: steps.check-tag.outputs.exists == 'false'
uses: Alfresco/alfresco-build-tools/.github/actions/helm-update-chart-version@v8.2.0
uses: Alfresco/alfresco-build-tools/.github/actions/helm-update-chart-version@v8.3.0
with:
new-version: ${{ env.VERSION }}
chart-repository-dir: ${{ inputs.chart-repository-dir }}
chart-dir: ${{ inputs.chart-dir }}
helm-docs-version: ${{ inputs.helm-docs-version }}

- uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@v8.2.0
- uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@v8.3.0
if: steps.check-tag.outputs.exists == 'false'
with:
username: ${{ inputs.git-username }}
Expand All @@ -79,7 +79,7 @@ runs:
- name: Package Helm Chart
if: steps.check-tag.outputs.exists == 'false'
id: package-helm-chart
uses: Alfresco/alfresco-build-tools/.github/actions/helm-package-chart@v8.2.0
uses: Alfresco/alfresco-build-tools/.github/actions/helm-package-chart@v8.3.0
with:
chart-dir: ${{ inputs.chart-dir }}
chart-repository-dir: ${{ inputs.chart-repository-dir }}
Expand All @@ -92,7 +92,7 @@ runs:

- name: Publish Helm chart
if: steps.check-tag.outputs.exists == 'false'
uses: Alfresco/alfresco-build-tools/.github/actions/helm-publish-chart@v8.2.0
uses: Alfresco/alfresco-build-tools/.github/actions/helm-publish-chart@v8.3.0
with:
helm-charts-repo: ${{inputs.helm-repository}}
helm-charts-repo-branch: ${{ inputs.helm-repository-branch }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/helm-update-chart-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ inputs:
runs:
using: composite
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-helm-docs@v8.2.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-helm-docs@v8.3.0
with:
version: ${{ inputs.helm-docs-version }}
- name: Update version
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/maven-build-and-tag/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ runs:
- name: Update pom files to the new version
id: update-pom-to-next-version
if: github.event_name == 'push' || env.IS_PREVIEW == 'true'
uses: Alfresco/alfresco-build-tools/.github/actions/update-pom-to-next-pre-release@v8.2.0
uses: Alfresco/alfresco-build-tools/.github/actions/update-pom-to-next-pre-release@v8.3.0
with:
property-to-update: ${{ inputs.property-to-update }}
maven-cli-opts: ${{ steps.compute-maven-options.outputs.result }}
Expand Down Expand Up @@ -256,7 +256,7 @@ runs:
shell: bash
run: find . -name TEST-*.xml -exec grep -h testcase {} \; | awk -F '"' '{printf("%s#%s() - %.3fms\n", $4, $2, $6); }' | sort -n -k 3 | tail -20

- uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@v8.2.0
- uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@v8.3.0
if: github.event_name == 'push'
with:
username: ${{ inputs.git-username }}
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/maven-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ runs:
path: '${{ env.REPO_DIR }}'
token: ${{ inputs.github-token }}

- uses: Alfresco/alfresco-build-tools/.github/actions/git-check-existing-tag@v8.2.0
- uses: Alfresco/alfresco-build-tools/.github/actions/git-check-existing-tag@v8.3.0
id: check-tag
with:
tag: ${{ env.RELEASE_VERSION }}
Expand Down Expand Up @@ -147,7 +147,7 @@ runs:
- name: Commit changes
if: steps.check-tag.outputs.exists == 'false'
uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@v8.2.0
uses: Alfresco/alfresco-build-tools/.github/actions/git-commit-changes@v8.3.0
with:
username: ${{ inputs.git-username }}
add-options: -u
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/pipenv/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pipenv==2024.1.0
pipenv==2024.4.0
2 changes: 1 addition & 1 deletion .github/actions/reportportal-prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ runs:
using: composite
steps:
- name: Get branch name
uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v8.2.0
uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v8.3.0

- name: Compute Report Portal input info
id: info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runs:
- name: Slack Notification
if: fromJSON(steps.fetch_time.outputs.total_time) > fromJSON(inputs.max-build-time-seconds)
uses: Alfresco/alfresco-build-tools/.github/actions/send-slack-notification@v8.2.0
uses: Alfresco/alfresco-build-tools/.github/actions/send-slack-notification@v8.3.0
with:
channel-id: ${{ inputs.slack-channel }}
message: 'Max build time exceeded: took ${{ steps.fetch_time.outputs.total_time }} seconds (expected max: ${{ inputs.max-build-time-seconds }} seconds)'
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/send-slack-notification/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ runs:
echo "result=$RESULT" >> $GITHUB_OUTPUT
- name: Get branch name
uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v8.2.0
uses: Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v8.3.0

- name: Send slack notification
id: slack
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-helm-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ outputs:
runs:
using: "composite"
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-github-release-binary@v8.2.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-github-release-binary@v8.3.0
with:
repo: norwoodj/helm-docs
version: ${{ inputs.version != '' && inputs.version || env.DEFAULT_HELM_DOCS_VERSION }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-jx-release-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
runs:
using: "composite"
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-github-release-binary@v8.2.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-github-release-binary@v8.3.0
with:
repo: jenkins-x-plugins/jx-release-version
version: ${{ inputs.version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-terraform-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
runs:
using: "composite"
steps:
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-github-release-binary@v8.2.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-github-release-binary@v8.3.0
with:
repo: terraform-docs/terraform-docs
version: ${{ inputs.version }}
Expand Down
46 changes: 46 additions & 0 deletions .github/actions/slack-file-upload/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: slack-file-upload
description: Upload file to slack channel
inputs:
slack-token:
description: 'Slack API token'
required: true
slack-channel-id:
description: 'Slack channel ID'
required: true
file-path:
description: 'File to upload'
required: true
file-title:
description: 'Title of file'
python-version:
description: 'Python version'
required: false
default: '3.9'
runs:
using: composite
steps:
- name: Setup Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
id: setup-python
with:
python-version: ${{ inputs.python-version }}

- name: Workaround for hashFiles not working outside current workspace
shell: bash
run: cp ${{ github.action_path }}/requirements.txt requirements-slack.txt

- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-slack.txt') }}

- name: Install requirements via pip
shell: bash
run: ${{ steps.setup-python.outputs.python-path }} -m pip install -r ${{ github.action_path }}/requirements.txt

- name: Upload ${{ inputs.file-path }} to Slack
shell: bash
env:
SLACK_BOT_TOKEN: ${{ inputs.slack-token }}
SLACK_CHANNEL_ID: ${{ inputs.slack-channel-id }}
run: ${{ steps.setup-python.outputs.python-path }} ${{ github.action_path }}/slack_file_upload.py "${{ inputs.file-path }}" "${{ inputs.file-title }}"
1 change: 1 addition & 0 deletions .github/actions/slack-file-upload/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
slack_sdk==3.33.3
33 changes: 33 additions & 0 deletions .github/actions/slack-file-upload/slack_file_upload.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import os
import sys
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError

def upload_file_to_slack(token, channel_id, file_path, title):
client = WebClient(token=token)

try:
response = client.files_upload_v2(
channel=channel_id,
file=file_path,
title=title
)
print(f"File uploaded successfully: {response['file']['id']}")
except SlackApiError as e:
print(f"Error uploading file: {e.response['error']}")
raise e

if __name__ == "__main__":
if 'SLACK_BOT_TOKEN' not in os.environ:
raise ValueError('SLACK_BOT_TOKEN is not set.')
if 'SLACK_CHANNEL_ID' not in os.environ:
raise ValueError('SLACK_CHANNEL_ID is not set.')
if len(sys.argv) < 2:
raise ValueError('File path must be provided as the first argument.')

SLACK_BOT_TOKEN = os.environ['SLACK_BOT_TOKEN']
CHANNEL_ID = os.environ['SLACK_CHANNEL_ID']
FILE_PATH = sys.argv[1]
TITLE = sys.argv[2] if len(sys.argv) > 2 else None

upload_file_to_slack(SLACK_BOT_TOKEN, CHANNEL_ID, FILE_PATH, TITLE)
4 changes: 2 additions & 2 deletions .github/actions/update-pom-to-next-pre-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
- id: next-prerelease-resolver
name: Calculate next internal release
if: inputs.version == ''
uses: Alfresco/alfresco-build-tools/.github/actions/calculate-next-internal-version@v8.2.0
uses: Alfresco/alfresco-build-tools/.github/actions/calculate-next-internal-version@v8.3.0
with:
next-version: ${{ steps.parse-next-final-version.outputs.result }}
prerelease-type: ${{ inputs.prerelease-type }}
Expand All @@ -50,7 +50,7 @@ runs:
fi
- name: Update pom files to the new version
uses: Alfresco/alfresco-build-tools/.github/actions/maven-update-pom-version@v8.2.0
uses: Alfresco/alfresco-build-tools/.github/actions/maven-update-pom-version@v8.3.0
with:
version: ${{ steps.resolve-version.outputs.version }}
maven-cli-opts: ${{ inputs.maven-cli-opts }}
Expand Down
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,14 @@ updates:
catch-all:
patterns:
- "*"
- package-ecosystem: "github-actions"
directory: "/.github/actions/slack-file-upload"
schedule:
interval: "weekly"
groups:
catch-all:
patterns:
- "*"
- package-ecosystem: "github-actions"
directory: "/.github/actions/update-deployment-runtime-versions"
schedule:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-and-release-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.3.0
with:
java-version: ${{ inputs.java-version }}
java-distribution: ${{ inputs.java-distribution }}
Expand Down Expand Up @@ -107,11 +107,11 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.2.0
- uses: Alfresco/alfresco-build-tools/.github/actions/setup-java-build@v8.3.0
with:
java-version: ${{ inputs.java-version }}
java-distribution: ${{ inputs.java-distribution }}
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v8.2.0
- uses: Alfresco/alfresco-build-tools/.github/actions/configure-git-author@v8.3.0
with:
username: ${{ secrets.BOT_GITHUB_USERNAME }}
email: ${{ secrets.BOT_GITHUB_EMAIL }}
Expand Down
Loading

0 comments on commit ee9c989

Please sign in to comment.