Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/docker-images/bin-images/fedora/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ RUN mkdir -p /root/aws-iot-securetunneling-localproxy/build \

FROM fedora:latest AS minimum_size

# OS-specific commands - install packages first so OSS compliance can enumerate them
RUN dnf -y update && dnf -y install \
libatomic libicu ca-certificates && \
update-ca-trust extract

COPY --from=deploy /root/aws-iot-securetunneling-localproxy/build/bin/localproxy /root/bin/localproxy

COPY ./.github/docker-images/oss-compliance /root/oss-compliance
Expand All @@ -23,9 +28,4 @@ RUN HOME_DIR=/root \
&& bash ${HOME_DIR}/oss-compliance/generate-oss-compliance.sh ${HOME_DIR} \
&& rm -rf ${HOME_DIR}/oss-compliance*

# OS-specific commands
RUN dnf -y update; dnf -y install && \
libatomic libicu ca-certificates && \
update-ca-trust extract

ENTRYPOINT ["/root/bin/localproxy"]
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ set -e

chmod +x ${LINUX_PACKAGES}/yum-packages.sh
chmod +x ${LINUX_PACKAGES}/dpkg-packages.sh
chmod +x ${LINUX_PACKAGES}/dnf-packages.sh

if [[ $PRETTY_NAME == *"Ubuntu"* || $PRETTY_NAME == *"Debian"* ]]; then
${LINUX_PACKAGES}/dpkg-packages.sh
fi

if [[ $PRETTY_NAME == *"Amazon Linux"* || $PRETTY_NAME == *"Red Hat Enterprise Linux"* || $PRETTY_NAME == *"Fedora"* ]]; then
if [[ $PRETTY_NAME == *"Amazon Linux"* || $PRETTY_NAME == *"Red Hat Enterprise Linux"* ]]; then
${LINUX_PACKAGES}/yum-packages.sh
fi

if [[ $PRETTY_NAME == *"Fedora"* ]]; then
${LINUX_PACKAGES}/dnf-packages.sh
fi

cp ${BUILD_FROM_SOURCE_PACKAGES_LICENCES} /root/BUILD_FROM_SOURCE_PACKAGES_LICENCES
chmod +x ${HOME_DIR}/test/test-oss-compliance.sh
bash ${HOME_DIR}/test/test-oss-compliance.sh ${HOME_DIR}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

LICENSE_FILE_NAMES=("LICENSE" "LICENSE.txt" "LICENSE.md" "license.txt" "license" "COPYRIGHT" "LICENSE.rst" "COPYING" "COPYING.md" "COPYING.txt")

LICENSE_FILE_LOCATIONS=("/usr/share/licenses" "/usr/share/doc")

HOME_DIR=/root
LICENSE_TEXT_FILE_NAME="LINUX_PACKAGES_LICENSES"
LICENSE_TEXT_FILE_PATH=${HOME_DIR}/${LICENSE_TEXT_FILE_NAME}
PACKAGE_LIST_TEXT_FILE_NAME="LINUX_PACKAGES_LIST"

OUTPUT="$(dnf list installed 2>/dev/null | tail -n +2 | sort)"
echo "${OUTPUT}" > ${HOME_DIR}/${PACKAGE_LIST_TEXT_FILE_NAME}

IFS=$'\n' read -rd '' -a OUTPUT_LIST <<<"${OUTPUT}"

for (( i=0; i<${#OUTPUT_LIST[@]}; i++ ))
do
IFS=$' ' read -rd '' -a PACKAGE_DETAILS <<<${OUTPUT_LIST[$i]}
if [ ${#PACKAGE_DETAILS[@]} -ge "2" ]; then
IFS=$'.' read -rd '' -a PACKAGE_NAME_AND_ARCH <<<${PACKAGE_DETAILS[0]}
PACKAGE_NAME=${PACKAGE_NAME_AND_ARCH[0]}
IFS=$'-:' read -rd '' -a PACKAGE_VERSION_ARR <<<${PACKAGE_DETAILS[1]}
if [ ${#PACKAGE_VERSION[@]} -ge "2" ]; then
PACKAGE_VERSION="${PACKAGE_VERSION_ARR[1]}"
else
PACKAGE_VERSION="${PACKAGE_VERSION_ARR[0]}"
fi
PACKAGE_LICENSE_LOCATION=""
for (( license_file_dir=0; license_file_dir<"${#LICENSE_FILE_LOCATIONS[@]}"; license_file_dir++ ))
do
for (( license_file=0; license_file<"${#LICENSE_FILE_NAMES[@]}"; license_file++ ))
do
if [[ -f "${LICENSE_FILE_LOCATIONS[$license_file_dir]}/${PACKAGE_NAME}-${PACKAGE_VERSION}/${LICENSE_FILE_NAMES[$license_file]}" ]]; then
PACKAGE_LICENSE_LOCATION=${LICENSE_FILE_LOCATIONS[$license_file_dir]}/${PACKAGE_NAME}-${PACKAGE_VERSION}/${LICENSE_FILE_NAMES[$license_file]}
break
elif [[ -f "${LICENSE_FILE_LOCATIONS[$license_file_dir]}/${PACKAGE_NAME}/${LICENSE_FILE_NAMES[$license_file]}" ]]; then
PACKAGE_LICENSE_LOCATION=${LICENSE_FILE_LOCATIONS[$license_file_dir]}/${PACKAGE_NAME}/${LICENSE_FILE_NAMES[$license_file]}
break
fi
done
done
if [ "${PACKAGE_LICENSE_LOCATION}" ] && [ -f "${PACKAGE_LICENSE_LOCATION}" ]; then
LICENSE_TEXT=$(cat "${PACKAGE_LICENSE_LOCATION}") || true
else
LICENSE_TEXT="License is not present for this package."
fi
echo "Package Name: "${PACKAGE_NAME} >> ${LICENSE_TEXT_FILE_PATH}
echo "Package Version: "${PACKAGE_VERSION} >> ${LICENSE_TEXT_FILE_PATH}
echo "Package License Location: "${PACKAGE_LICENSE_LOCATION} >> ${LICENSE_TEXT_FILE_PATH}
echo -e "Package License Text: "${LICENSE_TEXT}"\n" >> ${LICENSE_TEXT_FILE_PATH}
fi
done
22 changes: 18 additions & 4 deletions .github/workflows/build-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ jobs:
with:
platforms: arm

- name: Cache ARM32 dependencies
- name: Restore ARM32 dependencies cache
id: cache-arm32
uses: actions/cache@v5
uses: actions/cache/restore@v5
with:
path: arm32-deps
key: arm32-deps-boost${{ env.BOOST_VERSION }}-protobuf${{ env.PROTOBUF_VERSION }}-catch2${{ env.CATCH2_VERSION }}-v1
Expand Down Expand Up @@ -146,6 +146,13 @@ jobs:
cmake ../ -DCMAKE_INSTALL_PREFIX=/deps && make -j$(nproc) && make install
'

- name: Save ARM32 dependencies cache
if: steps.cache-arm32.outputs.cache-hit != 'true'
uses: actions/cache/save@v5
with:
path: arm32-deps
key: arm32-deps-boost${{ env.BOOST_VERSION }}-protobuf${{ env.PROTOBUF_VERSION }}-catch2${{ env.CATCH2_VERSION }}-v1

- name: Build in ARM32 container
run: |
docker run --rm --platform linux/arm/v7 \
Expand Down Expand Up @@ -283,9 +290,9 @@ jobs:
with:
arch: x64

- name: Cache Windows dependencies
- name: Restore Windows dependencies cache
id: cache-windows-deps
uses: actions/cache@v5
uses: actions/cache/restore@v5
with:
path: ${{ env.DEPS_DIR }}
key: windows-deps-openssl${{ env.OPENSSL_VERSION }}-boost${{ env.BOOST_VERSION }}-protobuf${{ env.PROTOBUF_VERSION }}-zlib${{ env.ZLIB_VERSION }}-catch2${{ env.CATCH2_VERSION }}-v1
Expand Down Expand Up @@ -348,6 +355,13 @@ jobs:
nmake
nmake install

- name: Save Windows dependencies cache
if: steps.cache-windows-deps.outputs.cache-hit != 'true'
uses: actions/cache/save@v5
with:
path: ${{ env.DEPS_DIR }}
key: windows-deps-openssl${{ env.OPENSSL_VERSION }}-boost${{ env.BOOST_VERSION }}-protobuf${{ env.PROTOBUF_VERSION }}-zlib${{ env.ZLIB_VERSION }}-catch2${{ env.CATCH2_VERSION }}-v1

- name: Build
run: |
mkdir build
Expand Down
Loading