-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ci pipeline, altered Makefile for better ci support
Updated Makefile for pipeline support Updated .gitignore for build artifacts renaming Further refinements to Makefile in support of pipeline [wip] Started CI pipeline addition [ci] Iterating on getting pipeline working [ci] Run make from the repo root Make quoting rules make me mad [ci] don't need to copy src into gopath when using gomod Also fixed cmd_path and static_binary issues [ci] Fix paths for repo and tar target Make variable fixes (who knew there are 5 different assignment operators) [ci] Get build job working Renaming and including version for app tag [ci] Update test script [ci] update build task in release [ci] build has version in name, must specify correctly in tar call
- Loading branch information
1 parent
d7756f5
commit b0a7655
Showing
38 changed files
with
1,719 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
*~ | ||
*.swp | ||
/scheduler | ||
/scheduler-for-ocf | ||
/ocf-scheduler | ||
/scheduler-*.tar.gz | ||
/coverage.out | ||
/ignoremelol | ||
/demo | ||
/builds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
backends: | ||
- type: vault | ||
name: (( grab meta.name )) | ||
refresh_interval: 30 | ||
properties: | ||
# (string) The URL where the Vault API is located | ||
address: (( grab meta.url )) | ||
insecure_skip_verfiy: true | ||
base_path: "secret/" | ||
auth: | ||
token: (( grab $SAFE_TOKEN )) | ||
|
||
# (hash) Configuration for the doomsday server API | ||
server: | ||
port: 8111 | ||
tls: | ||
cert: (( vault "secret/dd/ssl:certificate" )) | ||
key: (( vault "secret/dd/ssl:key" )) | ||
|
||
auth: | ||
type: userpass | ||
properties: | ||
username: admin | ||
password: password | ||
timeout: 30 | ||
refresh: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- | ||
# | ||
# ci/pipeline/base.yml | ||
# | ||
# Pipeline structure file for a Go Project pipeline | ||
# | ||
# DO NOT MAKE CHANGES TO THIS FILE. Instead, modify | ||
# ci/settings.yml and override what needs overridden. | ||
# This uses spruce, so you have some options there. | ||
# | ||
# author: Dennis Bell <[email protected]> | ||
# Wayne Seguin <[email protected]> | ||
# created: 2023-05-30 | ||
|
||
groups: | ||
- name: (( concat "build-" meta.pipeline "-releases" )) | ||
jobs: | ||
- build | ||
- ship-prerelease | ||
- test | ||
- prepare | ||
- ship-release | ||
- name: (( concat "test-" meta.pipeline "-pull-requests" )) | ||
jobs: | ||
- test-pr | ||
- name: version | ||
jobs: | ||
- major | ||
- minor | ||
- patch | ||
|
||
meta: | ||
name: (( param "Please name your pipeline" )) | ||
release: (( concat meta.name " Release" )) | ||
target: (( param "Please identify the name of the target Concourse CI" )) | ||
pipeline: (( grab meta.name )) | ||
|
||
git: | ||
email: (( param "Please provide the git email for automated commits" )) | ||
name: (( param "Please provide the git name for automated commits" )) | ||
|
||
go: | ||
module: (( concat "github.com/" meta.github.owner "/" meta.github.repo )) | ||
cmd_module: (( grab meta.go.module )) | ||
binary: (( grab meta.github.repo )) | ||
force_static_binary: false | ||
|
||
image: | ||
name: genesiscommunity/concourse-go | ||
tag: latest | ||
|
||
aws: | ||
bucket: (( concat meta.pipeline "-pipeline" )) | ||
region_name: us-east-1 | ||
access_key: (( param "Please set your AWS Access Key ID" )) | ||
secret_key: (( param "Please set your AWS Secret Key ID" )) | ||
|
||
github: | ||
uri: (( concat "[email protected]:" meta.github.owner "/" meta.github.repo )) | ||
owner: (( param "Please specify the name of the user / organization that owns the Github repository" )) | ||
repo: (( param "Please specify the name of the Github repository" )) | ||
branch: develop | ||
private_key: (( param "Please generate an SSH Deployment Key for this repo and specify it here" )) | ||
access_token: (( param "Please generate a Personal Access Token and specify it here" )) | ||
release_notes: | ||
repo: "ci-release-notes" | ||
branch: "main" | ||
file: (( concat meta.name "-release-notes.md" )) | ||
uri: (( concat "[email protected]:" meta.github.owner "/" meta.github.release_notes.repo )) | ||
edit: (( concat "https://github.com/" meta.github.owner "/" meta.github.release_notes.repo "/edit/" meta.github.release_notes.branch "/" meta.github.release_notes.file )) | ||
|
||
slack: | ||
webhook: (( param "Please specify your Slack Incoming Webhook Integration URL" )) | ||
notification: '(( concat ":sadpanda: " meta.pipeline " build failed!<br>URL-GOES-HERE" ))' | ||
username: concourse | ||
icon: http://cl.ly/image/3e1h0H3H2s0P/concourse-logo.png | ||
fail_moji: ":airplane_arriving:" | ||
success_moji: ":airplane_departure:" | ||
upset_moji: ":sad_panda:" | ||
fail_url: '(( concat "<" meta.url "/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME| Concourse Failure! " meta.slack.upset_moji ">" ))' | ||
|
||
url: (( param "What is the URL for the Concourse instance this pipeline is located on?" )) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
jobs: | ||
- name: build | ||
public: true | ||
serial: false | ||
plan: | ||
- in_parallel: | ||
- { get: version, params: {pre: rc} } | ||
- { get: git, trigger: true } | ||
- { get: git-ci } | ||
- task: build | ||
file: git-ci/ci/tasks/build.yml | ||
params: | ||
APP_NAME: (( grab meta.app_name || meta.name )) | ||
MODULE: (( grab meta.go.module )) | ||
CMD_PATH: (( grab meta.go.cmd_path )) | ||
STATIC_BINARY: (( grab meta.go.force_static_binary )) | ||
- put: build | ||
params: | ||
file: build/*.tar.gz | ||
acl: public-read | ||
- put: version | ||
params: {file: version/number} | ||
|
||
on_failure: | ||
put: notify | ||
params: | ||
username: (( grab meta.slack.username )) | ||
icon_url: (( grab meta.slack.icon )) | ||
text: '(( concat meta.slack.fail_url " " meta.pipeline ": test job failed" ))' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
jobs: | ||
- name: prepare | ||
public: true | ||
serial: true | ||
plan: | ||
- do: | ||
- in_parallel: | ||
- { get: version, passed: [test], params: {bump: final} } | ||
- { get: git, passed: [test], trigger: true } | ||
- { get: git-ci } | ||
- { get: git-latest-tag } | ||
- { get: release-notes } | ||
- task: generate-release-notes | ||
file: git-ci/ci/tasks/generate-release-notes.yml | ||
params: | ||
RELEASE_NOTES_WEB_URL: (( grab meta.github.release_notes.edit )) | ||
RELEASE_NOTES_FILE: (( grab meta.github.release_notes.file )) | ||
GIT_NAME: (( grab meta.git.name )) | ||
GIT_EMAIL: (( grab meta.git.email )) | ||
APP_NAME: (( grab meta.name )) | ||
NO_UPSTREAM_SYNC: true | ||
NO_RELEASE_VERSIONS: true | ||
- put: release-notes | ||
params: | ||
rebase: true | ||
repository: release-notes | ||
on_failure: | ||
put: notify | ||
params: | ||
username: (( grab meta.slack.username )) | ||
icon_url: (( grab meta.slack.icon )) | ||
text: '(( concat meta.slack.fail_url " " meta.pipeline ": prepare job failed" ))' | ||
|
||
# Shout-based notification when its working again | ||
# on_failure: | ||
# put: notify | ||
# params: | ||
# topic: (( concat meta.shout.topic "-$BUILD_JOB_NAME" )) | ||
# message: release candidate job 'pre' failed (which is unusual). | ||
# ok: no | ||
# link: (( grab meta.shout.links.build )) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
jobs: | ||
- name: ship-prerelease | ||
public: true | ||
serial: false | ||
plan: | ||
- do: | ||
- in_parallel: | ||
- { get: build, passed: [build]} | ||
- { get: version, passed: [build]} | ||
- { get: git, passed: [build]} | ||
- { get: git-ci } | ||
|
||
- task: ship-prerelease | ||
file: git-ci/ci/tasks/prerelease.yml | ||
params: | ||
PRERELEASE: 1 | ||
APP_NAME: (( grab meta.name )) | ||
DEVELOP_BRANCH: (( grab meta.github.branch )) | ||
RELEASE_BRANCH: (( grab meta.github.branch )) | ||
RELEASE_ROOT: gh | ||
RELEASE_NOTES: (( grab meta.github.release_notes.file )) | ||
NOTIFICATION_OUT: notifications | ||
GITHUB_OWNER: (( grab meta.github.owner )) | ||
GIT_EMAIL: (( grab meta.git.email )) | ||
GIT_NAME: (( grab meta.git.name )) | ||
|
||
- put: github-prerelease | ||
params: | ||
name: gh/name | ||
tag: gh/tag | ||
body: gh/notes.md | ||
commitish: gh/commit | ||
globs: [gh/artifacts/*] | ||
|
||
on_failure: | ||
put: notify | ||
params: | ||
username: (( grab meta.slack.username )) | ||
icon_url: (( grab meta.slack.icon )) | ||
text: '(( concat meta.slack.fail_url " " meta.pipeline ": ship prerelease job failed" ))' | ||
|
||
# Shout-based notification - currently not available | ||
# on_failure: | ||
# put: notify | ||
# params: | ||
# topic: (( concat meta.shout.topic "-$BUILD_JOB_NAME" )) | ||
# message: tests job '$BUILD_JOB_NAME' failed. | ||
# ok: no | ||
# link: (( grab meta.shout.links.build )) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
jobs: | ||
- name: ship-release | ||
public: true | ||
serial: true | ||
plan: | ||
- do: | ||
- in_parallel: | ||
- { get: version, resource: version, passed: [prepare], params: {bump: final} } | ||
- { get: git, passed: [prepare] } | ||
- { get: git-ci } | ||
- { get: git-main } | ||
- { get: git-latest-tag } | ||
- { get: release-notes} | ||
- task: build-kit | ||
file: git-ci/ci/tasks/build.yml | ||
params: | ||
APP_NAME: (( grab meta.name )) | ||
MODULE: (( grab meta.go.module )) | ||
CMD_PATH: (( grab meta.go.cmd_path )) | ||
STATIC_BINARY: (( grab meta.go.force_static_binary )) | ||
- task: release | ||
file: git-ci/ci/tasks/release.yml | ||
params: | ||
APP_NAME: (( grab meta.name )) | ||
DEVELOP_BRANCH: (( grab meta.github.branch )) | ||
RELEASE_BRANCH: (( grab meta.github.main-branch )) | ||
RELEASE_ROOT: gh | ||
RELEASE_NOTES: (( grab meta.github.release_notes.file )) | ||
NOTIFICATION_OUT: notifications | ||
GITHUB_OWNER: (( grab meta.github.owner )) | ||
GIT_EMAIL: (( grab meta.git.email )) | ||
GIT_NAME: (( grab meta.git.name )) | ||
- put: git-main | ||
params: | ||
merge: false | ||
tag: gh/tag | ||
repository: git-main | ||
- put: github | ||
params: | ||
name: gh/name | ||
tag: gh/tag | ||
body: gh/notes.md | ||
globs: [gh/artifacts/*] | ||
- put: version | ||
params: | ||
bump: patch | ||
- put: notify | ||
params: | ||
username: (( grab meta.slack.username )) | ||
icon_url: (( grab meta.slack.icon )) | ||
text_file: notifications/message | ||
on_failure: | ||
put: notify | ||
params: | ||
username: (( grab meta.slack.username )) | ||
icon_url: (( grab meta.slack.icon )) | ||
text: '(( concat meta.slack.fail_url " " meta.pipeline ": prepare job failed" ))' | ||
# Shout notification - not currently available | ||
# on_success: | ||
# put: notify | ||
# params: | ||
# topic: (( concat meta.shout.topic "-$BUILD_JOB_NAME" )) | ||
# message: release job '$BUILD_JOB_NAME' succeeded. | ||
# ok: yes | ||
# link: (( grab meta.shout.links.build )) | ||
# on_failure: | ||
# put: notify | ||
# params: | ||
# topic: (( concat meta.shout.topic "-$BUILD_JOB_NAME" )) | ||
# message: release job '$BUILD_JOB_NAME' failed. | ||
# ok: no | ||
# link: (( grab meta.shout.links.build )) |
Oops, something went wrong.