diff --git a/CHANGELOG.md b/CHANGELOG.md index 21120d1..7fab8aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,19 @@ *** +### Release 23.08.1 + +Main changes: + +- hook scripts `env.rc`, `push` and `post_push` have been updated +- handling of multiple deployment tags per image has been improved and it covers also publishing into the builder repository now + - also less image pollution by publishing +- file `readme-local-building-example.md` got a new section `Tips and examples`, containing + - `How to deploy all images into one repository` +- fix in `ci-builder.sh` help mode +- readme files updated +- container screenshots replaced by animations + ### Release 23.08 This release brings updated and significantly shortened README files, because most of the content has been moved into the new [User guide][this-user-guide]. diff --git a/cspell.json b/cspell.json new file mode 100644 index 0000000..3ee488d --- /dev/null +++ b/cspell.json @@ -0,0 +1,32 @@ +{ + // Version of the setting file. Always 0.2 + "version": "0.2", + // language - current active spelling language + "language": "en", + // words - list of words to be always considered correct + "words": [ + "accetto", + "BUILDKIT", + "CERTDIR", + "dind", + "Dockerfiles", + "DOCKERHUB", + "envrc", + "ENVV", + "esac", + "fugo", + "Gists", + "nomachine", + "novnc", + "NOVNC", + "tldr", + "utilrc", + "xfce", + "Xfce", + "xubuntu" + ], + // flagWords - list of words to be always considered incorrect + // This is useful for offensive words and common spelling errors. + // For example "hte" should be "the" + "flagWords": [] +} \ No newline at end of file diff --git a/docker/doc/images/animation-ubuntu-vnc-xfce-chromium-g3.gif b/docker/doc/images/animation-ubuntu-vnc-xfce-chromium-g3.gif new file mode 100644 index 0000000..06e7e52 Binary files /dev/null and b/docker/doc/images/animation-ubuntu-vnc-xfce-chromium-g3.gif differ diff --git a/docker/doc/images/animation-ubuntu-vnc-xfce-firefox-g3.gif b/docker/doc/images/animation-ubuntu-vnc-xfce-firefox-g3.gif new file mode 100644 index 0000000..34fbf7e Binary files /dev/null and b/docker/doc/images/animation-ubuntu-vnc-xfce-firefox-g3.gif differ diff --git a/docker/doc/images/animation-ubuntu-vnc-xfce-g3.gif b/docker/doc/images/animation-ubuntu-vnc-xfce-g3.gif new file mode 100644 index 0000000..e643573 Binary files /dev/null and b/docker/doc/images/animation-ubuntu-vnc-xfce-g3.gif differ diff --git a/docker/doc/images/ubuntu-vnc-xfce-chromium-g3-latest.png b/docker/doc/images/ubuntu-vnc-xfce-chromium-g3-latest.png deleted file mode 100644 index f4da1a1..0000000 Binary files a/docker/doc/images/ubuntu-vnc-xfce-chromium-g3-latest.png and /dev/null differ diff --git a/docker/doc/images/ubuntu-vnc-xfce-firefox-g3-latest.png b/docker/doc/images/ubuntu-vnc-xfce-firefox-g3-latest.png deleted file mode 100644 index b8c5a10..0000000 Binary files a/docker/doc/images/ubuntu-vnc-xfce-firefox-g3-latest.png and /dev/null differ diff --git a/docker/doc/images/ubuntu-vnc-xfce-g3-latest.png b/docker/doc/images/ubuntu-vnc-xfce-g3-latest.png deleted file mode 100644 index f8ff8fc..0000000 Binary files a/docker/doc/images/ubuntu-vnc-xfce-g3-latest.png and /dev/null differ diff --git a/docker/hooks/env.rc b/docker/hooks/env.rc index 19f485d..c809d76 100644 --- a/docker/hooks/env.rc +++ b/docker/hooks/env.rc @@ -49,7 +49,8 @@ DOCKER_REPO="${_owner}/${BUILDER_REPO:?Need builder repo name}" declare _deploy_repo -### array of the image tags to be deployed +### arrays of the image tags to be deployed +declare -a _deploy_builder_tags declare -a _deploy_tags declare _deploytag @@ -215,6 +216,7 @@ case "${_branch}" in ### latest -> 22.04 DOCKER_TAG="${_blend}" _deploy_tags=( "latest" "22.04" ) + _deploy_builder_tags=( "${_blend}" "${_blend/latest/22.04}" ) ;; jammy | jammy-* ) @@ -222,12 +224,14 @@ case "${_branch}" in ### jammy -> 22.04 DOCKER_TAG="${_blend/jammy/22.04}" _deploy_tags=( "latest" "22.04" ) + _deploy_builder_tags=( "${_blend/jammy/latest}" "${_blend/jammy/22.04}" ) ;; focal | focal-* ) ### focal -> 20.04 DOCKER_TAG="${_blend/focal/20.04}" _deploy_tags=( "20.04" ) + _deploy_builder_tags=( "${_blend/focal/20.04}" ) ;; * ) diff --git a/docker/hooks/post_push b/docker/hooks/post_push index b217317..860d43e 100644 --- a/docker/hooks/post_push +++ b/docker/hooks/post_push @@ -23,6 +23,7 @@ main() { local version_sticker_verbose local repo_building="${DOCKER_REPO##*/}" local repo_deploy="${_deploy_repo##*/}" + local keeper_repo_tag="${_deploy_builder_tags[0]}" ### debugging support # dump_environment @@ -37,14 +38,17 @@ main() { then ### get values for badges from the image metadata (labels) - created=$( get_label "${DOCKER_REPO}:${DOCKER_TAG}" "org.opencontainers.image.created" ) - version_sticker=$( get_label "${DOCKER_REPO}:${DOCKER_TAG}" "any.accetto.version-sticker" ) + created=$( get_label "${DOCKER_REPO}:${keeper_repo_tag}" "org.opencontainers.image.created" ) + version_sticker=$( get_label "${DOCKER_REPO}:${keeper_repo_tag}" "any.accetto.version-sticker" ) version_sticker_verbose=$( cat "${_build_context}/${_scrap_version_sticker_verbose_current}" ) ### update badge endpoints in the builder repository gist - update_gist "${GIST_ID}" "${_gist_key_created}" "${DOCKER_REPO}" "${DOCKER_TAG}" "${created}" - update_gist "${GIST_ID}" "${_gist_key_version_sticker}" "${DOCKER_REPO}" "${DOCKER_TAG}" "${version_sticker}" - update_gist "${GIST_ID}" "${_gist_key_version_sticker_verbose}" "${DOCKER_REPO}" "${DOCKER_TAG}" "${version_sticker_verbose}" + for t in "${_deploy_builder_tags[@]}" ; do + + update_gist "${GIST_ID}" "${_gist_key_created}" "${DOCKER_REPO}" "${t}" "${created}" + update_gist "${GIST_ID}" "${_gist_key_version_sticker}" "${DOCKER_REPO}" "${t}" "${version_sticker}" + update_gist "${GIST_ID}" "${_gist_key_version_sticker_verbose}" "${DOCKER_REPO}" "${t}" "${version_sticker_verbose}" + done else echo "Skipping builder gist update because of null or prohibited target repositories." @@ -57,7 +61,7 @@ main() { ### note that the builder and deployment repositories could be identical ### in that case skip the tag which has been already published above - if [[ "${DOCKER_REPO}" != "${_deploy_repo}" || "${DOCKER_TAG}" != "${t}" ]] ; then + if [[ "${DOCKER_REPO}" != "${_deploy_repo}" || "${keeper_repo_tag}" != "${t}" ]] ; then update_gist "${DEPLOY_GIST_ID}" "${_gist_key_created}" "${_deploy_repo}" "${t}" "${created}" update_gist "${DEPLOY_GIST_ID}" "${_gist_key_version_sticker}" "${_deploy_repo}" "${t}" "${version_sticker}" diff --git a/docker/hooks/push b/docker/hooks/push index 19c5f03..5a25aaa 100644 --- a/docker/hooks/push +++ b/docker/hooks/push @@ -11,6 +11,7 @@ source "${_mydir}"/util.rc deployment_push() { local target local repo="${_deploy_repo##*/}" + local keeper_repo_tag="${_deploy_builder_tags[0]}" if [[ -n "${repo}" && "${repo}" != "${_prohibited_repo_name}" ]] ; then @@ -19,24 +20,26 @@ deployment_push() { ### note that the builder and deployment repositories could be identical ### in that case skip the tag which has been already published above - if [[ "${DOCKER_REPO}" != "${_deploy_repo}" || "${DOCKER_TAG}" != "${t}" ]] ; then + if [[ "${DOCKER_REPO}" != "${_deploy_repo}" || "${keeper_repo_tag}" != "${t}" ]] ; then target="${_deploy_repo}:${t}" echo ; echo "Deploying image '${target}'" - docker tag "${DOCKER_REPO}:${DOCKER_TAG}" "${target}" + docker tag "${DOCKER_REPO}:${keeper_repo_tag}" "${target}" docker push "${target}" + docker rmi "${target}" fi done else - echo "Skipping push because of null or prohibited deployment repository '${repo}'." + echo "Skipping deployment repo push because of null or prohibited deployment repository '${repo}'." fi } main() { local target local repo="${DOCKER_REPO##*/}" + local keeper_repo_tag="${_deploy_builder_tags[0]}" if [[ -f "${_build_context}/${_scrap_demand_stop_building}" ]] ; then echo "Skipping push on demand." @@ -66,11 +69,27 @@ main() { if [[ -n "${repo}" && "${repo}" != "${_prohibited_repo_name}" ]] ; then - echo ; echo "Pushing builder image ${DOCKER_REPO}:${DOCKER_TAG}" - docker push ${DOCKER_REPO}:${DOCKER_TAG} + ### push all target tags into the builder repository + for t in "${_deploy_builder_tags[@]}" ; do + + echo ; echo "Pushing builder image ${DOCKER_REPO}:${t}" + + if [[ "${t}" == "${keeper_repo_tag}" ]] ; then + + # first element is the master repo (a keeper) + docker push "${DOCKER_REPO}:${t}" + + else + target="${DOCKER_REPO}:${t}" + + docker tag "${DOCKER_REPO}:${keeper_repo_tag}" "${target}" + docker push "${target}" + docker rmi "${target}" + fi + done else - echo "Skipping forced push because of null or prohibited builder repository '${repo}'." + echo "Skipping forced builder repo push because of null or prohibited builder repository '${repo}'." fi fi diff --git a/docker/xfce-chromium/README-dockerhub.md b/docker/xfce-chromium/README-dockerhub.md index 18ccd75..64933ba 100644 --- a/docker/xfce-chromium/README-dockerhub.md +++ b/docker/xfce-chromium/README-dockerhub.md @@ -109,7 +109,7 @@ If you have a question or an idea and you don't want to open an issue, you can a [this-dockerfile]: https://github.com/accetto/ubuntu-vnc-xfce-g3/blob/master/docker/Dockerfile.xfce.22-04 -[this-screenshot-container]: https://raw.githubusercontent.com/accetto/ubuntu-vnc-xfce-g3/master/docker/doc/images/ubuntu-vnc-xfce-chromium-g3-latest.png +[this-screenshot-container]: https://raw.githubusercontent.com/accetto/ubuntu-vnc-xfce-g3/master/docker/doc/images/animation-ubuntu-vnc-xfce-chromium-g3.gif [accetto-dockerhub-debian-vnc-xfce-chromium-g3]: https://hub.docker.com/r/accetto/debian-vnc-xfce-chromium-g3 diff --git a/docker/xfce-firefox/README-dockerhub.md b/docker/xfce-firefox/README-dockerhub.md index 156923f..c19612a 100644 --- a/docker/xfce-firefox/README-dockerhub.md +++ b/docker/xfce-firefox/README-dockerhub.md @@ -110,7 +110,7 @@ If you have a question or an idea and you don't want to open an issue, you can a [this-dockerfile]: https://github.com/accetto/ubuntu-vnc-xfce-g3/blob/master/docker/Dockerfile.xfce.22-04 -[this-screenshot-container]: https://raw.githubusercontent.com/accetto/ubuntu-vnc-xfce-g3/master/docker/doc/images/ubuntu-vnc-xfce-firefox-g3-latest.png +[this-screenshot-container]: https://raw.githubusercontent.com/accetto/ubuntu-vnc-xfce-g3/master/docker/doc/images/animation-ubuntu-vnc-xfce-firefox-g3.gif [accetto-dockerhub-debian-vnc-xfce-firefox-g3]: https://hub.docker.com/r/accetto/debian-vnc-xfce-firefox-g3 diff --git a/docker/xfce/README-dockerhub.md b/docker/xfce/README-dockerhub.md index 8108fe5..d1d7c4a 100644 --- a/docker/xfce/README-dockerhub.md +++ b/docker/xfce/README-dockerhub.md @@ -100,7 +100,7 @@ If you have a question or an idea and you don't want to open an issue, you can a [this-dockerfile]: https://github.com/accetto/ubuntu-vnc-xfce-g3/blob/master/docker/Dockerfile.xfce.22-04 -[this-screenshot-container]: https://raw.githubusercontent.com/accetto/ubuntu-vnc-xfce-g3/master/docker/doc/images/ubuntu-vnc-xfce-g3-latest.png +[this-screenshot-container]: https://raw.githubusercontent.com/accetto/ubuntu-vnc-xfce-g3/master/docker/doc/images/animation-ubuntu-vnc-xfce-g3.gif [accetto-github-xubuntu-vnc-novnc]: https://github.com/accetto/xubuntu-vnc-novnc/ diff --git a/readme-local-building-example.md b/readme-local-building-example.md index 5c1ba77..79e122e 100644 --- a/readme-local-building-example.md +++ b/readme-local-building-example.md @@ -21,6 +21,8 @@ - [Disabling `noVNC`](#disabling-novnc) - [Disabling `Firefox Plus`](#disabling-firefox-plus) - [README files for Docker Hub](#readme-files-for-docker-hub) + - [Tips and examples](#tips-and-examples) + - [How to deploy all images into one repository](#how-to-deploy-all-images-into-one-repository) ## Introduction @@ -359,3 +361,37 @@ For example, the `README` file for the repository `accetto/ubuntu-vnc-xfce-g3` c ### or if the environment variable 'DEPLOY_GIST_ID' has been set ./util-readme.sh --repo accetto/ubuntu-vnc-xfce-g3 --context=../docker/xfce -- preview ``` + +## Tips and examples + +### How to deploy all images into one repository + +There are three deployment repositories by default. + +Their names are defined by the following environment variables: + +- `DEPLOYMENT_REPO` for generic images +- `DEPLOYMENT_REPO_CHROMIUM` for images with Chromium +- `DEPLOYMENT_REPO_FIREFOX` for images with Firefox + +The forth variable `BUILDER_REPO` defines the name of the *builder repository*, which is not used for deployment by default. + +However, the images can be optionally published also into the *builder repository* by setting the environment variable `FORCE_PUBLISHING_BUILDER_REPO=1`. + +The images in the builder repository are distinguished by their tags. + +On the other hand, if the repository environment variables are unset or set to the reserved value `void`, then the deployment into the related repository will be skipped. + +This behaviour can be used, if you want to publish all the images into a single repository. + +Simply set all repositories except the builder one to `void` and force the publishing into the builder repository. + +For example, for publishing all the images into a single repository `headless-ubuntu-g3` set the variables like this: + +```shell +DEPLOYMENT_REPO="void" +DEPLOYMENT_REPO_CHROMIUM="void" +DEPLOYMENT_REPO_FIREFOX="void" +BUILDER_REPO="headless-ubuntu-g3" +FORCE_PUBLISHING_BUILDER_REPO=1 +```