Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Configure a drone pipeline for the repository #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
52 changes: 52 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
workspace:
base: /drone
path: src/github.com/vmware/vic-tools

clone:
git:
image: plugins/git
tags: true
recursive: false

pipeline:
check-org-membership:
image: 'wdc-harbor-ci.eng.vmware.com/default-project/vic-integration-test:1.48'
pull: true
environment:
BIN: bin
GOPATH: /go
SHELL: /bin/bash
secrets:
- github_automation_api_key
- skip_check_membership
commands:
- echo ${DRONE_COMMIT_AUTHOR}
- echo $SKIP_CHECK_MEMBERSHIP
- if [ "$SKIP_CHECK_MEMBERSHIP" = "true" ]; then echo 'check-org-membership step skipped'; else /bin/bash -c '[[ ! $(curl --silent "https://api.github.com/orgs/vmware/members/${DRONE_COMMIT_AUTHOR}?access_token=$GITHUB_AUTOMATION_API_KEY") ]]'; fi
when:
status: success

vic-tools:
image: 'wdc-harbor-ci.eng.vmware.com/default-project/vic-integration-test:1.48'
pull: true
environment:
BIN: bin
GOPATH: /go
SHELL: /bin/bash
commands:
- make all
when:
status: success

notify-slack:
image: plugins/slack
secrets:
- source: slack_url
target: slack_webhook
username: drone
template: >
build https://ci-vic.vmware.com/vmware/vic-tools/{{ build.number }} finished with a {{ build.status }} status.
when:
repo: vmware/vic-tools
event: [push, tag]
status: [success, failure]
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@

SHELL = /bin/bash

SHELL_FILES = $(shell find . -type f -name '*.sh')

.PHONY: all check shellcheck
.DEFAULT_GOAL := all

all: check
check: shellcheck

shellcheck:
@shellcheck **/*.sh

@docker run --rm -v $(PWD):/root -w /root -t caarlos0/shellcheck shellcheck $(SHELL_FILES)