Skip to content

Instantly share code, notes, and snippets.

@kierarad
Last active April 17, 2019 23:55
Show Gist options
  • Save kierarad/2db969a5379128926f6447cf4adef830 to your computer and use it in GitHub Desktop.
Save kierarad/2db969a5379128926f6447cf4adef830 to your computer and use it in GitHub Desktop.

Revisions

  1. kierarad revised this gist Apr 17, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions ci.gocd.yaml
    Original file line number Diff line number Diff line change
    @@ -168,6 +168,7 @@ pipelines:
    arguments:
    - -c
    - |
    set -e
    cd assembly/config
    gem install bundler
    bundle
  2. kierarad revised this gist Apr 17, 2019. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion ci.gocd.yaml
    Original file line number Diff line number Diff line change
    @@ -140,7 +140,7 @@ pipelines:
    AWS_SECRET_ACCESS_KEY: AES:n1DFIAgW5SED7/c4lbLTlQ==:6AzoJCu5Qb8QN4OURCe9z4MCVsp1htOx9aA0VIR8VRHb3QLA0isWKxuFlVdrfO1J
    stages:
    - package:
    elastic_profile_id: ecs-golang-build
    elastic_profile_id: ecs-gocd-dev-build
    artifacts:
    - build:
    source: installers/*
    @@ -163,6 +163,15 @@ pipelines:
    arguments:
    - -o
    - launchers.zip
    - exec:
    command: /bin/bash
    arguments:
    - -c
    - |
    cd assembly/config
    gem install bundler
    bundle
    bundle exec rake
    - exec:
    command: /bin/bash
    arguments:
  3. kierarad created this gist Apr 17, 2019.
    200 changes: 200 additions & 0 deletions ci.gocd.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,200 @@
    ---
    format_version: 3
    environments:
    internal:
    pipelines:
    - gocd-trial-launcher
    - gocd-trial-installers
    pipelines:
    gocd-trial-launcher:
    group: go-cd-contrib
    materials:
    github:
    git: https://git.gocd.io/git/gocd-contrib/gocd-trial-launcher
    blacklist:
    - assembly/**/*
    destination: launcher
    codesigning:
    git: https://github.com/gocd/codesigning
    destination: codesigning
    signing-keys:
    svn: https://github.com/gocd-private/signing-keys/trunk
    username: gocd-ci-user
    encrypted_password: "AES:taOvOCaXsoVwzIi+xIGLdA==:GSfhZ6KKt6MXKp/wdYYoyBQKKzbTiyDa+35kDgkEIOF75s9lzerGInbqbUM7nUKc"
    destination: signing-keys
    environment_variables:
    RELEASE: 1.0.0
    stages:
    - build:
    elastic_profile_id: ecs-golang-build
    artifacts:
    - build:
    source: dist/**/*
    destination: dist/
    tasks:
    - exec:
    command: /bin/bash
    arguments:
    - build.sh
    - --verbose
    - --prod
    working_directory: launcher
    - exec:
    command: mv
    arguments:
    - dist
    - ..
    working_directory: launcher
    - code-signing:
    clean_workspace: yes
    secure_variables:
    GOCD_GPG_PASSPHRASE: "AES:7lAutKoRKMuSnh3Sbg9DeQ==:8fhND9w/8AWw6dJhmWpTcCdKSsEcOzriQNiKFZD6XtN+sJvZ65NH/QFXRNiy192+SSTKsbhOrFmw+kAKt5+MH1Erd6H54zJjpSgvJUmsJaQ="
    jobs:
    osx:
    artifacts:
    - build:
    source: osx-launcher.zip
    resources:
    - mac
    - signer
    tasks:
    - fetch:
    stage: build
    job: build
    source: dist/
    - exec:
    command: /bin/bash
    arguments:
    - launcher/codesigning-helpers/osx-codesign.sh
    - dist/darwin/amd64/run-gocd
    win:
    elastic_profile_id: window-dev-build
    artifacts:
    - build:
    source: win-launcher.zip
    tasks:
    - fetch:
    stage: build
    job: build
    source: dist/
    - exec:
    command: call
    arguments:
    - launcher\codesigning-helpers\win-codesign.bat
    - bundle:
    elastic_profile_id: ecs-golang-build
    artifacts:
    - build:
    source: launchers.zip
    tasks:
    - fetch:
    stage: build
    job: build
    source: dist/
    - fetch:
    stage: code-signing
    job: osx
    source: osx-launcher.zip
    is_file: yes
    - fetch:
    stage: code-signing
    job: win
    source: win-launcher.zip
    is_file: yes
    - exec:
    command: /bin/bash
    arguments:
    - -c
    - |
    echo "Collating codesigned binaries..."
    (cd dist/windows/amd64 && unzip -o ../../../win-launcher.zip)
    (cd dist/darwin/amd64 && unzip -o ../../../osx-launcher.zip)
    sha256sum dist/darwin/amd64/run-gocd
    sha256sum dist/linux/amd64/run-gocd
    sha256sum dist/windows/amd64/run-gocd.exe
    - exec:
    command: zip
    arguments:
    - -r
    - launchers.zip
    - dist
    gocd-trial-installers:
    group: go-cd-contrib
    materials:
    github:
    git: https://git.gocd.io/git/gocd-contrib/gocd-trial-launcher
    whitelist:
    - assembly/**/*
    launcher:
    pipeline: gocd-trial-launcher
    stage: bundle
    installers:
    pipeline: installers
    stage: dist
    environment_variables:
    GOCD_JRE_URL: https://s3.amazonaws.com/mirrors-archive/local/jdk
    GOCD_JRE_VERSION: 11.0.2
    GOCD_UPLOAD_S3_BUCKET: gocd-test-drive-experimental
    secure_variables:
    AWS_ACCESS_KEY_ID: AES:k34KQ2Fk6RFy0/RRyr//cA==:dXHAPzyWK4eWyC7Zjvih/epIhL9dRnvINm+gMrF7zBM=
    AWS_SECRET_ACCESS_KEY: AES:n1DFIAgW5SED7/c4lbLTlQ==:6AzoJCu5Qb8QN4OURCe9z4MCVsp1htOx9aA0VIR8VRHb3QLA0isWKxuFlVdrfO1J
    stages:
    - package:
    elastic_profile_id: ecs-golang-build
    artifacts:
    - build:
    source: installers/*
    destination: installers/
    tasks:
    - fetch:
    pipeline: installers
    stage: dist
    job: dist
    source: dist/zip/
    destination: deps/
    - fetch:
    pipeline: gocd-trial-launcher
    stage: bundle
    job: bundle
    source: launchers.zip
    is_file: yes
    - exec:
    command: unzip
    arguments:
    - -o
    - launchers.zip
    - exec:
    command: /bin/bash
    arguments:
    - assembly/package.sh
    - osx
    - linux
    - windows
    - upload:
    elastic_profile_id: ecs-gocd-dev-build
    tasks:
    - fetch:
    stage: package
    job: package
    source: installers
    - exec:
    command: ruby
    arguments:
    - assembly/upload.rb
    - installers
    - promote-to-stable:
    approval: manual
    jobs:
    promote:
    elastic_profile_id: ecs-gocd-dev-build
    tasks:
    - fetch:
    stage: package
    job: package
    source: installers
    - exec:
    command: ruby
    arguments:
    - assembly/upload.rb
    - --release
    - installers