GaneshSPatil / gocd-mergeable-yaml-example

An example GoCD config repository which uses gocd-mergable github action

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GoCD Mergeable Yaml Example

.github/workflows/gocd-mergeable.yml

An example GoCD Yaml config repository which uses Gocd Mergeable github action.

Description

This repository contains GoCD configurations specified in YAML format using GoCD Yaml Config Plugin. The GoCD Mergeable github action verifies whether changes done to the GoCD configuration files are valid or not.

Setup

  1. Define GoCD Pipeline configurations in dev.gocd.yaml file
format_version: 9
pipelines:
  build-on-linux:
    group: dev
    materials:
      mygit:
        git: http://example.com/mygit.git
    stages:
      - build:
          jobs:
            build:
              tasks:
                - exec:
                    command: make
environments:
  dev:
    environment_variables:
      DEPLOYMENT_ENV: dev
    pipelines:
      - build-on-linux
  1. Add the configuration repository to GoCD config repositories. Note the ID you've assigned to it, e.g. gocd-mergeable-yaml-example.

  2. Create .github/workflows/gocd-mergeable.yml to setup GoCD Mergeable Github Action.

on: [push, pull_request]

jobs:
  verify_config_repository:
    runs-on: ubuntu-latest
    name: verify config merge.
    steps:
      - name: Git checkout
        uses: actions/checkout@v2
      - name: Verify Config Merge
        uses: GaneshSPatil/gocd-mergeable@v1.0.0
        with:
          GOCD_SERVER_URL: 'https://build.gocd.org/go'
          GOCD_ADMIN_ACCESS_TOKEN: ${{ secrets.GOCD_ADMIN_ACCESS_TOKEN }}
          GOCD_CONFIG_REPOSITORY_ID: 'gocd-mergeable-yaml-example' # The ID you have assined on config repositories page on GoCD Admin UI.

License

GoCD Mergeable Yaml Example is an open source project, under the Apache License, Version 2.0.

About

An example GoCD config repository which uses gocd-mergable github action

License:Apache License 2.0