Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move norsk mirror pipeline over to ci repo #25

Merged
merged 1 commit into from
Jun 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions pipelines/norsk-mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
resources:
- name: latest-scan-status
type: git
source:
private_key: ((norsk_deploy_key))
uri: git@github.com:pivotal/oslo-scan-status.git
paths: [ p-concourse/* ]
- name: 4.2.X-scan-status
type: git
source:
private_key: ((norsk_deploy_key))
uri: git@github.com:pivotal/oslo-scan-status.git
paths: [ p-concourse-4.2.x/* ]
- name: ci
type: git
icon: &git-icon github-circle
source:
uri: https://github.com/concourse/ci.git
branch: master

jobs:
- name: check-p-concourse-latest
plan:
- get: latest-scan-status
trigger: true
- get: ci
- task: check-status-file
file: ci/tasks/check-norsk-status.yml
input_mapping: {scan-status: latest-scan-status}

Copy link
Member

@cirocosta cirocosta Jun 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmmm this got me thinking - we'll probably want to have a 5.2.x just like we have 4.2.x as we'll be supporting a patching pipeline for the 5.2.x series for a while 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made an issue for this: #26

- name: check-p-concourse-4.2.X
plan:
- get: 4.2.X-scan-status
trigger: true
- get: ci
- task: check-status-file
file: ci/tasks/check-norsk-status.yml
input_mapping: {scan-status: 4.2.X-scan-status}

11 changes: 11 additions & 0 deletions tasks/check-norsk-status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
platform: linux
image_resource:
type: registry-image
source: { repository: ubuntu }

inputs:
- name: scan-status

run:
path: ci/tasks/scripts/check-norsk-status
15 changes: 15 additions & 0 deletions tasks/scripts/check-norsk-status
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

status_file=scan-status/p-concourse/status.json
cat "$status_file"

num_failures="$(grep -c '"status": "failed"' $status_file)"
echo ""

if [ "$num_failures" -eq 0 ]; then
echo "No failures found"
exit 0
else
echo "$num_failures failures found! Please check your norsk-viewers pipelines specified in the status.json and resolve the errors. Contact the OSL team if you need help."
exit 1
fi