Commit 7d23922c authored by Shinya Maeda's avatar Shinya Maeda
Browse files

PoC Bundling charts

parent 1c17b7b4
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -6,8 +6,6 @@ FROM "registry.gitlab.com/gitlab-org/cluster-integration/helm-install-image/rele
# https://github.com/sgerrand/alpine-pkg-glibc
ARG GLIBC_VERSION

COPY src/ build/

# Install Dependencies
RUN apk add --no-cache openssl curl tar gzip bash jq \
  && curl -sSL -o /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
@@ -16,4 +14,7 @@ RUN apk add --no-cache openssl curl tar gzip bash jq \
  && apk add ruby jq \
  && rm glibc-${GLIBC_VERSION}.apk

COPY src/ build/
COPY vendor/ vendor/

RUN ln -s /build/bin/* /usr/local/bin/
+12 −0
Original line number Diff line number Diff line
@@ -30,6 +30,9 @@ function check_kube_domain() {
function download_chart() {
  local auto_chart
  local auto_chart_name

  copy_bundled_chart

  if [[ ! -d chart ]]; then
    auto_chart=${AUTO_DEVOPS_CHART:-gitlab/auto-deploy-app}
    # shellcheck disable=SC2086 # double quote variables to prevent globbing
@@ -56,6 +59,15 @@ function download_chart() {
  helm dependency build chart/
}

function copy_bundled_chart() {
    if [[ -d chart ]] || [[ -n "${AUTO_DEVOPS_CHART}${AUTO_DEVOPS_CHART_REPOSITORY_NAME}${AUTO_DEVOPS_CHART_REPOSITORY}" ]]; then
      return
    fi

    echo "Copying bundled charts..."
    cp -R /vendor/auto-deploy-app-chart chart
}

function ensure_namespace() {
  kubectl get namespace "$KUBE_NAMESPACE" || kubectl create namespace "$KUBE_NAMESPACE"
}
+53 −0
Original line number Diff line number Diff line
## Contributing

Thank you for your interest in contributing to this GitLab project! We welcome
all contributions. By participating in this project, you agree to abide by the
[code of conduct](#code-of-conduct).


## Developer Certificate of Origin + License

By contributing to GitLab B.V., You accept and agree to the following terms and
conditions for Your present and future Contributions submitted to GitLab B.V.
Except for the license granted herein to GitLab B.V. and recipients of software
distributed by GitLab B.V., You reserve all right, title, and interest in and to
Your Contributions. All Contributions are subject to the following DCO + License
terms.

[DCO + License](https://gitlab.com/gitlab-org/dco/blob/master/README.md)

_This notice should stay as the first item in the CONTRIBUTING.md file._

## Code of conduct

We want to create a welcoming environment for everyone who is interested
in contributing. Please visit our [Code of Conduct
page](https://about.gitlab.com/contributing/code-of-conduct) to learn
more about our commitment to an open and welcoming environment.

## Merge request guidelines

Below are some guidelines for merge requests:

- Any new configuration option should be documented in
  the `Configuration` section in README.md.
- For any template changes, we encourage a test case be added or
  updated in the
  [template tests](https://gitlab.com/gitlab-org/charts/auto-deploy-app/-/blob/master/test/template_test.go).

### Working with the tests

The tests are written in [Go](https://golang.org) (version 1.13 or later,
with [modules enabled](https://golang.org/cmd/go/#hdr-Module_support)) using
the [Terratest](https://github.com/gruntwork-io/terratest) library. To work
on the tests, you need to have [Helm 2](https://v2.helm.sh/docs/) and
[Go](https://golang.org) installed.

To run the tests, run the following commands from the root of your copy of `auto-deploy-app`:

```shell
helm init --client-only               # required only once
helm dependency build .               # required only once
cd test
GO111MODULE=auto go test .            # required for every change to the tests or the template
```
+5 −0
Original line number Diff line number Diff line
apiVersion: v1
description: GitLab's Auto-deploy Helm Chart
name: auto-deploy-app
version: 0.7.0
icon: https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-square.png
+19 −0
Original line number Diff line number Diff line
Copyright GitLab B.V.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading