diff --git a/.github/workflows/cd-pipeline-harbor.yml b/.github/workflows/cd-pipeline-harbor.yml index 99c01608e985..ce3ba2494845 100644 --- a/.github/workflows/cd-pipeline-harbor.yml +++ b/.github/workflows/cd-pipeline-harbor.yml @@ -78,19 +78,29 @@ jobs: exit 1 else name="$(echo "${{ matrix.container }}" | awk -F '/' '{print $2}')" + branch="$(echo "${{ matrix.container }}" | awk -F '/' '{print $3}')" echo "::set-output name=tag::${tag}" echo "::set-output name=name::${name}" + echo "::set-output name=branch::${branch}" echo "::set-output name=result::ok" fi else # Container folder doesn't exists we are assuming a deprecation echo "::set-output name=result::skip" fi + - id: get-dsl-filepath + name: Get pipeline DSL filepath + run: | + dsl_path="${{ steps.get-container-metadata.outputs.name }}" + if [[ -d ".vib/${dsl_path}/${{ steps.get-container-metadata.outputs.branch }}" ]]; then + dsl_path="${dsl_path}/${{ steps.get-container-metadata.outputs.branch }}" + fi + echo "::set-output name=dsl_path::${dsl_path}" - uses: vmware-labs/vmware-image-builder-action@main name: 'Publish ${{ steps.get-container-metadata.outputs.name }}: ${{ steps.get-container-metadata.outputs.tag }}' if: ${{ steps.get-container-metadata.outputs.result == 'ok' }} with: - pipeline: ${{ steps.get-container-metadata.outputs.name }}/vib-publish.json + pipeline: ${{ steps.get-dsl-filepath.outputs.dsl_path }}/vib-publish.json env: # Path with docker resources VIB_ENV_PATH: ${{ matrix.container }} diff --git a/.github/workflows/cd-pipeline.yml b/.github/workflows/cd-pipeline.yml index e46d15600562..3af56ac816a6 100644 --- a/.github/workflows/cd-pipeline.yml +++ b/.github/workflows/cd-pipeline.yml @@ -78,8 +78,10 @@ jobs: exit 1 else name="$(echo "${{ matrix.container }}" | awk -F '/' '{print $2}')" + branch="$(echo "${{ matrix.container }}" | awk -F '/' '{print $3}')" echo "::set-output name=tag::${tag}" echo "::set-output name=name::${name}" + echo "::set-output name=branch::${branch}" echo "::set-output name=result::ok" fi else @@ -97,11 +99,19 @@ jobs: echo "::add-mask::${marketplace_passwd}" echo "::set-output name=marketplace_user::${marketplace_user}" echo "::set-output name=marketplace_passwd::${marketplace_passwd}" + - id: get-dsl-filepath + name: Get pipeline DSL filepath + run: | + dsl_path="${{ steps.get-container-metadata.outputs.name }}" + if [[ -d ".vib/${dsl_path}/${{ steps.get-container-metadata.outputs.branch }}" ]]; then + dsl_path="${dsl_path}/${{ steps.get-container-metadata.outputs.branch }}" + fi + echo "::set-output name=dsl_path::${dsl_path}" - uses: vmware-labs/vmware-image-builder-action@main name: 'Publish ${{ steps.get-container-metadata.outputs.name }}: ${{ steps.get-container-metadata.outputs.tag }}' if: ${{ steps.get-container-metadata.outputs.result == 'ok' }} with: - pipeline: ${{ steps.get-container-metadata.outputs.name }}/vib-publish.json + pipeline: ${{ steps.get-dsl-filepath.outputs.dsl_path }}/vib-publish.json env: # Path with docker resources VIB_ENV_PATH: ${{ matrix.container }} diff --git a/.vib/envoy/1.20/vib-publish.json b/.vib/envoy/1.20/vib-publish.json new file mode 100644 index 000000000000..53f309a18873 --- /dev/null +++ b/.vib/envoy/1.20/vib-publish.json @@ -0,0 +1,77 @@ +{ + "context": { + "resources": { + "url": "{SHA_ARCHIVE}", + "path": "{VIB_ENV_PATH}" + } + }, + "phases": { + "package": { + "actions": [ + { + "action_id": "container-image-package", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "architectures": [ + "linux/amd64" + ] + } + }, + { + "action_id": "container-image-lint", + "params": { + "threshold": "error" + } + } + ] + }, + "verify": { + "actions": [ + { + "action_id": "trivy", + "params": { + "threshold": "CRITICAL", + "vuln_type": [ + "OS" + ] + } + }, + { + "action_id": "grype", + "params": { + "threshold": "CRITICAL", + "package_type": [ + "OS" + ] + } + } + ] + }, + "publish": { + "actions": [ + { + "action_id": "container-image-publish", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "repository": { + "kind": "OCI", + "url": "{VIB_ENV_REGISTRY_URL}", + "username": "{VIB_ENV_REGISTRY_USERNAME}", + "password": "{VIB_ENV_REGISTRY_PASSWORD}" + } + } + } + ] + } + } +} diff --git a/.vib/envoy/vib-publish.json b/.vib/envoy/vib-publish.json index 53f309a18873..3e33e899dc6a 100644 --- a/.vib/envoy/vib-publish.json +++ b/.vib/envoy/vib-publish.json @@ -18,7 +18,8 @@ } }, "architectures": [ - "linux/amd64" + "linux/amd64", + "linux/arm64" ] } }, diff --git a/.vib/mariadb-galera/10.3/vib-publish.json b/.vib/mariadb-galera/10.3/vib-publish.json new file mode 100644 index 000000000000..53f309a18873 --- /dev/null +++ b/.vib/mariadb-galera/10.3/vib-publish.json @@ -0,0 +1,77 @@ +{ + "context": { + "resources": { + "url": "{SHA_ARCHIVE}", + "path": "{VIB_ENV_PATH}" + } + }, + "phases": { + "package": { + "actions": [ + { + "action_id": "container-image-package", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "architectures": [ + "linux/amd64" + ] + } + }, + { + "action_id": "container-image-lint", + "params": { + "threshold": "error" + } + } + ] + }, + "verify": { + "actions": [ + { + "action_id": "trivy", + "params": { + "threshold": "CRITICAL", + "vuln_type": [ + "OS" + ] + } + }, + { + "action_id": "grype", + "params": { + "threshold": "CRITICAL", + "package_type": [ + "OS" + ] + } + } + ] + }, + "publish": { + "actions": [ + { + "action_id": "container-image-publish", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "repository": { + "kind": "OCI", + "url": "{VIB_ENV_REGISTRY_URL}", + "username": "{VIB_ENV_REGISTRY_USERNAME}", + "password": "{VIB_ENV_REGISTRY_PASSWORD}" + } + } + } + ] + } + } +} diff --git a/.vib/mariadb-galera/10.4/vib-publish.json b/.vib/mariadb-galera/10.4/vib-publish.json new file mode 100644 index 000000000000..53f309a18873 --- /dev/null +++ b/.vib/mariadb-galera/10.4/vib-publish.json @@ -0,0 +1,77 @@ +{ + "context": { + "resources": { + "url": "{SHA_ARCHIVE}", + "path": "{VIB_ENV_PATH}" + } + }, + "phases": { + "package": { + "actions": [ + { + "action_id": "container-image-package", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "architectures": [ + "linux/amd64" + ] + } + }, + { + "action_id": "container-image-lint", + "params": { + "threshold": "error" + } + } + ] + }, + "verify": { + "actions": [ + { + "action_id": "trivy", + "params": { + "threshold": "CRITICAL", + "vuln_type": [ + "OS" + ] + } + }, + { + "action_id": "grype", + "params": { + "threshold": "CRITICAL", + "package_type": [ + "OS" + ] + } + } + ] + }, + "publish": { + "actions": [ + { + "action_id": "container-image-publish", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "repository": { + "kind": "OCI", + "url": "{VIB_ENV_REGISTRY_URL}", + "username": "{VIB_ENV_REGISTRY_USERNAME}", + "password": "{VIB_ENV_REGISTRY_PASSWORD}" + } + } + } + ] + } + } +} diff --git a/.vib/mariadb-galera/vib-publish.json b/.vib/mariadb-galera/vib-publish.json index 53f309a18873..3e33e899dc6a 100644 --- a/.vib/mariadb-galera/vib-publish.json +++ b/.vib/mariadb-galera/vib-publish.json @@ -18,7 +18,8 @@ } }, "architectures": [ - "linux/amd64" + "linux/amd64", + "linux/arm64" ] } }, diff --git a/.vib/mariadb/10.3/vib-publish.json b/.vib/mariadb/10.3/vib-publish.json new file mode 100644 index 000000000000..53f309a18873 --- /dev/null +++ b/.vib/mariadb/10.3/vib-publish.json @@ -0,0 +1,77 @@ +{ + "context": { + "resources": { + "url": "{SHA_ARCHIVE}", + "path": "{VIB_ENV_PATH}" + } + }, + "phases": { + "package": { + "actions": [ + { + "action_id": "container-image-package", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "architectures": [ + "linux/amd64" + ] + } + }, + { + "action_id": "container-image-lint", + "params": { + "threshold": "error" + } + } + ] + }, + "verify": { + "actions": [ + { + "action_id": "trivy", + "params": { + "threshold": "CRITICAL", + "vuln_type": [ + "OS" + ] + } + }, + { + "action_id": "grype", + "params": { + "threshold": "CRITICAL", + "package_type": [ + "OS" + ] + } + } + ] + }, + "publish": { + "actions": [ + { + "action_id": "container-image-publish", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "repository": { + "kind": "OCI", + "url": "{VIB_ENV_REGISTRY_URL}", + "username": "{VIB_ENV_REGISTRY_USERNAME}", + "password": "{VIB_ENV_REGISTRY_PASSWORD}" + } + } + } + ] + } + } +} diff --git a/.vib/mariadb/10.4/vib-publish.json b/.vib/mariadb/10.4/vib-publish.json new file mode 100644 index 000000000000..53f309a18873 --- /dev/null +++ b/.vib/mariadb/10.4/vib-publish.json @@ -0,0 +1,77 @@ +{ + "context": { + "resources": { + "url": "{SHA_ARCHIVE}", + "path": "{VIB_ENV_PATH}" + } + }, + "phases": { + "package": { + "actions": [ + { + "action_id": "container-image-package", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "architectures": [ + "linux/amd64" + ] + } + }, + { + "action_id": "container-image-lint", + "params": { + "threshold": "error" + } + } + ] + }, + "verify": { + "actions": [ + { + "action_id": "trivy", + "params": { + "threshold": "CRITICAL", + "vuln_type": [ + "OS" + ] + } + }, + { + "action_id": "grype", + "params": { + "threshold": "CRITICAL", + "package_type": [ + "OS" + ] + } + } + ] + }, + "publish": { + "actions": [ + { + "action_id": "container-image-publish", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "repository": { + "kind": "OCI", + "url": "{VIB_ENV_REGISTRY_URL}", + "username": "{VIB_ENV_REGISTRY_USERNAME}", + "password": "{VIB_ENV_REGISTRY_PASSWORD}" + } + } + } + ] + } + } +} diff --git a/.vib/mariadb/vib-publish.json b/.vib/mariadb/vib-publish.json index 53f309a18873..3e33e899dc6a 100644 --- a/.vib/mariadb/vib-publish.json +++ b/.vib/mariadb/vib-publish.json @@ -18,7 +18,8 @@ } }, "architectures": [ - "linux/amd64" + "linux/amd64", + "linux/arm64" ] } }, diff --git a/.vib/odoo/13/vib-publish.json b/.vib/odoo/13/vib-publish.json new file mode 100644 index 000000000000..53f309a18873 --- /dev/null +++ b/.vib/odoo/13/vib-publish.json @@ -0,0 +1,77 @@ +{ + "context": { + "resources": { + "url": "{SHA_ARCHIVE}", + "path": "{VIB_ENV_PATH}" + } + }, + "phases": { + "package": { + "actions": [ + { + "action_id": "container-image-package", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "architectures": [ + "linux/amd64" + ] + } + }, + { + "action_id": "container-image-lint", + "params": { + "threshold": "error" + } + } + ] + }, + "verify": { + "actions": [ + { + "action_id": "trivy", + "params": { + "threshold": "CRITICAL", + "vuln_type": [ + "OS" + ] + } + }, + { + "action_id": "grype", + "params": { + "threshold": "CRITICAL", + "package_type": [ + "OS" + ] + } + } + ] + }, + "publish": { + "actions": [ + { + "action_id": "container-image-publish", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "repository": { + "kind": "OCI", + "url": "{VIB_ENV_REGISTRY_URL}", + "username": "{VIB_ENV_REGISTRY_USERNAME}", + "password": "{VIB_ENV_REGISTRY_PASSWORD}" + } + } + } + ] + } + } +} diff --git a/.vib/odoo/14/vib-publish.json b/.vib/odoo/14/vib-publish.json new file mode 100644 index 000000000000..53f309a18873 --- /dev/null +++ b/.vib/odoo/14/vib-publish.json @@ -0,0 +1,77 @@ +{ + "context": { + "resources": { + "url": "{SHA_ARCHIVE}", + "path": "{VIB_ENV_PATH}" + } + }, + "phases": { + "package": { + "actions": [ + { + "action_id": "container-image-package", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "architectures": [ + "linux/amd64" + ] + } + }, + { + "action_id": "container-image-lint", + "params": { + "threshold": "error" + } + } + ] + }, + "verify": { + "actions": [ + { + "action_id": "trivy", + "params": { + "threshold": "CRITICAL", + "vuln_type": [ + "OS" + ] + } + }, + { + "action_id": "grype", + "params": { + "threshold": "CRITICAL", + "package_type": [ + "OS" + ] + } + } + ] + }, + "publish": { + "actions": [ + { + "action_id": "container-image-publish", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "repository": { + "kind": "OCI", + "url": "{VIB_ENV_REGISTRY_URL}", + "username": "{VIB_ENV_REGISTRY_USERNAME}", + "password": "{VIB_ENV_REGISTRY_PASSWORD}" + } + } + } + ] + } + } +} diff --git a/.vib/odoo/vib-publish.json b/.vib/odoo/vib-publish.json index 53f309a18873..3e33e899dc6a 100644 --- a/.vib/odoo/vib-publish.json +++ b/.vib/odoo/vib-publish.json @@ -18,7 +18,8 @@ } }, "architectures": [ - "linux/amd64" + "linux/amd64", + "linux/arm64" ] } }, diff --git a/.vib/parse/4/vib-publish.json b/.vib/parse/4/vib-publish.json new file mode 100644 index 000000000000..53f309a18873 --- /dev/null +++ b/.vib/parse/4/vib-publish.json @@ -0,0 +1,77 @@ +{ + "context": { + "resources": { + "url": "{SHA_ARCHIVE}", + "path": "{VIB_ENV_PATH}" + } + }, + "phases": { + "package": { + "actions": [ + { + "action_id": "container-image-package", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "architectures": [ + "linux/amd64" + ] + } + }, + { + "action_id": "container-image-lint", + "params": { + "threshold": "error" + } + } + ] + }, + "verify": { + "actions": [ + { + "action_id": "trivy", + "params": { + "threshold": "CRITICAL", + "vuln_type": [ + "OS" + ] + } + }, + { + "action_id": "grype", + "params": { + "threshold": "CRITICAL", + "package_type": [ + "OS" + ] + } + } + ] + }, + "publish": { + "actions": [ + { + "action_id": "container-image-publish", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "repository": { + "kind": "OCI", + "url": "{VIB_ENV_REGISTRY_URL}", + "username": "{VIB_ENV_REGISTRY_USERNAME}", + "password": "{VIB_ENV_REGISTRY_PASSWORD}" + } + } + } + ] + } + } +} diff --git a/.vib/parse/vib-publish.json b/.vib/parse/vib-publish.json index 53f309a18873..3e33e899dc6a 100644 --- a/.vib/parse/vib-publish.json +++ b/.vib/parse/vib-publish.json @@ -18,7 +18,8 @@ } }, "architectures": [ - "linux/amd64" + "linux/amd64", + "linux/arm64" ] } },