{"id":13405932,"url":"https://github.com/sclorg/container-common-scripts","last_synced_at":"2025-02-28T16:14:33.812Z","repository":{"id":10961915,"uuid":"67672161","full_name":"sclorg/container-common-scripts","owner":"sclorg","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-28T06:53:47.000Z","size":833,"stargazers_count":20,"open_issues_count":12,"forks_count":45,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-08-28T18:53:09.290Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sclorg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-08T05:41:38.000Z","updated_at":"2024-08-12T19:24:49.000Z","dependencies_parsed_at":"2024-01-02T15:23:30.608Z","dependency_job_id":"9fc354a6-5f98-4dfe-8928-017b3d8e8159","html_url":"https://github.com/sclorg/container-common-scripts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sclorg%2Fcontainer-common-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sclorg%2Fcontainer-common-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sclorg%2Fcontainer-common-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sclorg%2Fcontainer-common-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sclorg","download_url":"https://codeload.github.com/sclorg/container-common-scripts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241180166,"owners_count":19923171,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T19:02:16.310Z","updated_at":"2025-02-28T16:14:33.786Z","avatar_url":"https://github.com/sclorg.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"Common build helpers for sclorg containers\n==========================================\n\nThis repository is aimed to be added as git submodule into particular\ncontainers' source repositories.  By default, the path to submodule should be\nnamed 'common'.\n\nUsage\n-----\n\nThis section explains the usage of the shared scripts in this repository when\nit is used as a submodule in a container source repository.\n\nOnce you have the repository set as a submodule include `common.mk` into your\nroot Makefile in order to access the default rules used to call shared scripts.\n\n**Default rules:**\n\n`make` or `make build`\nThis rule will build an image without tagging it with any tags after it is built.\nIf the builder is podman, then the image would also be squashed by default\nduring the build.\n`make build` will also expect a `README.md` so that it can transform it into\na man page that gets added to the image so make sure it is available and that\nyou have the `go-md2man` tool installed on your host.\n\n\n`make tag`\nUse this rule if you want to tag an image after it is built. It will be tagged with\ntwo tags - name:latest and name:version.\nDepends on `build`\n\n`make test` or `make check`\nThis rule will run the testsuite scripts contained in the container source repositories.\nIt expects the test to be available at `$gitroot/$version/test/run`\nDepends on `tag` as some tests might need to have the images tagged (s2i).\n\n`make test-openshift-4`\nSimilar to `make test` but runs testsuite for Openshift 4, expected to be found at\n`$gitroot/$version/test/run-openshift-remote-cluster`\n\n`make test-openshift-pytest`\nSimilar to `make test` but runs PyTest test suite `https://github.com/sclorg/container-ci-suite` for Openshift 4,\nexpected to be found at `$gitroot/$version/test/run-openshift-pytest`\n\n`make betka`\nRuns script betka.sh that generates sources for the dist-git repo. Only Fedora,\nRHEL7 and RHEL8 are supported.\nFor source generation into Fedora or RHEL dist-git repositories,\nsome parameters are mandatory.\nDOCKER_IMAGE parameter for Fedora case is `quay.io/rhscl/cwt-generator`,\nfor RHEL world please ask pkubat@redhat.com, phracek@redhat.com, or hhorak@redhat.com.\n\nE.g. command for the source generation into Fedora dist-repo\n`https://src.fedoraproject.org/container/nodejs` into main branch is:\n`make betka TARGET=fedora VERSIONS=20`\n\nThe sources are not generated directly into dist-git repository,\nbut into created `results` directory.\n\n`make clean`\nRuns scripts that clean-up the working dir. Depends on the `clean-images` rule by default\nand additional clean rules can be provided through the `clean-hook` variable.\n\n`make clean-images`\nBest-effort to remove the last set of images that have been built using the scripts.\n\n`make shellcheck`\nCheck the shell syntax of the files specified by `$SHELLCHECK_FILES` variable.\nSee `SHELLCHECK_FILES` variable description below for more info (default is `.`).\nThe files matching this specification are then filtered, to not show results twice\nfor symlinks. Only files with a suffix `.sh` or shell shebang are scanned with\nthe `shellcheck` utility. See [run-shellcheck.sh](./run-shellcheck.sh) in this repo for more detailed info.\nOnce the shell syntax issues are fixed, CI that runs `make shellcheck` for each PR can be\nturned on by putting [.travis.yml](.travis.yml) file into the root of the image's repository.\n[.travis.yml](https://github.com/sclorg/container-common-scripts/blob/master/.travis.yml)\nfor its content.\n\n**There are additional variables that you can use that the default rules are prepared to\nwork with:**\n\n`VERSIONS`\nNames of the directories in which the Dockerfiles are contained. Needs to be defined in your\nDockerfile for the scripts to know which versions to build.\n\n`OS`\nOS version you want to build the images for. Currently the scripts are able to build for\ncentos (default), c9s, c10s, rhel8, rhel9, rhel10, and fedora.\n\n`SKIP_SQUASH`\nWhen set to 1 the build script will skip the squash phase of the build.\n\n`CUSTOM_REPO`\nSet this variable to the path to your local .repo files you want to have available inside\nthe image while building. Useful for building rhel-based images on an unsubscribed box.\nBe aware that you cannot write to any .repo files used this way inside the image as they\nwill be mounted into the image as read-only.\n\n`DOCKER_BUILD_CONTEXT`\nUse this variable in case you want to have a different context for your builds. By default\nthe context of the build is the versioned directory the Dockerfiles are contained in.\n\n`SHELLCHECK_FILES`\nOne or more files or directories to be scanned by the shellcheck, default is `.`, which\nmeans a whole repository directory. If a directory is provided then all of its content\nis scanned as well.\n\n`CT_OCP4_TEST`\nSet to true if you want to test container in OpenShift 4 environment.\n\n`CVP`\nSet to true if you want to test container in Container Validation Pipeline environment.\n\n`clean-hook`\nAppend Makefile rules to this variable to make sure additional cleaning actions are run\nwhen `make clean` is called.\n\nFiles affecting behaviour\n-------------------------\nThe directory with Dockerfiles can optionally include some specific files that affect\nhow scripts in this repo work:\n\n`.exclude-\u003cOS\u003e`\nIf this file exists, the tooling will not run the build and tests for the specific Dockerfile.\nFor example, if `.exclude-rhel8` file exists, the `Dockerfile.rhel8` will not be expected\nin the same directory, build and tests will be skipped.\nContent of the file is not important at this point.\n\n`.devel-repo-\u003cOS\u003e`\nThis file is useful if we need to work with RPMs that are not available publically yet.\nContent of the file is not important at this point.\nIf such a file exists in the repository, then the building scripts will take a look\nat a correspondent variable, e.g.  DEVEL_REPO_rhel8, and will use the repository file\ndefined by that variable.\nThat means that definition of the DEVEL_REPO_rhel8 variable is a responsibility of\nthe test/CI environment.\n\n`.build-args-\u003cOS\u003e`\nSome images require some specific build options, let them be set in a file specific\nfor a Dockerfile. This is useful for example for setting capabilities for\nmicro images, that install RPMs into an alternative directory and podman versions\nof 4.4.0+ do not set such capabilities by default.\n\nRegression tests\n----------------\n\n`make check`\nRuns the tests of few images that use this set of scripts. If the tests of those\nimages pass, this repo is considered to be working.\n\n`make shellcheck`\nCheck the shell syntax of all `*.sh` files tracked by the git in this repository.\n\nDependencies for testsuite:\n\n- /usr/bin/docker (either `docker` or `podman` + `podman-docker`)\n- git\n- go-md2man\n- make\n- source-to-image\n- shellcheck\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsclorg%2Fcontainer-common-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsclorg%2Fcontainer-common-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsclorg%2Fcontainer-common-scripts/lists"}