good morning!!!!

Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.66 KiB
Newer Older
a's avatar
a committed
.go-cache:
  variables:
    GOPATH: $CI_PROJECT_DIR/.go
  before_script:
    - mkdir -p .go
  cache:
    paths:
      - .go/pkg/mod/

stages:
  - test
Jake Johnston's avatar
ci  
Jake Johnston committed
  - build
Jake Johnston's avatar
Jake Johnston committed
  - deploy
a's avatar
a committed

lint:
  image: registry.gitlab.com/gitlab-org/gitlab-build-images:golangci-lint-alpine
  stage: test
  extends: .go-cache
  script:
    # Use default .golangci.yml file from the image if one is not present in the project root.
    - "[ -e .golangci.yml ] || cp /golangci/.golangci.yml ."
    # Write the code coverage report to gl-code-quality-report.json
    # and print linting issues to stdout in the format: path/to/file:line description
    # remove `--issues-exit-code 0` or set to non-zero to fail the job if linting issues are detected
    - golangci-lint run --issues-exit-code 0 --print-issued-lines=false --out-format code-climate:gl-code-quality-report.json,line-number
Garet Halliday's avatar
ci
Garet Halliday committed
  artifacts:
a's avatar
a committed
    when: always
    reports:
      codequality: gl-code-quality-report.json
Garet Halliday's avatar
ci
Garet Halliday committed
    paths:
a's avatar
a committed
      - gl-code-quality-report.json
Garet Halliday's avatar
ci
Garet Halliday committed

Jake Johnston's avatar
ci  
Jake Johnston committed
jsonnet:
  stage: build
  image: alpine:latest
a's avatar
a committed
  script:
Jake Johnston's avatar
ci  
Jake Johnston committed
    - apk add -U jsonnet
    - jsonnet .gitlab-ci.jsonnet > generated-config.yml
a's avatar
a committed
  artifacts:
Jake Johnston's avatar
ci  
Jake Johnston committed
    paths:
      - generated-config.yml

trigger-builds:
  stage: build
  needs:
    - jsonnet
  trigger:
    include:
      - artifact: generated-config.yml
        job: jsonnet
    strategy: depend
Jake Johnston's avatar
Jake Johnston committed

trigger-master-deploy:
  stage: deploy
  needs:
    - trigger-builds
  image:
    name: bitnami/kubectl:latest
    entrypoint: [""]
  only:
    variables:
      - $CI_COMMIT_BRANCH == "master"
  script:
    - kubectl config get-contexts
    - kubectl config use-context gfx/gitlab-agents:gfxlabs-dev
    - kubectl rollout restart deployment gfx-pggat