diff --git a/.github/workflows/api-build-and-push-ghcr.yml b/.github/workflows/api-build-and-push-ghcr.yml index 5a3ab5eee..dacbb7a4f 100644 --- a/.github/workflows/api-build-and-push-ghcr.yml +++ b/.github/workflows/api-build-and-push-ghcr.yml @@ -39,11 +39,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -66,6 +81,10 @@ jobs: with: context: . file: ./Dockerfiles/api.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/api:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/arkime-build-and-push-ghcr.yml b/.github/workflows/arkime-build-and-push-ghcr.yml index 51e258b03..c847c9995 100644 --- a/.github/workflows/arkime-build-and-push-ghcr.yml +++ b/.github/workflows/arkime-build-and-push-ghcr.yml @@ -39,11 +39,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -67,6 +82,9 @@ jobs: context: . file: ./Dockerfiles/arkime.Dockerfile build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} MAXMIND_GEOIP_DB_LICENSE_KEY=${{ secrets.MAXMIND_GEOIP_DB_LICENSE_KEY }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/arkime:${{ steps.extract_branch.outputs.branch }} diff --git a/.github/workflows/dashboards-build-and-push-ghcr.yml b/.github/workflows/dashboards-build-and-push-ghcr.yml index 5f4e729ee..ada149096 100644 --- a/.github/workflows/dashboards-build-and-push-ghcr.yml +++ b/.github/workflows/dashboards-build-and-push-ghcr.yml @@ -39,11 +39,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -66,6 +81,10 @@ jobs: with: context: . file: ./Dockerfiles/dashboards.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/dashboards:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/dashboards-helper-build-and-push-ghcr.yml b/.github/workflows/dashboards-helper-build-and-push-ghcr.yml index 2a4fb6a47..1ec639dcb 100644 --- a/.github/workflows/dashboards-helper-build-and-push-ghcr.yml +++ b/.github/workflows/dashboards-helper-build-and-push-ghcr.yml @@ -39,11 +39,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -66,6 +81,10 @@ jobs: with: context: . file: ./Dockerfiles/dashboards-helper.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/dashboards-helper:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/dirinit-build-and-push-ghcr.yml b/.github/workflows/dirinit-build-and-push-ghcr.yml index c57ed918a..db9b8bdd3 100644 --- a/.github/workflows/dirinit-build-and-push-ghcr.yml +++ b/.github/workflows/dirinit-build-and-push-ghcr.yml @@ -31,11 +31,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -58,6 +73,10 @@ jobs: with: context: . file: ./Dockerfiles/dirinit.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/dirinit:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/file-monitor-build-and-push-ghcr.yml b/.github/workflows/file-monitor-build-and-push-ghcr.yml index c74860015..10c6885da 100644 --- a/.github/workflows/file-monitor-build-and-push-ghcr.yml +++ b/.github/workflows/file-monitor-build-and-push-ghcr.yml @@ -39,11 +39,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -66,6 +81,10 @@ jobs: with: context: . file: ./Dockerfiles/file-monitor.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/file-monitor:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/file-upload-build-and-push-ghcr.yml b/.github/workflows/file-upload-build-and-push-ghcr.yml index eb42c5ee1..6228bfa20 100644 --- a/.github/workflows/file-upload-build-and-push-ghcr.yml +++ b/.github/workflows/file-upload-build-and-push-ghcr.yml @@ -39,11 +39,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -66,6 +81,10 @@ jobs: with: context: . file: ./Dockerfiles/file-upload.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/file-upload:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/filebeat-build-and-push-ghcr.yml b/.github/workflows/filebeat-build-and-push-ghcr.yml index c56c1c6a8..5d67fd099 100644 --- a/.github/workflows/filebeat-build-and-push-ghcr.yml +++ b/.github/workflows/filebeat-build-and-push-ghcr.yml @@ -39,11 +39,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -66,6 +81,10 @@ jobs: with: context: . file: ./Dockerfiles/filebeat.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/filebeat-oss:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/freq-build-and-push-ghcr.yml b/.github/workflows/freq-build-and-push-ghcr.yml index b8e589f19..a6411ca25 100644 --- a/.github/workflows/freq-build-and-push-ghcr.yml +++ b/.github/workflows/freq-build-and-push-ghcr.yml @@ -39,11 +39,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -66,6 +81,10 @@ jobs: with: context: . file: ./Dockerfiles/freq.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/freq:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/htadmin-build-and-push-ghcr.yml b/.github/workflows/htadmin-build-and-push-ghcr.yml index 04ac783ce..954d245aa 100644 --- a/.github/workflows/htadmin-build-and-push-ghcr.yml +++ b/.github/workflows/htadmin-build-and-push-ghcr.yml @@ -39,11 +39,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -66,6 +81,10 @@ jobs: with: context: . file: ./Dockerfiles/htadmin.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/htadmin:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/logstash-build-and-push-ghcr.yml b/.github/workflows/logstash-build-and-push-ghcr.yml index f358e2226..19ae8e43e 100644 --- a/.github/workflows/logstash-build-and-push-ghcr.yml +++ b/.github/workflows/logstash-build-and-push-ghcr.yml @@ -39,11 +39,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -66,6 +81,10 @@ jobs: with: context: . file: ./Dockerfiles/logstash.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/logstash-oss:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/netbox-build-and-push-ghcr.yml b/.github/workflows/netbox-build-and-push-ghcr.yml index 65cc11a71..c59567995 100644 --- a/.github/workflows/netbox-build-and-push-ghcr.yml +++ b/.github/workflows/netbox-build-and-push-ghcr.yml @@ -39,11 +39,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -66,6 +81,10 @@ jobs: with: context: . file: ./Dockerfiles/netbox.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/netbox:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/nginx-build-and-push-ghcr.yml b/.github/workflows/nginx-build-and-push-ghcr.yml index 7ef3e9a7f..06f028768 100644 --- a/.github/workflows/nginx-build-and-push-ghcr.yml +++ b/.github/workflows/nginx-build-and-push-ghcr.yml @@ -46,6 +46,11 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash @@ -56,6 +61,11 @@ jobs: shell: bash run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -79,6 +89,8 @@ jobs: context: . file: ./Dockerfiles/nginx.Dockerfile build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} push: true diff --git a/.github/workflows/opensearch-build-and-push-ghcr.yml b/.github/workflows/opensearch-build-and-push-ghcr.yml index 225b89a2d..8a0083bad 100644 --- a/.github/workflows/opensearch-build-and-push-ghcr.yml +++ b/.github/workflows/opensearch-build-and-push-ghcr.yml @@ -38,11 +38,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -65,6 +80,10 @@ jobs: with: context: . file: ./Dockerfiles/opensearch.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/opensearch:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/pcap-capture-build-and-push-ghcr.yml b/.github/workflows/pcap-capture-build-and-push-ghcr.yml index e8de170c4..332d0b560 100644 --- a/.github/workflows/pcap-capture-build-and-push-ghcr.yml +++ b/.github/workflows/pcap-capture-build-and-push-ghcr.yml @@ -39,11 +39,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -66,6 +81,10 @@ jobs: with: context: . file: ./Dockerfiles/pcap-capture.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/pcap-capture:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/pcap-monitor-build-and-push-ghcr.yml b/.github/workflows/pcap-monitor-build-and-push-ghcr.yml index ca5138e18..385ec4fec 100644 --- a/.github/workflows/pcap-monitor-build-and-push-ghcr.yml +++ b/.github/workflows/pcap-monitor-build-and-push-ghcr.yml @@ -39,11 +39,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -66,6 +81,10 @@ jobs: with: context: . file: ./Dockerfiles/pcap-monitor.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/pcap-monitor:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/postgresql-build-and-push-ghcr.yml b/.github/workflows/postgresql-build-and-push-ghcr.yml index 29aefda44..c90fd8b64 100644 --- a/.github/workflows/postgresql-build-and-push-ghcr.yml +++ b/.github/workflows/postgresql-build-and-push-ghcr.yml @@ -38,11 +38,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -65,6 +80,10 @@ jobs: with: context: . file: ./Dockerfiles/postgresql.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/postgresql:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/redis-build-and-push-ghcr.yml b/.github/workflows/redis-build-and-push-ghcr.yml index a04d0369b..921e11c91 100644 --- a/.github/workflows/redis-build-and-push-ghcr.yml +++ b/.github/workflows/redis-build-and-push-ghcr.yml @@ -38,11 +38,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -65,6 +80,10 @@ jobs: with: context: . file: ./Dockerfiles/redis.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/redis:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/suricata-build-and-push-ghcr.yml b/.github/workflows/suricata-build-and-push-ghcr.yml index bd07b7006..2d9da5d1e 100644 --- a/.github/workflows/suricata-build-and-push-ghcr.yml +++ b/.github/workflows/suricata-build-and-push-ghcr.yml @@ -39,11 +39,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -66,6 +81,10 @@ jobs: with: context: . file: ./Dockerfiles/suricata.Dockerfile + build-args: | + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} push: true tags: ghcr.io/${{ github.repository_owner }}/malcolm/suricata:${{ steps.extract_branch.outputs.branch }} - diff --git a/.github/workflows/zeek-build-and-push-ghcr.yml b/.github/workflows/zeek-build-and-push-ghcr.yml index 4cb14636c..27f6e05db 100644 --- a/.github/workflows/zeek-build-and-push-ghcr.yml +++ b/.github/workflows/zeek-build-and-push-ghcr.yml @@ -38,11 +38,26 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - + name: Generate build timestamp + shell: bash + run: echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + id: generate_build_timestamp - name: Extract branch name shell: bash run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: extract_branch + - + name: Extract commit SHA + shell: bash + run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + id: extract_commit_sha + - + name: Extract Malcolm version + shell: bash + run: echo "mversion=$(grep -P "^\s+image:.*/malcolm/" docker-compose.yml | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT + id: extract_malcolm_version - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -65,10 +80,13 @@ jobs: with: context: . file: ./Dockerfiles/zeek.Dockerfile - push: true - tags: ghcr.io/${{ github.repository_owner }}/malcolm/zeek:${{ steps.extract_branch.outputs.branch }} build-args: | BUILD_JOBS=2 + MALCOLM_VERSION=${{ steps.extract_malcolm_version.outputs.mversion }} + BUILD_DATE=${{ steps.generate_build_timestamp.outputs.btimestamp }} + VCS_REVISION=${{ steps.extract_commit_sha.outputs.sha }} + push: true + tags: ghcr.io/${{ github.repository_owner }}/malcolm/zeek:${{ steps.extract_branch.outputs.branch }} - name: Run Trivy vulnerability scanner id: trivy-scan diff --git a/scripts/build.sh b/scripts/build.sh index c5330f14b..526ab83c3 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -77,7 +77,7 @@ read -p "Malcolm Docker images will now be built and/or pulled, force full clean CONFIRMATION=${CONFIRMATION:-N} BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -MALCOLM_VERSION="$($GREP -P "^\s+image:\s*.*/malcolm/" "$CONFIG_FILE" | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" +MALCOLM_VERSION="$($GREP -P "^\s+image:.*/malcolm/" "$CONFIG_FILE" | awk '{print $2}' | cut -d':' -f2 | uniq -c | sort -nr | awk '{print $2}' | head -n 1)" VCS_REVISION="$(git rev-parse --short HEAD 2>/dev/null || echo unknown)" GITHUB_API_TOKEN="${GITHUB_TOKEN:-}"