Instead of calling `gem install <x>` many times, let's define the
`Gemfile` and `Gemfile.lock` and run `bundle install`. This ensures
dependencies are pinned and don't quietly move with a new invocation
of `gem install`. There is also a side benefit to using `bundler`: we
can later use the newly-introduced feature to include and verify
checksums (https://github.com/rubygems/rubygems/pull/6374).
`bundler` generally installs everything in the expected gem directory
that is used by `ruby`, but for gems installed from a Git source,
`bundler` puts those gems in a special `bundler/gems` directory.
We don't use any gems from Git sources now--`gitlab-ruby-shadow`
is now used instead of `ruby-shadow`--there is no issue.
Also, note that if we want to ensure `gitlab-ctl` doesn't try to pull
in gems from GitLab Rails, we could invoke `bundler`, but this is a
slightly riskier change.
Relates to https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8368
Changelog: changed
While generating package information, specify fips argument for FIPS
package URLs. Also ensure the correct package folder is used in those
URLs.
Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
Package related information can have different values for FIPS packages
and regular packages. For builds, USE_SYSTEM_SSL variable controls if
the FIPS specific information should be used. However, while generating
facts, we need to specifically retreive FIPS specific information too,
in addition to regular one. So, accept fips as an argument to the
relevant methods that can be specified while generating facts.
Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
Modify the Dockerfile and library code around Docker image builds to
support building multiarch images. The Dockerfile will download the
package for the correct architecture based on TARGETARCH variable.
Closes: https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8470
Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
Move away from docker-api gem which does not have support for `docker
buildx`. Add a wrapper to execute `docker buildx` commands in the shell
and use that for Docker operations.
Closes: https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8469
Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
- Adds DEV_BUILDER_IMAGE_REGISTRY when invoking triggers to
allow build-package-on-all-os jobs to work with SLES from
the GitLab Omnibus Builder repository.
Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
Drop trigger build jobs in favor of normal branch build jobs
Closes#6333 and #7187
See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7497
Merged-by: Andrew Patterson <apatterson@gitlab.com>
Approved-by: Clemens Beck <cbeck@gitlab.com>
Approved-by: Andrew Patterson <apatterson@gitlab.com>
Reviewed-by: Balasankar 'Balu' C <balasankar@gitlab.com>
Reviewed-by: Clemens Beck <cbeck@gitlab.com>
Co-authored-by: Balasankar 'Balu' C <balasankar@gitlab.com>
- Control cache policy by variable.
- Drop trigger build jobs in favor of normal branch build jobs.
Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
- Adds option that enables container copies with skopeo
instead of pull the image, re-tag, and then push it
- Retains current pull/re-tag/push behavior as default
Related https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/5673
Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
- Ensures package is built for both branch pipelines and
the nightly job
- Fixes package download URL calculations
Closes https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8451
Signed-off-by: Balasankar 'Balu' C <balasankar@gitlab.com>
This reverts merge request !7460 because the `Trigger:package` job
was not present. Adding it would build the Ubuntu package twice, so
we chose to revert and determine if this can be done with the
package already built in the pipeline.
* Ensure every library `require`s all the other libraries it needs for
functioning.
* Ensure require statements come before require_relative ones
* Ensure require_relative statements doesn't end with `.rb` extension
* Also enabled the Cop for that
* Use single quotes for require statements
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
This information is used only during building. So it makes sense for it
to stay in the Build module.
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
This information is used only in GCloudHelper and no where else. So, it
makes sense for it to stay in that class.
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
Split Deploy related information to own class
See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7238
Merged-by: Robert Marshall <rmarshall@gitlab.com>
Approved-by: Andrew Patterson <apatterson@gitlab.com>
Approved-by: Robert Marshall <rmarshall@gitlab.com>
Co-authored-by: Balasankar 'Balu' C <balasankar@gitlab.com>
Move the following methods:
* `Build::Info.deploy_env_key` => `Build::Info::Deploy.environment_key`
* `Build::Info.deploy_env` => `Build::Info::Deploy.environment`
Related https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8063
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
- Drop auto-deploy pipeline code sections that are now handled
by the Delivery team's co-ordinated pipelines
- Remove code relevant to Ubuntu 16.04 whose support was
dropped some time ago
- Improves the deploy related rspec tests
- Exit deploy code earlier when possible similar to how
logic gates are handled in other rake tasks
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
Move the following methods:
* `Build::Info.deploy_env_key` => `Build::Info::Deploy.environment_key`
* `Build::Info.deploy_env` => `Build::Info::Deploy.environment`
Related https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8063
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
Tag docker images from triggered builds with CI_COMMIT_REF_SLUG also
See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7176
Merged-by: Robert Marshall <rmarshall@gitlab.com>
Approved-by: Robert Marshall <rmarshall@gitlab.com>
Approved-by: Clemens Beck <cbeck@gitlab.com>
Reviewed-by: Clemens Beck <cbeck@gitlab.com>
Co-authored-by: Balasankar "Balu" C <balasankar@gitlab.com>
- containers built in trigger builds are now
tagged additionally with CI_COMMIT_REF_SLUG to
enable local testing
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
Split QA related information to own class
See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7012
Merged-by: Robert Marshall <rmarshall@gitlab.com>
Approved-by: Andrew Patterson <apatterson@gitlab.com>
Approved-by: Robert Marshall <rmarshall@gitlab.com>
Co-authored-by: Balasankar "Balu" C <balasankar@gitlab.com>
Split Docker related information to own class
See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7011
Merged-by: Robert Marshall <rmarshall@gitlab.com>
Approved-by: Andrew Patterson <apatterson@gitlab.com>
Approved-by: Robert Marshall <rmarshall@gitlab.com>
Co-authored-by: Balasankar "Balu" C <balasankar@gitlab.com>
Move the following methods:
* `Build::Info.docker_tag` => `Build::Info::Docker.tag`
* `Build::Info.release_file_contents` => `Build::Info::Docker.release_file_contents`
Related https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8063
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
- Replace google cloud SDK with the google-cloud-storage gem
thereby reducing the total footprint size of the builders
Closes https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8088
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
Use allowlist and denylist
See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7076
Merged-by: Balasankar 'Balu' C <balasankar@gitlab.com>
Approved-by: Clemens Beck <cbeck@gitlab.com>
Approved-by: Balasankar 'Balu' C <balasankar@gitlab.com>
Co-authored-by: Oscar Tovar <otovar@gitlab.com>
Split Git related information to own class
See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7008
Merged-by: DJ Mountney <dj@gitlab.com>
Approved-by: Andrew Patterson <apatterson@gitlab.com>
Approved-by: DJ Mountney <dj@gitlab.com>
Co-authored-by: Balasankar "Balu" C <balasankar@gitlab.com>
Rather than whether the git checkout is on a tag
This fixes an issue where we use the wrong job name on a branch pipeline
when the commit matches a git tag.