diff --git a/.github/workflow_templates/deploy-channel.multi.yml b/.github/workflow_templates/deploy-channel.multi.yml index 4b52e44db2..ccfbc1f898 100644 --- a/.github/workflow_templates/deploy-channel.multi.yml +++ b/.github/workflow_templates/deploy-channel.multi.yml @@ -199,41 +199,6 @@ Jobs for visual control allowed editions when approving deploy to environments. docker image push ${SOURCE_RELEASE_VERSION_IMAGE} {!{- end }!} - {!{ range $werfEnv := slice "CE" "EE" "FE" "BE" "SE" }!} - - name: Set release date label for release ({!{ $werfEnv }!}) - if: ${{ needs.detect_editions.outputs.DEPLOY_{!{ $werfEnv }!} == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: {!{ $werfEnv }!} - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - {!{- end }!} - {!{/* Add 'publish' step for each edition to repuplish semver tag images to channel tag: - Pull deckhouse images from dev registry. @@ -284,6 +249,8 @@ is used if DECKHOUSE_REGISTRY_HOST is not set. if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." diff --git a/.github/workflows/deploy-alpha.yml b/.github/workflows/deploy-alpha.yml index 37ad78d35c..0ffbb8bef1 100644 --- a/.github/workflows/deploy-alpha.yml +++ b/.github/workflows/deploy-alpha.yml @@ -465,168 +465,6 @@ jobs: docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - - name: Set release date label for release (CE) - if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: CE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (EE) - if: ${{ needs.detect_editions.outputs.DEPLOY_EE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: EE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (FE) - if: ${{ needs.detect_editions.outputs.DEPLOY_FE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: FE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (BE) - if: ${{ needs.detect_editions.outputs.DEPLOY_BE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: BE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (SE) - if: ${{ needs.detect_editions.outputs.DEPLOY_SE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: SE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - - name: Publish release images for CE if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} @@ -660,6 +498,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -791,6 +631,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -922,6 +764,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -1053,6 +897,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -1184,6 +1030,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." diff --git a/.github/workflows/deploy-beta.yml b/.github/workflows/deploy-beta.yml index 1896bcb93d..6ff7c9c883 100644 --- a/.github/workflows/deploy-beta.yml +++ b/.github/workflows/deploy-beta.yml @@ -465,168 +465,6 @@ jobs: docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - - name: Set release date label for release (CE) - if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: CE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (EE) - if: ${{ needs.detect_editions.outputs.DEPLOY_EE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: EE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (FE) - if: ${{ needs.detect_editions.outputs.DEPLOY_FE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: FE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (BE) - if: ${{ needs.detect_editions.outputs.DEPLOY_BE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: BE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (SE) - if: ${{ needs.detect_editions.outputs.DEPLOY_SE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: SE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - - name: Publish release images for CE if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} @@ -660,6 +498,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -791,6 +631,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -922,6 +764,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -1053,6 +897,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -1184,6 +1030,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." diff --git a/.github/workflows/deploy-early-access.yml b/.github/workflows/deploy-early-access.yml index 181048e26d..4f97b0fe88 100644 --- a/.github/workflows/deploy-early-access.yml +++ b/.github/workflows/deploy-early-access.yml @@ -465,168 +465,6 @@ jobs: docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - - name: Set release date label for release (CE) - if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: CE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (EE) - if: ${{ needs.detect_editions.outputs.DEPLOY_EE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: EE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (FE) - if: ${{ needs.detect_editions.outputs.DEPLOY_FE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: FE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (BE) - if: ${{ needs.detect_editions.outputs.DEPLOY_BE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: BE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (SE) - if: ${{ needs.detect_editions.outputs.DEPLOY_SE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: SE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - - name: Publish release images for CE if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} @@ -660,6 +498,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -791,6 +631,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -922,6 +764,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -1053,6 +897,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -1184,6 +1030,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." diff --git a/.github/workflows/deploy-rock-solid.yml b/.github/workflows/deploy-rock-solid.yml index 006d461df9..96a7223c2e 100644 --- a/.github/workflows/deploy-rock-solid.yml +++ b/.github/workflows/deploy-rock-solid.yml @@ -465,168 +465,6 @@ jobs: docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - - name: Set release date label for release (CE) - if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: CE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (EE) - if: ${{ needs.detect_editions.outputs.DEPLOY_EE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: EE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (FE) - if: ${{ needs.detect_editions.outputs.DEPLOY_FE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: FE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (BE) - if: ${{ needs.detect_editions.outputs.DEPLOY_BE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: BE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (SE) - if: ${{ needs.detect_editions.outputs.DEPLOY_SE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: SE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - - name: Publish release images for CE if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} @@ -660,6 +498,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -791,6 +631,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -922,6 +764,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -1053,6 +897,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -1184,6 +1030,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." diff --git a/.github/workflows/deploy-stable.yml b/.github/workflows/deploy-stable.yml index f077f12945..c6db60bd7b 100644 --- a/.github/workflows/deploy-stable.yml +++ b/.github/workflows/deploy-stable.yml @@ -465,168 +465,6 @@ jobs: docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - - name: Set release date label for release (CE) - if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: CE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (EE) - if: ${{ needs.detect_editions.outputs.DEPLOY_EE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: EE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (FE) - if: ${{ needs.detect_editions.outputs.DEPLOY_FE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: FE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (BE) - if: ${{ needs.detect_editions.outputs.DEPLOY_BE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: BE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - name: Set release date label for release (SE) - if: ${{ needs.detect_editions.outputs.DEPLOY_SE == 'true' }} - env: - DECKHOUSE_REGISTRY_HOST: ${{secrets.DECKHOUSE_REGISTRY_HOST}} - CI_COMMIT_TAG: ${{needs.git_info.outputs.ci_commit_tag}} - WERF_ENV: SE - run: | - PROD_REGISTRY_PATH="${DECKHOUSE_REGISTRY_HOST}/deckhouse" - if [[ -z "${DECKHOUSE_REGISTRY_HOST}" ]]; then - PROD_REGISTRY_PATH="${GHA_TEST_REGISTRY_PATH}" - echo "โš“๏ธ ๐Ÿงช [$(date -u)] DECKHOUSE_REGISTRY_HOST is empty. Publish using Github Container Registry: '${PROD_REGISTRY_PATH}'" - fi - - REGISTRY_SUFFIX=$(echo ${WERF_ENV} | tr '[:upper:]' '[:lower:]') - - SOURCE_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}:${CI_COMMIT_TAG}; - SOURCE_INSTALL_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/install:${CI_COMMIT_TAG}; - SOURCE_RELEASE_VERSION_IMAGE=${PROD_REGISTRY_PATH}/${REGISTRY_SUFFIX}/release-channel:${CI_COMMIT_TAG}; - - if [[ ! $(docker inspect localhost:5000/registry:latest -f '{{index .Config.Labels "io.deckhouse.${DEPLOY_CHANNEL}-released"}}') ]]; then - echo "โš“๏ธ ๐Ÿท [$(date -u)] Add release date label to images." - echo "FROM ${SOURCE_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_IMAGE}" - - echo "FROM ${SOURCE_INSTALL_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_INSTALL_IMAGE}" - - echo "FROM ${SOURCE_RELEASE_VERSION_IMAGE}" | docker build --label io.deckhouse.${DEPLOY_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" -t "${SOURCE_RELEASE_VERSION_IMAGE}" - - - echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push images with release date label." - docker image push ${SOURCE_IMAGE} - docker image push ${SOURCE_INSTALL_IMAGE} - docker image push ${SOURCE_RELEASE_VERSION_IMAGE} - else - echo "โš“๏ธ ๐Ÿท [$(date -u)] Release date label already present. Skipping." - fi; - - - name: Publish release images for CE if: ${{ needs.detect_editions.outputs.DEPLOY_CE == 'true' }} @@ -660,6 +498,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -791,6 +631,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -922,6 +764,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -1053,6 +897,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'." @@ -1184,6 +1030,8 @@ jobs: if [[ ${enable_push} == "true" ]] ; then echo "โš“๏ธ ๐Ÿ“ค [$(date -u)] Push '${SRC_NAME}' image as ${DST}." docker image push ${DST} + # add date label to pushed image + crane mutate -l io.deckhouse.${RELEASE_CHANNEL}-released="$(date -u +%Y-%m-%dT%H:%M:%SZ)" ${DST} fi echo "โš“๏ธ ๐Ÿงน [$(date -u)] Remove local tag for '${SRC_NAME}'."