mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-23 00:57:44 +01:00
Merge pull request #4338 from wy65701436/debut-new-drone
Update drone to 0.8
This commit is contained in:
commit
e2efe80de5
63
.drone.yml
63
.drone.yml
@ -1,5 +1,3 @@
|
||||
# Harbor drone.
|
||||
---
|
||||
workspace:
|
||||
base: /drone
|
||||
path: src/github.com/vmware/harbor
|
||||
@ -10,47 +8,72 @@ pipeline:
|
||||
tags: true
|
||||
recursive: false
|
||||
|
||||
check-org-membership:
|
||||
image: 'wdc-harbor-ci.eng.vmware.com/default-project/vic-integration-test:1.44'
|
||||
pull: true
|
||||
environment:
|
||||
BIN: bin
|
||||
GOPATH: /go
|
||||
SHELL: /bin/bash
|
||||
secrets:
|
||||
- github_automation_api_key
|
||||
commands:
|
||||
- echo ${DRONE_COMMIT_AUTHOR}
|
||||
- /bin/bash -c '[[ ! $(curl --silent "https://api.github.com/orgs/vmware/members/${DRONE_COMMIT_AUTHOR}?access_token=$GITHUB_AUTOMATION_API_KEY") ]]'
|
||||
when:
|
||||
status: success
|
||||
|
||||
test-and-issue-build:
|
||||
image: vmware/harbor-e2e-engine:1.39
|
||||
image: vmware/harbor-e2e-engine:1.40
|
||||
pull: true
|
||||
privileged: true
|
||||
environment:
|
||||
BIN: bin
|
||||
GOPATH: /drone
|
||||
SHELL: /bin/bash
|
||||
TERM: xterm
|
||||
LOG_TEMP_DIR: install-logs
|
||||
GITHUB_AUTOMATION_API_KEY: ${GITHUB_AUTOMATION_API_KEY}
|
||||
DRONE_SERVER: ${DRONE_SERVER}
|
||||
DRONE_TOKEN: ${DRONE_TOKEN_INTE}
|
||||
HARBOR_ADMIN: ${HARBOR_ADMIN}
|
||||
HARBOR_PASSWORD: ${HARBOR_PASSWORD}
|
||||
GS_PROJECT_ID: ${GS_PROJECT_ID}
|
||||
GS_CLIENT_EMAIL: ${GS_CLIENT_EMAIL}
|
||||
GS_PRIVATE_KEY: ${GS_PRIVATE_KEY}
|
||||
DOMAIN: ${CI_DOMAIN}
|
||||
MAIL_PWD: ${MAIL_PWD}
|
||||
NPM_USERNAME: ${NPM_USERNAME}
|
||||
NPM_PASSWORD: ${NPM_PASSWORD}
|
||||
secrets:
|
||||
- ci_domain
|
||||
- drone_server
|
||||
- drone_token
|
||||
- drone_token_inte
|
||||
- github_automation_api_key
|
||||
- gs_client_email
|
||||
- gs_private_key
|
||||
- gs_project_id
|
||||
- harbor_admin
|
||||
- harbor_password
|
||||
- mail_pwd
|
||||
- npm_password
|
||||
- npm_username
|
||||
commands:
|
||||
- export DOMAIN=${CI_DOMAIN}
|
||||
- export HOST_CONTAINER_ID=$(hostname)
|
||||
- echo $HOST_CONTAINER_ID
|
||||
- tests/integration.sh
|
||||
when:
|
||||
status: success
|
||||
|
||||
notify-slack:
|
||||
image: plugins/slack
|
||||
webhook: ${SLACK_URL}
|
||||
secrets:
|
||||
- source: slack_url
|
||||
target: slack_webhook
|
||||
username: drone
|
||||
template: >
|
||||
build https://ci.vcna.io/vmware/harbor/{{ build.number }} finished with a {{ build.status }} status. Please find logs at https://storage.googleapis.com/harbor-ci-logs/integration_logs_{{ build.number }}_{{ build.commit }}.tar.gz
|
||||
build https://ci-vic.vmware.com/vmware/harbor/{{ build.number }} finished with a {{ build.status }} status. Please find logs at https://storage.googleapis.com/harbor-ci-logs/integration_logs_{{ build.number }}_{{ build.commit }}.tar.gz
|
||||
when:
|
||||
repo: vmware/harbor
|
||||
event: [push, tag, deployment]
|
||||
branch: [ master, release-*, refs/tags/* ]
|
||||
status: [ failure, success ]
|
||||
|
||||
trigger:
|
||||
image: plugins/downstream
|
||||
server: https://ci.vcna.io
|
||||
token: ${DOWNSTREAM_TOKEN}
|
||||
server: https://ci-vic.vmware.com
|
||||
secrets:
|
||||
- downstream_token
|
||||
fork: true
|
||||
repositories:
|
||||
- vmware/vic-product
|
||||
@ -58,4 +81,4 @@ pipeline:
|
||||
repo: vmware/harbor
|
||||
event: [ push, tag ]
|
||||
branch: [ master, release-*, refs/tags/* ]
|
||||
status: success
|
||||
status: success
|
@ -1 +0,0 @@
|
||||
eyJhbGciOiJIUzI1NiJ9.IyBIYXJib3IgZHJvbmUuCi0tLQp3b3Jrc3BhY2U6CiAgYmFzZTogL2Ryb25lCiAgcGF0aDogc3JjL2dpdGh1Yi5jb20vdm13YXJlL2hhcmJvcgoKcGlwZWxpbmU6CiAgY2xvbmU6CiAgICBpbWFnZTogcGx1Z2lucy9naXQKICAgIHRhZ3M6IHRydWUKICAgIHJlY3Vyc2l2ZTogZmFsc2UKCiAgdGVzdC1hbmQtaXNzdWUtYnVpbGQ6CiAgICBpbWFnZTogdm13YXJlL2hhcmJvci1lMmUtZW5naW5lOjEuMzkKICAgIHB1bGw6IHRydWUKICAgIHByaXZpbGVnZWQ6IHRydWUKICAgIGVudmlyb25tZW50OgogICAgICBCSU46IGJpbgogICAgICBHT1BBVEg6IC9kcm9uZQogICAgICBTSEVMTDogL2Jpbi9iYXNoCiAgICAgIExPR19URU1QX0RJUjogaW5zdGFsbC1sb2dzCiAgICAgIEdJVEhVQl9BVVRPTUFUSU9OX0FQSV9LRVk6ICAke0dJVEhVQl9BVVRPTUFUSU9OX0FQSV9LRVl9CiAgICAgIERST05FX1NFUlZFUjogICR7RFJPTkVfU0VSVkVSfQogICAgICBEUk9ORV9UT0tFTjogICR7RFJPTkVfVE9LRU5fSU5URX0KICAgICAgSEFSQk9SX0FETUlOOiAke0hBUkJPUl9BRE1JTn0KICAgICAgSEFSQk9SX1BBU1NXT1JEOiAke0hBUkJPUl9QQVNTV09SRH0KICAgICAgR1NfUFJPSkVDVF9JRDogJHtHU19QUk9KRUNUX0lEfQogICAgICBHU19DTElFTlRfRU1BSUw6ICR7R1NfQ0xJRU5UX0VNQUlMfQogICAgICBHU19QUklWQVRFX0tFWTogJHtHU19QUklWQVRFX0tFWX0KICAgICAgRE9NQUlOOiAke0NJX0RPTUFJTn0KICAgICAgTUFJTF9QV0Q6ICR7TUFJTF9QV0R9CiAgICAgIE5QTV9VU0VSTk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iAgICAgIGJyYW5jaDogWyBtYXN0ZXIsIHJlbGVhc2UtKiwgcmVmcy90YWdzLyogXQogICAgICBzdGF0dXM6IHN1Y2Nlc3MK.68mTlIe6uS8VE_gcZQGo4TIioZIgTuCsKudslpoM_r4
|
@ -28,7 +28,7 @@ export DRONE_TOKEN=$DRONE_TOKEN
|
||||
buildinfo=$(drone build info vmware/harbor $DRONE_BUILD_NUMBER)
|
||||
echo $buildinfo
|
||||
git_commit=$(git rev-parse --short=8 HEAD)
|
||||
if [ $DRONE_BUILD_EVENT == "tag" ]; then
|
||||
if [[ $DRONE_BUILD_EVENT == "tag" ]]; then
|
||||
build_number=$(git describe --abbrev=0 --tags)
|
||||
else
|
||||
build_number=$DRONE_BUILD_NUMBER-$git_commit
|
||||
@ -48,10 +48,10 @@ harbor_builds_bucket="harbor-builds"
|
||||
harbor_releases_bucket="harbor-releases"
|
||||
harbor_ci_pipeline_store_bucket="harbor-ci-pipeline-store/latest"
|
||||
harbor_target_bucket=""
|
||||
if [ $DRONE_BRANCH == "master" ]; then
|
||||
if [[ $DRONE_REPO_BRANCH == "master" ]]; then
|
||||
harbor_target_bucket=$harbor_builds_bucket
|
||||
else
|
||||
harbor_target_bucket=$harbor_releases_bucket/$DRONE_BRANCH
|
||||
harbor_target_bucket=$harbor_releases_bucket/$DRONE_REPO_BRANCH
|
||||
fi
|
||||
|
||||
# GC credentials
|
||||
@ -84,13 +84,13 @@ function package_offline_installer {
|
||||
}
|
||||
|
||||
## --------------------------------------------- Run Test Case ---------------------------------------------
|
||||
if [ $DRONE_REPO != "vmware/harbor" ]; then
|
||||
if [[ $DRONE_REPO != "vmware/harbor" ]]; then
|
||||
echo "Only run tests again Harbor Repo."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "--------------------------------------------------"
|
||||
echo "Running CI for $DRONE_BUILD_EVENT on $DRONE_BRANCH"
|
||||
echo "Running CI for $DRONE_BUILD_EVENT on $DRONE_REPO_BRANCH"
|
||||
echo "--------------------------------------------------"
|
||||
|
||||
##
|
||||
@ -98,7 +98,7 @@ echo "--------------------------------------------------"
|
||||
#
|
||||
# Put code here is because that it needs clean code to build installer.
|
||||
##
|
||||
if [[ $DRONE_BRANCH == "master" || $DRONE_BRANCH == *"refs/tags"* || $DRONE_BRANCH == "release-"* || $DRONE_BRANCH == "pks-"* ]]; then
|
||||
if [[ $DRONE_REPO_BRANCH == "master" || $DRONE_REPO_BRANCH == *"refs/tags"* || $DRONE_REPO_BRANCH == "release-"* || $DRONE_REPO_BRANCH == "pks-"* ]]; then
|
||||
if [[ $DRONE_BUILD_EVENT == "push" || $DRONE_BUILD_EVENT == "tag" ]]; then
|
||||
package_offline_installer
|
||||
upload_latest_build=true
|
||||
|
Loading…
Reference in New Issue
Block a user