78 Commits

Author SHA1 Message Date
Archit Mallik 51fa53e481 Create inputset event-Tag 2025-03-18 12:59:56 +05:30
Archit Mallik 7ffc0607b9 Create inputset event-Push 2025-03-18 12:59:14 +05:30
Archit Mallik 5ebf5a48ba Create inputset event-PR 2025-03-18 12:58:13 +05:30
Archit Mallik cac8af90fc Create pipeline drone-manifest-harness 2025-03-18 12:57:09 +05:30
TP Honey af5721dace remove extra copy Dockerfile.windows.ltsc2022 2023-04-25 14:14:00 +01:00
TP Honey 6d25397ccd Merge pull request #40 from drone-plugins/v2
Update plugin to new conventions
2023-04-25 13:42:24 +01:00
Don Olmstead f43d8309d5 Update plugin to new conventions
Instead of downloading and using the manifest tool mimic the behavior of the CLI commands used. This is now possible with the v2 of the manifest tool library which can be used in this manner.

Use the new coding conventions for the plugin.
2023-04-07 17:08:30 -07:00
TP Honey fbcb0e4798 Update .drone.yml 2022-12-16 15:37:58 +00:00
TP Honey 2e6d2280b4 Merge pull request #38 from tphoney/update_sprig
(maint) update to latest drone-template-lib and sprig v3
2022-12-16 15:03:53 +00:00
TP Honey cf7ba4606c (maint) update to latest drone-template-lib and sprig v3 2022-12-16 14:59:38 +00:00
TP Honey 416c6f2cba Merge pull request #37 from tphoney/windows_docker
(maint) fix windows docker files
2022-12-16 13:28:25 +00:00
TP Honey 2a9bc706ac Merge branch 'master' into windows_docker 2022-12-16 13:28:17 +00:00
TP Honey ec2669aa2d (maint) fix windows docker files 2022-12-16 13:24:19 +00:00
TP Honey 79f39c58d3 Merge pull request #36 from tphoney/windows_dockerfile
update manifest version
2022-12-16 11:27:27 +00:00
TP Honey 8eeefa8592 update manifest version 2022-12-16 11:09:03 +00:00
TP Honey c7afa18a9f Merge pull request #35 from tphoney/harness_move
(maint) move to harness.drone.io
2022-12-16 10:45:46 +00:00
TP Honey c51e841585 (maint) move to harness.drone.io 2022-12-16 10:19:14 +00:00
Don 92722b712a Merge pull request #30 from luthermonson/tool-v1.0.2
upgrading to manifest-tool 1.0.2
2020-05-28 07:36:19 -07:00
Luther b3f7912112 upgrading to manifest-tool 1.0.2 2020-05-27 12:08:04 -07:00
Thomas Boerger 2fe5f563a3 Merge pull request #28 from sh0rez/master
feat: allow to pass spec inline
2020-01-06 20:40:28 +01:00
Thomas Boerger 53c0cbbcef Merge branch 'master' into master 2020-01-06 20:37:35 +01:00
Thomas Boerger 2b1f33534d Merge pull request #29 from c0va23/feature/insecure-registry
Allow insecure and/or anonymous registry
2019-11-26 13:06:30 +01:00
Dmitrij Fedorenko 82ade6b5aa Allow anonymous access to registry 2019-11-26 08:33:10 +03:00
Dmitrij Fedorenko fe8c467e70 Add setting "insecure" 2019-11-26 08:29:56 +03:00
Dmitrij Fedorenko b2ea804f53 Upgrade manifest tools 1.0.0 2019-11-26 08:29:56 +03:00
Dmitrij Fedorenko 4bae79aec2 Upgrade alpine to 3.10 2019-11-23 21:45:27 +03:00
Brad Rydzewski 4a15a55224 enable auto tagging 2019-08-22 14:09:26 -07:00
Brad Rydzewski fbe23cbcec option to dump spec file to debug 2019-08-22 13:54:15 -07:00
Brad Rydzewski 3f387227b5 bump template lib and fix manifest trimPrefix 2019-08-22 13:16:53 -07:00
Brad Rydzewski bd53675813 remove microbadger [ci skip] 2019-08-22 13:04:41 -07:00
Brad Rydzewski 3091c4a002 update manifest template 2019-08-22 13:02:25 -07:00
sh0rez 35d6bee743 feat: allow to pass spec inline
This allows to pass the contents from `spec` directly from `drone.yml`, for use
with autogenerated drone configurations.
2019-08-14 16:40:13 +02:00
Thomas Boerger f92bc07dad Merge pull request #26 from deitch/fix-push-args
add from-args
2019-06-21 09:20:18 +02:00
Avi Deitcher 5b15413fc2 add from-args 2019-06-06 14:34:53 +03:00
Don af2017d35c Fix 1803 image 2019-04-25 17:58:29 -07:00
Don 5e8ab59d01 Use base again 2019-04-25 17:55:08 -07:00
Don 18cf775bd3 Fix Tls for Github 2019-04-25 17:31:35 -07:00
Don aaa402cdff Modify shell 2019-04-25 17:19:11 -07:00
Don bed8b9a1b2 Try servercore 2019-04-25 17:11:26 -07:00
Don e957ab3e04 Use 1809 for testing on windows 2019-04-25 16:46:56 -07:00
Don b548a9c07b Update windows build 2019-04-25 16:45:09 -07:00
Thomas Boerger a9899d8548 Merge pull request #22 from drone-plugins/improve-config
Drop renovate, proper version definition, unified jsonnet config
2019-02-19 11:34:48 +01:00
Thomas Boerger 3c0ccca611 Use new template lib, fix manifest 2019-02-19 11:33:06 +01:00
Thomas Boerger 8ed1b321f5 Drop import of unused fmt package 2019-02-18 23:47:41 +01:00
Thomas Boerger f976bb1992 Unified documentation and readme 2019-02-15 11:58:33 +01:00
Thomas Boerger 99d6654f37 Add a reliable version and integrate libsonnet definition 2019-02-15 10:24:13 +01:00
Thomas Boerger 0a2a640285 Drop renovate config, it is simply too noisy 2019-02-14 20:14:11 +01:00
Thomas Boerger 597acafbf7 Merge pull request #20 from appleboy/patch
feat(version): support 18.06.0 tag format
2019-02-12 15:01:41 +01:00
Bo-Yi Wu c2ba435fb8 feat(version): support 18.06.0 tag format 2019-02-12 18:42:32 +08:00
Thomas Boerger 7210ab5c16 Merge pull request #19 from drone-plugins/windows-dockerfiles
Add Windows Dockerfiles
2019-01-25 19:01:10 +01:00
Don 8b07050495 Use drive letters consistently 2019-01-25 09:45:05 -08:00
Don 120230dbd9 Add Windows Dockerfiles 2019-01-24 18:37:55 -08:00
Thomas Boerger 3b67f54e06 Merge pull request #18 from drone-plugins/upgrade-drone
Upgrade and switch to Drone 1.0.0
2019-01-23 11:06:39 +01:00
Thomas Boerger 14a12e1a63 Execute built binary as simple test 2019-01-22 23:12:20 +01:00
Thomas Boerger 74fe6c5c18 Add some basic issue template content 2019-01-21 21:02:09 +01:00
Thomas Boerger c9b38a9b94 Add probot settings config 2019-01-21 20:58:22 +01:00
Thomas Boerger d6a5823d13 Remove duplicated badge 2019-01-21 09:31:55 +01:00
Thomas Boerger 01a15fc1d3 Fix duplicated step names 2019-01-21 01:13:08 +01:00
Thomas Boerger 936bc709d6 Update badges within readme 2019-01-21 00:19:16 +01:00
Thomas Boerger 10252045dc Migrate configs to drone 1.0.0 and drop appveyor 2019-01-20 23:52:00 +01:00
Thomas Boerger 3490c0600d Add manifest template to docker folder 2019-01-20 22:21:25 +01:00
Thomas Boerger 7e39103352 Move dockerfiles to docker folder 2019-01-20 22:20:03 +01:00
renovate[bot] 0474975306 chore(deps): update module pkg/errors to v0.8.1 (#15)
This PR contains the following updates:

| Package | Type | Update | Change | References |
|---|---|---|---|---|
| github.com/pkg/errors | require | patch | `v0.8.0` -> `v0.8.1` | [source](https://togithub.com/pkg/errors) |

---

### Release Notes

<details>
<summary>pkg/errors</summary>

### [`v0.8.1`](https://togithub.com/pkg/errors/releases/v0.8.1)

[Compare Source](https://togithub.com/pkg/errors/compare/v0.8.0...v0.8.1)

pkg/errors 0.8.1 is a bug fix release for errors 0.8.0. It will be the last version to support Go 1.8 and below. pkg/errors 0.9 and above will require Go 1.9 for the new `runtime.CallersFrames` API.

pkg/errors 0.8.1 also adds one new feature, `errors.WithMessagef`. Ideally this would be held over til 0.9, but that complicates the switch to `runtime.CallersFrames`.

### Improvements

-   Added `errors.WithMessagef`. Thanks [@&#8203;chemicL](https://togithub.com/chemicL).

### Bugs fixed

-   `.travis.yml`. Adjust Go versions. Thanks [@&#8203;AlekSi](https://togithub.com/AlekSi), [@&#8203;dvrkps](https://togithub.com/dvrkps), [@&#8203;HaraldNordgren](https://togithub.com/HaraldNordgren), and [@&#8203;komuw](https://togithub.com/komuw) 
-   Fixed gofmt. Thanks [@&#8203;tariq1890](https://togithub.com/tariq1890) 
-   Copyedit the package documentation. Thanks [@&#8203;seh](https://togithub.com/seh), [@&#8203;TomSweeneyRedHat](https://togithub.com/TomSweeneyRedHat), [@&#8203;nicksnyder](https://togithub.com/nicksnyder), and [@&#8203;beono](https://togithub.com/beono) 
-   Remove unreachable code. Thanks [@&#8203;philoserf](https://togithub.com/philoserf) and [@&#8203;haya14busa](https://togithub.com/haya14busa) 
-   Move benchmark error sink to global variable. Thanks [@&#8203;bradleyfalzon](https://togithub.com/bradleyfalzon) 
-   Fix minor newline consistency issues in test files. Thanks [@&#8203;nmiyake](https://togithub.com/nmiyake) 
-   Add doc comment for exported Format func. Thanks [@&#8203;mrhwick](https://togithub.com/mrhwick) and [@&#8203;ihrwein](https://togithub.com/ihrwein)

</details>

---

### Renovate configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻️ **Rebasing**: Whenever PR becomes conflicted, or if you modify the PR title to begin with "`rebase!`".

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- renovate-rebase -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://togithub.com/marketplace/renovate). View repository job log [here](https://renovatebot.com/dashboard#drone-plugins/drone-manifest).
2019-01-20 00:17:28 +08:00
Thomas Boerger 6c39a668da Merge pull request #12 from drone-plugins/renovate/configure
Configure Renovate
2019-01-19 11:58:14 +01:00
Thomas Boerger f311aa4112 Update renovate.json 2019-01-19 11:02:07 +01:00
Renovate Bot 1375e1d81a Add renovate.json 2019-01-19 02:57:16 +00:00
Bo-Yi Wu 9db5d7d3b3 feat(vendor): switch dep to go module (#11)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2019-01-11 11:49:20 +08:00
Thomas Boerger 5e6f1d304f Merge pull request #8 from drone-plugins/simplify-and-fix
Read spec and drop command package
2018-10-21 17:13:22 +02:00
Thomas Boerger ce1bc302b6 Merge branch 'master' into simplify-and-fix 2018-10-19 09:29:28 +02:00
Bo-Yi Wu c557b76905 update golang to 1.11 (#9) 2018-09-24 15:17:18 +08:00
Thomas Boerger ce5f88637a Updated dependencies 2018-09-23 21:40:21 +02:00
Thomas Boerger 8cd76befa0 Read spec and drop command package 2018-09-23 21:40:21 +02:00
Thomas Boerger f58ce02997 Merge pull request #7 from drone-plugins/appleboy-patch-1
Provide a password using STDIN
2018-09-22 19:22:53 +02:00
Bo-Yi Wu 0659f84908 Provide a password using STDIN 2018-06-30 20:55:44 +08:00
Thomas Boerger 98a19daff5 Merge pull request #6 from drone-plugins/template-lib
Use new template lib
2018-04-25 07:22:59 +02:00
Thomas Boerger 09b2a0b327 Print out dep status 2018-04-22 09:58:25 +02:00
Thomas Boerger 46a67c3a0c Use new template lib 2018-04-15 01:31:57 +02:00
Thomas Boerger d5e2e58801 Dropped unused struct 2018-04-15 01:26:08 +02:00
33 changed files with 1660 additions and 972 deletions
-68
View File
@@ -1,68 +0,0 @@
version: '{build}'
image: 'Visual Studio 2017'
platform: 'x64'
clone_folder: 'c:\gopath\src\github.com\drone-plugins\drone-manifest'
max_jobs: 1
environment:
GOPATH: c:\gopath
DOCKER_USERNAME:
secure: '4YzzahbEiMZQJpOCOd1LAw=='
DOCKER_PASSWORD:
secure: 'VqO/G3Zfslu6zSLdwHKO+Q=='
install:
- ps: |
docker version
go version
- ps: |
$env:Path = "c:\gopath\bin;$env:Path"
build_script:
- ps: |
go get -u github.com/golang/dep/cmd/dep
dep ensure
if ( $env:APPVEYOR_REPO_TAG -eq 'false' ) {
go build -ldflags "-X main.build=$env:APPVEYOR_BUILD_VERSION" -a -o release/drone-manifest.exe
} else {
$version = $env:APPVEYOR_REPO_TAG_NAME.substring(1)
go build -ldflags "-X main.version=$version -X main.build=$env:APPVEYOR_BUILD_VERSION" -a -o release/drone-manifest.exe
}
docker pull microsoft/nanoserver:10.0.14393.1593
docker build -f Dockerfile.windows -t plugins/manifest:windows-amd64 .
test_script:
- ps: |
docker run --rm plugins/manifest:windows-amd64 --version
deploy_script:
- ps: |
$ErrorActionPreference = 'Stop';
if ( $env:APPVEYOR_PULL_REQUEST_NUMBER ) {
Write-Host Nothing to deploy.
} else {
docker login --username $env:DOCKER_USERNAME --password $env:DOCKER_PASSWORD
if ( $env:APPVEYOR_REPO_TAG -eq 'true' ) {
$major,$minor,$patch = $env:APPVEYOR_REPO_TAG_NAME.substring(1).split('.')
docker push plugins/manifest:windows-amd64
docker tag plugins/manifest:windows-amd64 plugins/manifest:$major.$minor.$patch-windows-amd64
docker push plugins/manifest:$major.$minor.$patch-windows-amd64
docker tag plugins/manifest:windows-amd64 plugins/manifest:$major.$minor-windows-amd64
docker push plugins/manifest:$major.$minor-windows-amd64
docker tag plugins/manifest:windows-amd64 plugins/manifest:$major-windows-amd64
docker push plugins/manifest:$major-windows-amd64
} else {
if ( $env:APPVEYOR_REPO_BRANCH -eq 'master' ) {
docker push plugins/manifest:windows-amd64
}
}
}
+260 -126
View File
@@ -1,148 +1,282 @@
workspace:
base: /go
path: src/github.com/drone-plugins/drone-manifest
kind: pipeline
type: vm
name: testing
platform:
os: linux
arch: amd64
pool:
use: ubuntu
pipeline:
deps:
image: golang:1.10
pull: true
steps:
- name: lint
image: golang:1.20
pull: always
commands:
- go get -u github.com/golang/dep/cmd/dep
- dep ensure
test:
image: golang:1.10
pull: true
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- golangci-lint version
- golangci-lint run
volumes:
- name: gopath
path: "/go"
- name: test
image: golang:1.20
commands:
- go vet ./...
- go test -cover ./...
volumes:
- name: gopath
path: "/go"
volumes:
- name: gopath
temp: {}
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
build_linux_amd64:
image: golang:1.10
pull: true
group: build
---
kind: pipeline
type: vm
name: linux-amd64
platform:
os: linux
arch: amd64
pool:
use: ubuntu
steps:
- name: environment
image: golang:1.20
pull: always
environment:
- GOOS=linux
- GOARCH=amd64
- CGO_ENABLED=0
CGO_ENABLED: "0"
commands:
- |
if test "${DRONE_TAG}" = ""; then
go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/drone-manifest
else
go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/drone-manifest
fi
build_linux_i386:
image: golang:1.10
pull: true
group: build
- go version
- go env
- name: build
image: golang:1.20
environment:
- GOOS=linux
- GOARCH=386
- CGO_ENABLED=0
CGO_ENABLED: "0"
commands:
- |
if test "${DRONE_TAG}" = ""; then
go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/i386/drone-manifest
else
go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/i386/drone-manifest
fi
- go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/amd64/drone-manifest .
- name: docker
image: plugins/docker
settings:
dockerfile: docker/Dockerfile.linux.amd64
repo: plugins/manifest
username:
from_secret: docker_username
password:
from_secret: docker_password
auto_tag: true
auto_tag_suffix: linux-amd64
when:
ref:
- refs/heads/master
- refs/tags/**
- name: docker-dry-run
image: plugins/docker
settings:
dockerfile: docker/Dockerfile.linux.amd64
repo: plugins/manifest
dry_run: true
tags: linux-amd64
when:
ref:
- refs/pull/**
depends_on:
- testing
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
build_linux_arm64:
image: golang:1.10
pull: true
group: build
---
kind: pipeline
type: vm
name: linux-arm64
platform:
os: linux
arch: arm64
pool:
use: ubuntu_arm64
steps:
- name: environment
image: golang:1.20
pull: always
environment:
- GOOS=linux
- GOARCH=arm64
- CGO_ENABLED=0
CGO_ENABLED: "0"
commands:
- |
if test "${DRONE_TAG}" = ""; then
go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/drone-manifest
else
go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/drone-manifest
fi
build_linux_arm:
image: golang:1.10
pull: true
group: build
- go version
- go env
- name: build
image: golang:1.20
environment:
- GOOS=linux
- GOARCH=arm
- CGO_ENABLED=0
- GOARM=7
CGO_ENABLED: "0"
commands:
- |
if test "${DRONE_TAG}" = ""; then
go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/drone-manifest
else
go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/drone-manifest
fi
publish_linux_amd64:
image: plugins/docker:17.12
pull: true
secrets: [ docker_username, docker_password ]
group: docker
repo: plugins/manifest
auto_tag: true
auto_tag_suffix: linux-amd64
dockerfile: Dockerfile
- go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/arm64/drone-manifest .
- name: docker
image: plugins/docker
settings:
dockerfile: docker/Dockerfile.linux.arm64
repo: plugins/manifest
username:
from_secret: docker_username
password:
from_secret: docker_password
auto_tag: true
auto_tag_suffix: linux-arm64
when:
event: [ push, tag ]
publish_linux_i386:
image: plugins/docker:17.12
pull: true
secrets: [ docker_username, docker_password ]
group: docker
repo: plugins/manifest
auto_tag: true
auto_tag_suffix: linux-i386
dockerfile: Dockerfile.i386
ref:
- refs/heads/master
- refs/tags/**
- name: docker-dry-run
image: plugins/docker
settings:
dockerfile: docker/Dockerfile.linux.arm64
repo: plugins/manifest
dry_run: true
tags: linux-arm64
when:
event: [ push, tag ]
ref:
- refs/pull/**
depends_on:
- testing
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
publish_linux_arm64:
image: plugins/docker:17.12
pull: true
secrets: [ docker_username, docker_password ]
group: docker
repo: plugins/manifest
auto_tag: true
auto_tag_suffix: linux-arm64
dockerfile: Dockerfile.arm64
when:
event: [ push, tag ]
---
kind: pipeline
type: vm
name: windows-1809
platform:
os: windows
arch: amd64
pool:
use: windows
publish_linux_arm:
image: plugins/docker:17.12
pull: true
secrets: [ docker_username, docker_password ]
group: docker
repo: plugins/manifest
auto_tag: true
auto_tag_suffix: linux-arm
dockerfile: Dockerfile.arm
steps:
- name: environment
image: golang:1.20
pull: always
environment:
CGO_ENABLED: "0"
commands:
- go version
- go env
- name: build
image: golang:1.20
environment:
CGO_ENABLED: "0"
commands:
- go build -v -ldflags "-X main.version=" -a -tags netgo -o release/windows/amd64/drone-manifest.exe .
- name: docker
image: plugins/docker
settings:
dockerfile: docker/Dockerfile.windows.1809
repo: plugins/manifest
username:
from_secret: docker_username
password:
from_secret: docker_password
auto_tag: true
auto_tag_suffix: windows-1809-amd64
daemon_off: true
purge: false
when:
event: [ push, tag ]
ref:
- refs/heads/master
- refs/tags/**
depends_on:
- testing
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
manifests:
image: plugins/manifest:1
pull: true
secrets: [ docker_username, docker_password ]
spec: manifest.tmpl
auto_tag: true
ignore_missing: true
when:
event: [ push, tag ]
---
kind: pipeline
type: vm
name: windows-ltsc2022
platform:
os: windows
arch: amd64
pool:
use: windows-2022
microbadger:
image: plugins/webhook:1
pull: true
secrets: [ webhook_url ]
steps:
- name: environment
image: golang:1.20
pull: always
environment:
CGO_ENABLED: "0"
commands:
- go version
- go env
- name: build
image: golang:1.20
environment:
CGO_ENABLED: "0"
commands:
- go build -v -ldflags "-X main.version=" -a -tags netgo -o release/windows/amd64/drone-manifest.exe .
- name: docker
image: plugins/docker
settings:
dockerfile: docker/Dockerfile.windows.ltsc2022
repo: plugins/manifest
username:
from_secret: docker_username
password:
from_secret: docker_password
auto_tag: true
auto_tag_suffix: windows-ltsc2022-amd64
daemon_off: true
purge: false
when:
status: [ success ]
ref:
- refs/heads/master
- refs/tags/**
depends_on:
- testing
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
---
kind: pipeline
type: vm
name: manifest
platform:
os: linux
arch: amd64
pool:
use: ubuntu
steps:
- name: manifest
image: plugins/manifest:linux-amd64
settings:
auto_tag: "true"
username:
from_secret: docker_username
password:
from_secret: docker_password
spec: docker/manifest.tmpl
ignore_missing: true
depends_on:
- linux-amd64
- linux-arm64
- windows-1809
- windows-ltsc2022
trigger:
ref:
- refs/heads/master
- refs/tags/**
+9
View File
@@ -0,0 +1,9 @@
<!-- PLEASE READ BEFORE DELETING
Bugs or Issues? Due to the high number of false positive issues we receive,
please do not create a GitHub issue until you have discussed and verified
with community support at:
https://discourse.drone.io/
-->
+73
View File
@@ -0,0 +1,73 @@
repository:
name: drone-manifest
description: Drone plugin to push Docker manifests
homepage: http://plugins.drone.io/drone-plugins/drone-manifest
topics: drone, drone-plugin
private: false
has_issues: true
has_wiki: false
has_downloads: false
default_branch: master
allow_squash_merge: true
allow_merge_commit: true
allow_rebase_merge: true
labels:
- name: bug
color: d73a4a
description: Something isn't working
- name: duplicate
color: cfd3d7
description: This issue or pull request already exists
- name: enhancement
color: a2eeef
description: New feature or request
- name: good first issue
color: 7057ff
description: Good for newcomers
- name: help wanted
color: 008672
description: Extra attention is needed
- name: invalid
color: e4e669
description: This doesn't seem right
- name: question
color: d876e3
description: Further information is requested
- name: renovate
color: e99695
description: Automated action from Renovate
- name: wontfix
color: ffffff
description: This will not be worked on
teams:
- name: Admins
permission: admin
- name: Captain
permission: admin
- name: Maintainers
permission: push
branches:
- name: master
protection:
required_pull_request_reviews:
required_approving_review_count: 1
dismiss_stale_reviews: false
require_code_owner_reviews: false
dismissal_restrictions:
teams:
- Admins
- Captain
required_status_checks:
strict: true
contexts:
- continuous-integration/drone/pr
enforce_admins: false
restrictions:
users: []
teams: []
+14
View File
@@ -0,0 +1,14 @@
inputSet:
name: event-PR
identifier: eventPR
orgIdentifier: default
projectIdentifier: Drone_Plugins
pipeline:
identifier: dronemanifestharness
properties:
ci:
codebase:
build:
type: PR
spec:
number: <+trigger.prNumber>
+14
View File
@@ -0,0 +1,14 @@
inputSet:
name: event-Push
identifier: eventPush
orgIdentifier: default
projectIdentifier: Drone_Plugins
pipeline:
identifier: dronemanifestharness
properties:
ci:
codebase:
build:
type: branch
spec:
branch: <+trigger.branch>
+14
View File
@@ -0,0 +1,14 @@
inputSet:
name: event-Tag
identifier: eventTag
orgIdentifier: default
projectIdentifier: Drone_Plugins
pipeline:
identifier: dronemanifestharness
properties:
ci:
codebase:
build:
type: tag
spec:
tag: <+trigger.tag>
+383
View File
@@ -0,0 +1,383 @@
pipeline:
name: drone-manifest-harness
identifier: dronemanifestharness
projectIdentifier: Drone_Plugins
orgIdentifier: default
tags: {}
properties:
ci:
codebase:
connectorRef: GitHub_Drone_Plugins_Org
repoName: drone-manifest
build: <+input>
sparseCheckout: []
stages:
- stage:
name: Testing Stage
identifier: Testing_Stage
type: CI
spec:
cloneCodebase: true
caching:
enabled: false
paths: []
platform:
os: Linux
arch: Amd64
runtime:
type: Cloud
spec: {}
execution:
steps:
- step:
type: Run
name: Lint
identifier: Lint
spec:
connectorRef: Plugins_Docker_Hub_Connector
image: golang:1.20
shell: Sh
command: |-
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint version
golangci-lint run
- step:
type: Run
name: Test
identifier: Run_1
spec:
connectorRef: Plugins_Docker_Hub_Connector
image: golang:1.20
shell: Sh
command: go test -cover ./...
description: ""
- parallel:
- stage:
name: linux-amd64
identifier: linuxamd64
type: CI
spec:
cloneCodebase: true
caching:
enabled: false
paths: []
platform:
os: Linux
arch: Amd64
runtime:
type: Cloud
spec: {}
execution:
steps:
- step:
name: Build binaries
identifier: Build_binaries
type: Run
spec:
connectorRef: Plugins_Docker_Hub_Connector
image: golang:1.20
shell: Sh
command: |-
# force go modules
export GOPATH=""
# disable cgo
export CGO_ENABLED=0
set -e
set -x
# linux
export GOOS=linux GOARCH=amd64
go build -v -a -tags netgo -o release/linux/amd64/drone-manifest .
when:
stageStatus: Success
- step:
type: Plugin
name: BuildAndPushDockerPlugin
identifier: BuildAndPushDockerPlugin
spec:
connectorRef: Plugins_Docker_Hub_Connector
image: plugins/docker
settings:
username: drone
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
repo: plugins/manifest
dockerfile: docker/Dockerfile.linux.amd64
auto_tag: "true"
auto_tag_suffix: linux-amd64
when:
stageStatus: Success
condition: <+codebase.build.type> == "tag"
- step:
type: BuildAndPushDockerRegistry
name: BuildAndPushDockerRegistry
identifier: BuildAndPushDockerRegistry
spec:
connectorRef: Plugins_Docker_Hub_Connector
repo: plugins/manifest
tags:
- linux-amd64
caching: false
dockerfile: docker/Dockerfile.linux.amd64
when:
stageStatus: Success
condition: |
<+codebase.build.type> == "branch"
description: ""
- stage:
name: linux-arm64
identifier: linuxarm64
type: CI
spec:
cloneCodebase: true
caching:
enabled: false
paths: []
platform:
os: Linux
arch: Arm64
runtime:
type: Cloud
spec: {}
execution:
steps:
- step:
name: Build binaries
identifier: Build_binaries
type: Run
spec:
connectorRef: Plugins_Docker_Hub_Connector
image: golang:1.20
shell: Sh
command: |-
# force go modules
export GOPATH=""
# disable cgo
export CGO_ENABLED=0
set -e
set -x
# linux
export GOOS=linux GOARCH=arm64
go build -v -a -tags netgo -o release/linux/arm64/drone-manifest .
when:
stageStatus: Success
- step:
type: Plugin
name: BuildAndPushDockerPlugin
identifier: BuildAndPushDockerPlugin
spec:
connectorRef: Plugins_Docker_Hub_Connector
image: plugins/docker
settings:
username: drone
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
repo: plugins/manifest
dockerfile: docker/Dockerfile.linux.arm64
auto_tag: "true"
auto_tag_suffix: linux-arm64
when:
stageStatus: Success
condition: <+codebase.build.type> == "tag"
- step:
type: BuildAndPushDockerRegistry
name: BuildAndPushDockerRegistry
identifier: BuildAndPushDockerRegistry
spec:
connectorRef: Plugins_Docker_Hub_Connector
repo: plugins/manifest
tags:
- linux-arm64
caching: false
dockerfile: docker/Dockerfile.linux.arm64
when:
stageStatus: Success
condition: |
<+codebase.build.type> == "branch"
description: ""
- stage:
name: windows-1809-amd64
identifier: windows1809amd64
type: CI
spec:
cloneCodebase: true
caching:
enabled: false
paths: []
execution:
steps:
- step:
name: Build binaries
identifier: Build_binaries
type: Run
spec:
connectorRef: Plugins_Docker_Hub_Connector
image: golang:1.20
shell: Sh
command: |-
# force go modules
export GOPATH=""
# disable cgo
export CGO_ENABLED=0
set -e
set -x
# Windows
GOOS=windows
go build -v -a -tags netgo -o release/windows/amd64/drone-manifest.exe .
when:
stageStatus: Success
- step:
type: Plugin
name: BuildAndPushDockerPlugin
identifier: BuildAndPushDockerPlugin
spec:
connectorRef: Plugins_Docker_Hub_Connector
image: plugins/docker
settings:
username: drone
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
repo: plugins/manifest
dockerfile: docker/Dockerfile.windows.1809
auto_tag: "true"
auto_tag_suffix: windows-1809-amd64
when:
stageStatus: Success
condition: <+codebase.build.type> == "tag"
- step:
type: BuildAndPushDockerRegistry
name: BuildAndPushDockerRegistry
identifier: BuildAndPushDockerRegistry
spec:
connectorRef: Plugins_Docker_Hub_Connector
repo: plugins/manifest
tags:
- windows-1809-amd64
caching: false
dockerfile: docker/Dockerfile.windows.1809
when:
stageStatus: Success
condition: |
<+codebase.build.type> == "branch"
infrastructure:
type: VM
spec:
type: Pool
spec:
poolName: windows-2019
os: Windows
description: ""
delegateSelectors:
- windows-vm
- stage:
name: windows-ltsc2022-amd64
identifier: windowsltsc2022amd64
type: CI
spec:
cloneCodebase: true
caching:
enabled: false
paths: []
platform:
os: Windows
arch: Amd64
runtime:
type: Cloud
spec: {}
execution:
steps:
- step:
name: Build binaries
identifier: Build_binaries
type: Run
spec:
connectorRef: Plugins_Docker_Hub_Connector
image: golang:1.20
shell: Sh
command: |-
# force go modules
export GOPATH=""
# disable cgo
export CGO_ENABLED=0
set -e
set -x
# Windows
GOOS=windows
go build -v -a -tags netgo -o release/windows/amd64/drone-manifest.exe .
- step:
type: Plugin
name: BuildAndPushDockerPlugin
identifier: BuildAndPushDockerPlugin
spec:
connectorRef: Plugins_Docker_Hub_Connector
image: plugins/docker
settings:
username: drone
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
repo: plugins/manifest
dockerfile: docker/Dockerfile.windows.ltsc2022
auto_tag: "true"
auto_tag_suffix: windows-ltsc2022-amd64
when:
stageStatus: Success
condition: <+codebase.build.type> == "tag"
- step:
type: BuildAndPushDockerRegistry
name: BuildAndPushDockerRegistry
identifier: BuildAndPushDockerRegistry
spec:
connectorRef: Plugins_Docker_Hub_Connector
repo: plugins/manifest
tags:
- windows-ltsc2022-amd64
caching: false
dockerfile: docker/Dockerfile.windows.ltsc2022
when:
stageStatus: Success
condition: |
<+codebase.build.type> == "branch"
description: ""
- stage:
name: Manifest
identifier: Manifest
type: CI
spec:
cloneCodebase: true
caching:
enabled: false
paths: []
platform:
os: Linux
arch: Amd64
runtime:
type: Cloud
spec: {}
execution:
steps:
- step:
type: Plugin
name: Manifest
identifier: Manifest
spec:
connectorRef: Plugins_Docker_Hub_Connector
image: plugins/manifest
settings:
username: drone
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
auto_tag: "true"
ignore_missing: "true"
spec: docker/manifest.tmpl
when:
stageStatus: Success
condition: |
<+codebase.build.type> == "tag" || <+codebase.build.type> == "branch"
description: ""
allowStageExecutions: true
-17
View File
@@ -1,17 +0,0 @@
FROM alpine:3.6 as base
RUN apk add --no-cache curl && \
curl -sSLo /bin/manifest-tool https://github.com/estesp/manifest-tool/releases/download/v0.7.0/manifest-tool-linux-armv7 && \
chmod +x /bin/manifest-tool
FROM plugins/base:multiarch
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \
org.label-schema.name="Drone Manifest" \
org.label-schema.vendor="Drone.IO Community" \
org.label-schema.schema-version="1.0"
COPY --from=base /bin/manifest-tool /bin/
ADD release/linux/arm/drone-manifest /bin/
ENTRYPOINT ["/bin/drone-manifest"]
-17
View File
@@ -1,17 +0,0 @@
FROM alpine:3.6 as base
RUN apk add --no-cache curl && \
curl -sSLo /bin/manifest-tool https://github.com/estesp/manifest-tool/releases/download/v0.7.0/manifest-tool-linux-386 && \
chmod +x /bin/manifest-tool
FROM plugins/base:multiarch
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \
org.label-schema.name="Drone Manifest" \
org.label-schema.vendor="Drone.IO Community" \
org.label-schema.schema-version="1.0"
COPY --from=base /bin/manifest-tool /bin/
ADD release/linux/i386/drone-manifest /bin/
ENTRYPOINT ["/bin/drone-manifest"]
-14
View File
@@ -1,14 +0,0 @@
# escape=`
FROM microsoft/nanoserver:10.0.14393.1593
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
org.label-schema.name="Drone Manifest" `
org.label-schema.vendor="Drone.IO Community" `
org.label-schema.schema-version="1.0"
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Invoke-WebRequest 'https://github.com/estesp/manifest-tool/releases/download/v0.7.0/manifest-tool-windows-amd64.exe' -OutFile 'c:\Windows\System32\manifest-tool.exe';
ADD release\drone-manifest.exe c:\drone-manifest.exe
ENTRYPOINT [ "c:\\drone-manifest.exe" ]
Generated
-33
View File
@@ -1,33 +0,0 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/aymerick/raymond"
packages = [".","ast","lexer","parser"]
revision = "a2232af10b53ef1ae5a767f5178db3a6c1dab655"
version = "v2.0.1"
[[projects]]
name = "github.com/coreos/go-semver"
packages = ["semver"]
revision = "8ab6407b697782a06568d4b7f1db25550ec2e4c6"
version = "v0.2.0"
[[projects]]
name = "github.com/pkg/errors"
packages = ["."]
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
version = "v0.8.0"
[[projects]]
branch = "master"
name = "github.com/urfave/cli"
packages = ["."]
revision = "75104e932ac2ddb944a6ea19d9f9f26316ff1145"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "a89f1c3cf068c93fd8bf83840a119df2915c502193ca71a2b5ae4b6a6cfa4d70"
solver-name = "gps-cdcl"
solver-version = 1
-15
View File
@@ -1,15 +0,0 @@
[[constraint]]
name = "github.com/aymerick/raymond"
version = "2.0.1"
[[constraint]]
name = "github.com/coreos/go-semver"
version = "0.2.0"
[[constraint]]
name = "github.com/pkg/errors"
version = "0.8.0"
[[constraint]]
branch = "master"
name = "github.com/urfave/cli"
+18 -12
View File
@@ -1,34 +1,40 @@
# drone-manifest
[![Build Status](http://beta.drone.io/api/badges/drone-plugins/drone-manifest/status.svg)](http://beta.drone.io/drone-plugins/drone-manifest)
[![Join the discussion at https://discourse.drone.io](https://img.shields.io/badge/discourse-forum-orange.svg)](https://discourse.drone.io)
[![Build Status](http://harness.drone.io/api/badges/drone-plugins/drone-manifest/status.svg)](http://harness.drone.io/drone-plugins/drone-manifest)
[![Slack](https://img.shields.io/badge/slack-drone-orange.svg?logo=slack)](https://join.slack.com/t/harnesscommunity/shared_invite/zt-y4hdqh7p-RVuEQyIl5Hcx4Ck8VCvzBw)
[![Join the discussion at https://community.harness.io](https://img.shields.io/badge/discourse-forum-orange.svg)](https://community.harness.io)
[![Drone questions at https://stackoverflow.com](https://img.shields.io/badge/drone-stackoverflow-orange.svg)](https://stackoverflow.com/questions/tagged/drone.io)
[![Go Doc](https://godoc.org/github.com/drone-plugins/drone-manifest?status.svg)](http://godoc.org/github.com/drone-plugins/drone-manifest)
[![Go Report](https://goreportcard.com/badge/github.com/drone-plugins/drone-manifest)](https://goreportcard.com/report/github.com/drone-plugins/drone-manifest)
[![](https://images.microbadger.com/badges/image/plugins/manifest.svg)](https://microbadger.com/images/plugins/manifest "Get your own image badge on microbadger.com")
Drone plugin to push Docker manifest to a registry for multi-architecture mappings. For the usage information and a listing of the available options please take a look at [the docs](http://plugins.drone.io/drone-plugins/drone-manifest/).
## Build
Build the binary with the following commands:
Build the binary with the following command:
```
go build
```console
export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
go build -v -a -tags netgo -o release/linux/amd64/drone-manifest
```
## Docker
Build the Docker image with the following commands:
Build the Docker image with the following command:
```
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo -o release/linux/amd64/drone-manifest
docker build --rm -t plugins/manifest .
```console
docker build \
--label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
--label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \
--file docker/Dockerfile.linux.amd64 --tag plugins/manifest .
```
### Usage
## Usage
```
```console
docker run --rm \
-e PLUGIN_PLATFORMS=linux/amd64,linux/arm,linux/arm64 \
-e PLUGIN_TEMPLATE=organization/project-ARCH:1.0.0 \
-102
View File
@@ -1,102 +0,0 @@
package command
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"strings"
"github.com/pkg/errors"
)
type Command struct {
username string
password string
spec string
platforms []string
target string
template string
path string
ignoreMissing bool
}
func New(opts ...Option) *Command {
c := &Command{}
for _, opt := range opts {
opt(c)
}
return c
}
func (c *Command) Exec() error {
args := []string{}
if c.username != "" {
args = append(args, fmt.Sprintf("--username=%s", c.username))
}
if c.password != "" {
args = append(args, fmt.Sprintf("--password=%s", c.password))
}
args = append(args, "push")
if c.spec != "" {
tmpfile, err := ioutil.TempFile(c.path, "manifest-")
if err != nil {
return errors.Wrap(err, "failed to create tempfile")
}
defer os.Remove(tmpfile.Name())
if _, err := tmpfile.Write([]byte(c.spec)); err != nil {
return errors.Wrap(err, "failed to write tempfile")
}
if err := tmpfile.Close(); err != nil {
return errors.Wrap(err, "failed to close temp file")
}
args = append(args, "from-spec")
args = append(args, tmpfile.Name())
} else {
args = append(args, "from-args")
if len(c.platforms) != 0 {
args = append(args, fmt.Sprintf("--platforms=%s", strings.Join(c.platforms, ",")))
}
if c.target != "" {
args = append(args, fmt.Sprintf("--target=%s", c.target))
}
if c.template != "" {
args = append(args, fmt.Sprintf("--template=%s", c.template))
}
}
if c.ignoreMissing {
args = append(args, "--ignore-missing")
}
cmd := exec.Command(
"manifest-tool",
args...,
)
buf := bytes.NewBufferString("")
cmd.Stdout = io.MultiWriter(os.Stdout, buf)
cmd.Stderr = io.MultiWriter(os.Stderr, buf)
if c.path != "" {
cmd.Dir = c.path
}
return cmd.Run()
}
-51
View File
@@ -1,51 +0,0 @@
package command
type Option func(*Command)
func WithUsername(val string) Option {
return func(t *Command) {
t.username = val
}
}
func WithPassword(val string) Option {
return func(t *Command) {
t.password = val
}
}
func WithSpec(val string) Option {
return func(t *Command) {
t.spec = val
}
}
func WithPlatforms(val []string) Option {
return func(t *Command) {
t.platforms = val
}
}
func WithTarget(val string) Option {
return func(t *Command) {
t.target = val
}
}
func WithTemplate(val string) Option {
return func(t *Command) {
t.template = val
}
}
func WithPath(val string) Option {
return func(t *Command) {
t.path = val
}
}
func IgnoreMissing() Option {
return func(t *Command) {
t.ignoreMissing = true
}
}
@@ -1,9 +1,3 @@
FROM alpine:3.6 as base
RUN apk add --no-cache curl && \
curl -sSLo /bin/manifest-tool https://github.com/estesp/manifest-tool/releases/download/v0.7.0/manifest-tool-linux-amd64 && \
chmod +x /bin/manifest-tool
FROM plugins/base:multiarch
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \
@@ -11,7 +5,5 @@ LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \
org.label-schema.vendor="Drone.IO Community" \
org.label-schema.schema-version="1.0"
COPY --from=base /bin/manifest-tool /bin/
ADD release/linux/amd64/drone-manifest /bin/
ENTRYPOINT ["/bin/drone-manifest"]
@@ -1,9 +1,3 @@
FROM alpine:3.6 as base
RUN apk add --no-cache curl && \
curl -sSLo /bin/manifest-tool https://github.com/estesp/manifest-tool/releases/download/v0.7.0/manifest-tool-linux-arm64 && \
chmod +x /bin/manifest-tool
FROM plugins/base:multiarch
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \
@@ -11,7 +5,5 @@ LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \
org.label-schema.vendor="Drone.IO Community" \
org.label-schema.schema-version="1.0"
COPY --from=base /bin/manifest-tool /bin/
ADD release/linux/arm64/drone-manifest /bin/
ENTRYPOINT ["/bin/drone-manifest"]
+10
View File
@@ -0,0 +1,10 @@
# escape=`
FROM plugins/base:windows-1809-amd64
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
org.label-schema.name="Drone Manifest" `
org.label-schema.vendor="Drone.IO Community" `
org.label-schema.schema-version="1.0"
ADD release/windows/amd64/drone-manifest.exe C:/bin/drone-manifest.exe
ENTRYPOINT [ "C:\\bin\\drone-manifest.exe" ]
+10
View File
@@ -0,0 +1,10 @@
# escape=`
FROM plugins/base:windows-ltsc2022-amd64
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
org.label-schema.name="Drone Manifest" `
org.label-schema.vendor="Drone.IO Community" `
org.label-schema.schema-version="1.0"
ADD release/windows/amd64/drone-manifest.exe C:/bin/drone-manifest.exe
ENTRYPOINT [ "C:\\bin\\drone-manifest.exe" ]
+31
View File
@@ -0,0 +1,31 @@
image: plugins/manifest:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
-
image: plugins/manifest:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
platform:
architecture: amd64
os: linux
-
image: plugins/manifest:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
platform:
architecture: arm64
os: linux
variant: v8
-
image: plugins/manifest:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809-amd64
platform:
architecture: amd64
os: windows
version: 1809
-
image: plugins/manifest:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-ltsc2022-amd64
platform:
architecture: amd64
os: windows
version: ltsc2022
+42
View File
@@ -0,0 +1,42 @@
module github.com/drone-plugins/drone-manifest
go 1.20
require (
github.com/coreos/go-semver v0.3.1
github.com/drone/drone-go v1.7.1
github.com/drone/drone-template-lib v1.0.0
github.com/estesp/manifest-tool/v2 v2.0.8
github.com/kelseyhightower/envconfig v1.4.0
github.com/opencontainers/image-spec v1.1.0-rc2
github.com/sirupsen/logrus v1.9.0
gopkg.in/yaml.v3 v3.0.1
)
require (
github.com/Masterminds/goutils v1.1.0 // indirect
github.com/Masterminds/semver v1.4.2 // indirect
github.com/Masterminds/sprig v2.18.0+incompatible // indirect
github.com/aymerick/raymond v2.0.2+incompatible // indirect
github.com/containerd/containerd v1.6.18 // indirect
github.com/docker/cli v23.0.1+incompatible // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v23.0.1+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/huandu/xstrings v1.2.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.5.0 // indirect
google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 // indirect
google.golang.org/grpc v1.47.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
oras.land/oras-go/v2 v2.0.0 // indirect
)
+212
View File
@@ -0,0 +1,212 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/99designs/httpsignatures-go v0.0.0-20170731043157-88528bf4ca7e/go.mod h1:Xa6lInWHNQnuWoF0YPSsx+INFA9qk7/7pTjwb3PInkY=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg=
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITgsTc=
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/sprig v2.18.0+incompatible h1:QoGhlbC6pter1jxKnjMFxT8EqsLuDE6FEcNbWEpw+lI=
github.com/Masterminds/sprig v2.18.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/aymerick/raymond v2.0.2+incompatible h1:VEp3GpgdAnv9B2GFyTvqgcKvY+mfKMjPOA3SbKLtnU0=
github.com/aymerick/raymond v2.0.2+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
github.com/bouk/monkey v1.0.0 h1:k6z8fLlPhETfn5l9rlWVE7Q6B23DoaqosTdArvNQRdc=
github.com/bouk/monkey v1.0.0/go.mod h1:PG/63f4XEUlVyW1ttIeOJmJhhe1+t9EC/je3eTjvFhE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/containerd/containerd v1.6.18 h1:qZbsLvmyu+Vlty0/Ex5xc0z2YtKpIsb5n45mAMI+2Ns=
github.com/containerd/containerd v1.6.18/go.mod h1:1RdCUu95+gc2v9t3IL+zIlpClSmew7/0YS8O5eQZrOw=
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/docker/cli v23.0.1+incompatible h1:LRyWITpGzl2C9e9uGxzisptnxAn1zfZKXy13Ul2Q5oM=
github.com/docker/cli v23.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68=
github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v23.0.1+incompatible h1:vjgvJZxprTTE1A37nm+CLNAdwu6xZekyoiVlUZEINcY=
github.com/docker/docker v23.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=
github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0=
github.com/drone/drone-go v1.7.1 h1:ZX+3Rs8YHUSUQ5mkuMLmm1zr1ttiiE2YGNxF3AnyDKw=
github.com/drone/drone-go v1.7.1/go.mod h1:fxCf9jAnXDZV1yDr0ckTuWd1intvcQwfJmTRpTZ1mXg=
github.com/drone/drone-template-lib v1.0.0 h1:PNBBfUhifRnrPCoWBlTitk3jipXdv8u8WLbIf7h7j00=
github.com/drone/drone-template-lib v1.0.0/go.mod h1:Hqy1tgqPH5mtbFOZmow19l4jOkZvp+WZ00cB4W3MJhg=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/estesp/manifest-tool/v2 v2.0.8 h1:hNiSguGbIcul1xAhI7Ua8HJvIU6V4VmM4FBxq5Cxx6g=
github.com/estesp/manifest-tool/v2 v2.0.8/go.mod h1:oDk8Oj2enRtzjlCMGn3KR6PDRS8PVd21mxK5EZs0WCc=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs=
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/huandu/xstrings v1.2.0 h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0=
github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4=
github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=
github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg=
github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc=
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034=
github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/tkuchiki/faketime v0.0.0-20170607100027-a4500a4f4643 h1:ii/sHfgFMByozryLeiDmn1ClZ/Pena4NgpJ4P7UuX9o=
github.com/tkuchiki/faketime v0.0.0-20170607100027-a4500a4f4643/go.mod h1:RXY/TXAwGGL36IKDjrHFMcjpUrEiyWSEtLhFPw3UWF0=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd h1:XcWmESyNjXJMLahc3mqVQJcgSTDxFxhETVlfk9uGc38=
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 h1:hrbNEivu7Zn1pxvHk6MBrq9iE22woVILTHqexqBxe6I=
google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8=
google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
oras.land/oras-go/v2 v2.0.0 h1:+LRAz92WF7AvYQsQjPEAIw3Xb2zPPhuydjpi4pIHmc0=
oras.land/oras-go/v2 v2.0.0/go.mod h1:iVExH1NxrccIxjsiq17L91WCZ4KIw6jVQyCLsZsu1gc=
+45 -192
View File
@@ -1,210 +1,63 @@
// Copyright (c) 2023, the Drone Plugins project authors.
// Please see the AUTHORS file for details. All rights reserved.
// Use of this source code is governed by an Apache 2.0 license that can be
// found in the LICENSE file.
package main
import (
"fmt"
"log"
"os"
"bytes"
"context"
"strings"
"github.com/drone-plugins/drone-manifest/tagging"
"github.com/urfave/cli"
)
"github.com/drone-plugins/drone-manifest/plugin"
var (
version = "0.0.0"
build = "0"
"github.com/kelseyhightower/envconfig"
"github.com/sirupsen/logrus"
)
func main() {
app := cli.NewApp()
app.Name = "manifest plugin"
app.Usage = "manifest plugin"
app.Version = fmt.Sprintf("%s+%s", version, build)
app.Action = run
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "username",
Usage: "username for registry",
EnvVar: "PLUGIN_USERNAME,MANIFEST_USERNAME,DOCKER_USERNAME",
},
cli.StringFlag{
Name: "password",
Usage: "password for registry",
EnvVar: "PLUGIN_PASSWORD,MANIFEST_PASSWORD,DOCKER_PASSWORD",
},
cli.StringSliceFlag{
Name: "platforms",
Usage: "platforms for manifests",
EnvVar: "PLUGIN_PLATFORMS",
},
cli.StringFlag{
Name: "target",
Usage: "target for manifests",
EnvVar: "PLUGIN_TARGET",
},
cli.StringFlag{
Name: "template",
Usage: "template for manifests",
EnvVar: "PLUGIN_TEMPLATE",
},
cli.StringFlag{
Name: "spec",
Usage: "path to manifest spec",
EnvVar: "PLUGIN_SPEC",
},
cli.BoolFlag{
Name: "ignore-missing",
Usage: "ignore missing images",
EnvVar: "PLUGIN_IGNORE_MISSING",
},
cli.StringSliceFlag{
Name: "tags",
Usage: "list of additional tags",
Value: &cli.StringSlice{},
EnvVar: "PLUGIN_TAG,PLUGIN_TAGS",
FilePath: ".tags",
},
cli.BoolFlag{
Name: "tags.auto",
Usage: "automatically build tags",
EnvVar: "PLUGIN_DEFAULT_TAGS,PLUGIN_AUTO_TAG",
},
cli.StringFlag{
Name: "path",
Usage: "git clone path",
EnvVar: "DRONE_WORKSPACE",
},
cli.StringFlag{
Name: "repo.owner",
Usage: "repository owner",
EnvVar: "DRONE_REPO_OWNER",
},
cli.StringFlag{
Name: "repo.name",
Usage: "repository name",
EnvVar: "DRONE_REPO_NAME",
},
cli.StringFlag{
Name: "repo.branch",
Usage: "repository default branch",
EnvVar: "DRONE_REPO_BRANCH",
},
cli.StringFlag{
Name: "commit.sha",
Usage: "git commit sha",
EnvVar: "DRONE_COMMIT_SHA",
Value: "00000000",
},
cli.StringFlag{
Name: "commit.ref",
Usage: "git commit ref",
EnvVar: "DRONE_COMMIT_REF",
},
cli.StringFlag{
Name: "commit.branch",
Value: "master",
Usage: "git commit branch",
EnvVar: "DRONE_COMMIT_BRANCH",
},
cli.StringFlag{
Name: "commit.pull",
Usage: "git pull request",
EnvVar: "DRONE_PULL_REQUEST",
},
cli.StringFlag{
Name: "build.event",
Value: "push",
Usage: "build event",
EnvVar: "DRONE_BUILD_EVENT",
},
cli.IntFlag{
Name: "build.number",
Usage: "build number",
EnvVar: "DRONE_BUILD_NUMBER",
},
cli.StringFlag{
Name: "build.status",
Usage: "build status",
Value: "success",
EnvVar: "DRONE_BUILD_STATUS",
},
cli.StringFlag{
Name: "build.link",
Usage: "build link",
EnvVar: "DRONE_BUILD_LINK",
},
cli.Int64Flag{
Name: "build.started",
Usage: "build started",
EnvVar: "DRONE_BUILD_STARTED",
},
cli.Int64Flag{
Name: "build.created",
Usage: "build created",
EnvVar: "DRONE_BUILD_CREATED",
},
cli.StringFlag{
Name: "build.tag",
Usage: "build tag",
EnvVar: "DRONE_TAG",
},
cli.Int64Flag{
Name: "job.started",
Usage: "job started",
EnvVar: "DRONE_JOB_STARTED",
},
logrus.SetFormatter(new(formatter))
var args plugin.Args
if err := envconfig.Process("", &args); err != nil {
logrus.Fatalln(err)
}
if err := app.Run(os.Args); err != nil {
log.Fatal(err)
switch args.Level {
case "debug":
logrus.SetFormatter(textFormatter)
logrus.SetLevel(logrus.DebugLevel)
case "trace":
logrus.SetFormatter(textFormatter)
logrus.SetLevel(logrus.TraceLevel)
}
if err := plugin.Exec(context.Background(), &args); err != nil {
logrus.Fatalln(err)
}
}
func run(c *cli.Context) error {
plugin := Plugin{
Repo: Repo{
Owner: c.String("repo.owner"),
Name: c.String("repo.name"),
Branch: c.String("repo.branch"),
},
Build: Build{
Path: c.String("path"),
Tag: c.String("build.tag"),
Number: c.Int("build.number"),
Event: c.String("build.event"),
Status: c.String("build.status"),
Commit: c.String("commit.sha"),
Ref: c.String("commit.ref"),
Branch: c.String("commit.branch"),
Pull: c.String("commit.pull"),
Started: c.Int64("build.started"),
Created: c.Int64("build.created"),
Tags: c.StringSlice("tags"),
},
Job: Job{
Started: c.Int64("job.started"),
},
Auto: Auto{
Tags: []string{"1.0", "1"},
},
Config: Config{
Username: c.String("username"),
Password: c.String("password"),
Platforms: c.StringSlice("platforms"),
Target: c.String("target"),
Template: c.String("template"),
Spec: c.String("spec"),
IgnoreMissing: c.Bool("ignore-missing"),
},
// default formatter that writes logs without including timestamp or level information.
type formatter struct{}
func (*formatter) Format(entry *logrus.Entry) ([]byte, error) {
var b *bytes.Buffer
if entry.Buffer != nil {
b = entry.Buffer
} else {
b = &bytes.Buffer{}
}
if c.Bool("tags.auto") {
if tagging.UseDefaultTag(c.String("commit.ref"), c.String("repo.branch")) {
plugin.Build.Tags = tagging.DefaultTags(c.String("commit.ref"))
} else {
log.Printf("skipping automated tags for %s", c.String("commit.ref"))
return nil
}
b.WriteString(entry.Message)
if !strings.HasSuffix(entry.Message, "\n") {
b.WriteByte('\n')
}
return plugin.Exec()
return b.Bytes(), nil
}
// text formatter that writes logs with level information.
var textFormatter = &logrus.TextFormatter{
DisableTimestamp: true,
}
-33
View File
@@ -1,33 +0,0 @@
image: plugins/manifest:{{#if build.tag}}{{trimPrefix build.tag "v"}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
-
image: plugins/manifest:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-amd64
platform:
architecture: amd64
os: linux
-
image: plugins/manifest:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-i386
platform:
architecture: 386
os: linux
-
image: plugins/manifest:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm64
platform:
architecture: arm64
os: linux
-
image: plugins/manifest:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm
platform:
architecture: arm
os: linux
-
image: plugins/manifest:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}windows-amd64
platform:
architecture: amd64
os: windows
-127
View File
@@ -1,127 +0,0 @@
package main
import (
"errors"
"log"
"strings"
"github.com/drone-plugins/drone-manifest/command"
)
type (
Repo struct {
Owner string
Name string
Branch string
}
Build struct {
Path string
Tag string
Event string
Number int
Commit string
Ref string
Branch string
Author string
Pull string
Message string
DeployTo string
Status string
Link string
Started int64
Created int64
Tags []string
}
Job struct {
Started int64
}
Auto struct {
Tags []string
}
Config struct {
Username string
Password string
Platforms []string
Target string
Template string
Spec string
IgnoreMissing bool
}
Plugin struct {
Repo Repo
Build Build
Job Job
Auto Auto
Config Config
}
)
func (p *Plugin) Exec() error {
opts := make([]command.Option, 0)
if p.Config.Username == "" {
return errors.New("you must provide a username")
} else {
opts = append(opts, command.WithUsername(p.Config.Username))
}
if p.Config.Password == "" {
return errors.New("you must provide a password")
} else {
opts = append(opts, command.WithPassword(p.Config.Password))
}
if p.Config.Spec != "" {
spec, err := RenderTrim(p.Config.Spec, p)
if err != nil {
return err
}
opts = append(opts, command.WithSpec(spec))
log.Printf(
"pushing by spec",
)
} else {
if len(p.Config.Platforms) == 0 {
return errors.New("you must provide platforms")
} else {
opts = append(opts, command.WithPlatforms(p.Config.Platforms))
}
if p.Config.Target == "" {
return errors.New("you must provide a target")
} else {
opts = append(opts, command.WithTarget(p.Config.Target))
}
if p.Config.Template == "" {
return errors.New("you must provide a template")
} else {
opts = append(opts, command.WithTemplate(p.Config.Template))
}
log.Printf(
"pushing %s to %s for %s",
p.Config.Template,
p.Config.Target,
strings.Join(p.Config.Platforms, ", "),
)
}
if p.Config.IgnoreMissing {
opts = append(opts, command.IgnoreMissing())
}
if p.Build.Path != "" {
opts = append(opts, command.WithPath(p.Build.Path))
}
return command.New(opts...).Exec()
}
+82
View File
@@ -0,0 +1,82 @@
// Copyright (c) 2023, the Drone Plugins project authors.
// Please see the AUTHORS file for details. All rights reserved.
// Use of this source code is governed by an Apache 2.0 license that can be
// found in the LICENSE file.
package plugin
import (
"os"
"strconv"
)
type (
legacyRepo struct {
Owner string
Name string
Branch string
}
legacyBuild struct {
Path string
Tag string
Event string
Number int
Commit string
Ref string
Branch string
Author string
Pull string
Message string
DeployTo string
Status string
Link string
Started int64
Created int64
Tags []string
}
legacyJob struct {
Started int64
}
legacyPlugin struct {
Repo legacyRepo
Build legacyBuild
Job legacyJob
}
)
func toLegacyPlugin(args *Args) legacyPlugin {
return legacyPlugin{
Repo: legacyRepo{
Owner: args.Repo.Namespace,
Name: args.Repo.Name,
Branch: args.Repo.Branch,
},
Build: legacyBuild{
Path: getEnv("DRONE_WORKSPACE", ""),
Tag: args.Tag.Name,
Number: args.Build.Number,
Event: args.Build.Event,
Status: args.Build.Status,
Commit: args.Commit.Rev,
Ref: args.Commit.Ref,
Branch: args.Commit.Branch,
Pull: strconv.FormatInt(int64(args.PullRequest.Number), 10), // c.String("commit.pull"),
Started: args.Build.Started,
Created: args.Build.Created,
Tags: args.Tags,
},
Job: legacyJob{
Started: 0,
},
}
}
func getEnv(key, fallback string) string {
if value, ok := os.LookupEnv(key); ok {
return value
}
return fallback
}
+150
View File
@@ -0,0 +1,150 @@
// Copyright (c) 2023, the Drone Plugins project authors.
// Please see the AUTHORS file for details. All rights reserved.
// Use of this source code is governed by an Apache 2.0 license that can be
// found in the LICENSE file.
package plugin
// Pipeline provides Pipeline metadata from the environment.
type Pipeline struct {
// Build provides build metadata.
Build struct {
Branch string `envconfig:"DRONE_BUILD_BRANCH"`
Number int `envconfig:"DRONE_BUILD_NUMBER"`
Parent int `envconfig:"DRONE_BUILD_PARENT"`
Event string `envconfig:"DRONE_BUILD_EVENT"`
Action string `envconfig:"DRONE_BUILD_ACTION"`
Status string `envconfig:"DRONE_BUILD_STATUS"`
Created int64 `envconfig:"DRONE_BUILD_CREATED"`
Started int64 `envconfig:"DRONE_BUILD_STARTED"`
Finished int64 `envconfig:"DRONE_BUILD_FINISHED"`
Link string `envconfig:"DRONE_BUILD_LINK"`
}
// Calver provides the calver details parsed from the
// git tag. If the git tag is empty or is not a valid
// calver, the values will be empty.
Calver struct {
Version string `envconfig:"DRONE_CALVER"`
Short string `envconfig:"DRONE_CALVER_SHORT"`
MajorMinor string `envconfig:"DRONE_CALVER_MAJOR_MINOR"`
Major string `envconfig:"DRONE_CALVER_MAJOR"`
Minor string `envconfig:"DRONE_CALVER_MINOR"`
Micro string `envconfig:"DRONE_CALVER_MICRO"`
Modifier string `envconfig:"DRONE_CALVER_MODIFIER"`
}
// Card provides adaptive card configuration options.
Card struct {
Path string `envconfig:"DRONE_CARD_PATH"`
}
// Commit provides the commit metadata.
Commit struct {
Rev string `envconfig:"DRONE_COMMIT_SHA"`
Before string `envconfig:"DRONE_COMMIT_BEFORE"`
After string `envconfig:"DRONE_COMMIT_AFTER"`
Ref string `envconfig:"DRONE_COMMIT_REF"`
Branch string `envconfig:"DRONE_COMMIT_BRANCH"`
Source string `envconfig:"DRONE_COMMIT_SOURCE"`
Target string `envconfig:"DRONE_COMMIT_TARGET"`
Link string `envconfig:"DRONE_COMMIT_LINK"`
Message string `envconfig:"DRONE_COMMIT_MESSAGE"`
Author struct {
Username string `envconfig:"DRONE_COMMIT_AUTHOR"`
Name string `envconfig:"DRONE_COMMIT_AUTHOR_NAME"`
Email string `envconfig:"DRONE_COMMIT_AUTHOR_EMAIL"`
Avatar string `envconfig:"DRONE_COMMIT_AUTHOR_AVATAR"`
}
}
// Deploy provides the deployment metadata.
Deploy struct {
ID string `envconfig:"DRONE_DEPLOY_TO"`
Target string `envconfig:"DRONE_DEPLOY_ID"`
}
// Failed provides a list of failed steps and failed stages
// for the current pipeline.
Failed struct {
Steps []string `envconfig:"DRONE_FAILED_STEPS"`
Stages []string `envconfig:"DRONE_FAILED_STAGES"`
}
// Git provides the git repository metadata.
Git struct {
HTTPURL string `envconfig:"DRONE_GIT_HTTP_URL"`
SSHURL string `envconfig:"DRONE_GIT_SSH_URL"`
}
// PullRequest provides the pull request metadata.
PullRequest struct {
Number int `envconfig:"DRONE_PULL_REQUEST"`
}
// Repo provides the repository metadata.
Repo struct {
Branch string `envconfig:"DRONE_REPO_BRANCH"`
Link string `envconfig:"DRONE_REPO_LINK"`
Namespace string `envconfig:"DRONE_REPO_NAMESPACE"`
Name string `envconfig:"DRONE_REPO_NAME"`
Private bool `envconfig:"DRONE_REPO_PRIVATE"`
Remote string `envconfig:"DRONE_GIT_HTTP_URL"`
SCM string `envconfig:"DRONE_REPO_SCM"`
Slug string `envconfig:"DRONE_REPO"`
Visibility string `envconfig:"DRONE_REPO_VISIBILITY"`
}
// Stage provides the stage metadata.
Stage struct {
Kind string `envconfig:"DRONE_STAGE_KIND"`
Type string `envconfig:"DRONE_STAGE_TYPE"`
Name string `envconfig:"DRONE_STAGE_NAME"`
Number int `envconfig:"DRONE_STAGE_NUMBER"`
Machine string `envconfig:"DRONE_STAGE_MACHINE"`
OS string `envconfig:"DRONE_STAGE_OS"`
Arch string `envconfig:"DRONE_STAGE_ARCH"`
Variant string `envconfig:"DRONE_STAGE_VARIANT"`
Status string `envconfig:"DRONE_STAGE_STATUS"`
Started int64 `envconfig:"DRONE_STAGE_STARTED"`
Finished int64 `envconfig:"DRONE_STAGE_FINISHED"`
DependsOn []string `envconfig:"DRONE_STAGE_DEPENDS_ON"`
}
// Step provides the step metadata.
Step struct {
Number int `envconfig:"DRONE_STEP_NUMBER"`
Name string `envconfig:"DRONE_STEP_NAME"`
}
// Semver provides the semver details parsed from the
// git tag. If the git tag is empty or is not a valid
// semver, the values will be empty and the error field
// will be populated with the parsing error.
Semver struct {
Version string `envconfig:"DRONE_SEMVER"`
Short string `envconfig:"DRONE_SEMVER_SHORT"`
Major string `envconfig:"DRONE_SEMVER_MAJOR"`
Minor string `envconfig:"DRONE_SEMVER_MINOR"`
Patch string `envconfig:"DRONE_SEMVER_PATCH"`
Build string `envconfig:"DRONE_SEMVER_BUILD"`
PreRelease string `envconfig:"DRONE_SEMVER_PRERELEASE"`
Error string `envconfig:"DRONE_SEMVER_ERROR"`
}
// System provides the Drone system metadata, including
// the system version of details required to create the
// drone website address.
System struct {
Proto string `envconfig:"DRONE_SYSTEM_PROTO"`
Host string `envconfig:"DRONE_SYSTEM_HOST"`
Hostname string `envconfig:"DRONE_SYSTEM_HOSTNAME"`
Version string `envconfig:"DRONE_SYSTEM_VERSION"`
}
// Tag provides the git tag details.
Tag struct {
Name string `envconfig:"DRONE_TAG"`
}
}
+234
View File
@@ -0,0 +1,234 @@
// Copyright (c) 2023, the Drone Plugins project authors.
// Please see the AUTHORS file for details. All rights reserved.
// Use of this source code is governed by an Apache 2.0 license that can be
// found in the LICENSE file.
package plugin
import (
"context"
"encoding/json"
"errors"
"fmt"
"os"
"strings"
"github.com/drone-plugins/drone-manifest/tagging"
"github.com/drone/drone-go/drone"
"github.com/drone/drone-template-lib/template"
"github.com/estesp/manifest-tool/v2/pkg/registry"
"github.com/estesp/manifest-tool/v2/pkg/types"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/sirupsen/logrus"
yaml "gopkg.in/yaml.v3"
)
// Args provides plugin execution arguments.
type (
Args struct {
Pipeline
// Level defines the plugin log level.
Level string `envconfig:"PLUGIN_LOG_LEVEL"`
// Skip verification of certificates
SkipVerify bool `envconfig:"PLUGIN_SKIP_VERIFY"`
// Lint plugin
Lint bool `envconfig:"PLUGIN_LINT" default:"true"`
// Plugin specific
Username string `envconfig:"PLUGIN_USERNAME"`
Password string `envconfig:"PLUGIN_PASSWORD"`
Platforms []string `envconfig:"PLUGIN_PLATFORMS"`
Target string `envconfig:"PLUGIN_TARGET"`
Template string `envconfig:"PLUGIN_TEMPLATE"`
Spec string `envconfig:"PLUGIN_SPEC"`
IgnoreMissing bool `envconfig:"PLUGIN_IGNORE_MISSING"`
Tags []string `envconfig:"PLUGIN_TAGS"`
AutoTag bool `envconfig:"PLUGIN_AUTO_TAG"`
}
)
var errConfiguration = errors.New("configuration error")
// Exec executes the plugin.
func Exec(ctx context.Context, args *Args) error {
linter := ""
if args.Lint {
issues, warnings := lintArgs(args)
linter = fmt.Sprintf("lint: %d issue(s) found\n%s", issues, warnings)
logrus.Info(linter)
}
err := verifyArgs(args)
if err != nil {
return fmt.Errorf("error in the configuration: %w", err)
}
// Auto tag behavior
if args.AutoTag {
if tagging.UseDefaultTag(args.Commit.Ref, args.Repo.Branch) {
args.Tags = tagging.DefaultTags(args.Commit.Ref)
} else {
logrus.Infof("skipping automated tags for %s", args.Commit.Ref)
return nil
}
}
// Get the yaml to push
var yamlFunc func(*Args) (types.YAMLInput, error)
if args.Spec != "" {
yamlFunc = yamlFromSpec
} else {
yamlFunc = yamlFromArgs
}
yamlInput, err := yamlFunc(args)
if err != nil {
return fmt.Errorf("could not create manifest spec: %w", err)
}
logrus.Info("pushing manifest")
digest, length, err := registry.PushManifestList(
args.Username, // --username
args.Password, // --password
yamlInput, // --from-spec
args.IgnoreMissing, // --ignore-missing
args.SkipVerify, // --insecure
false, // --plain-http
types.Docker, // --type
"", // --docker-cfg
)
if err != nil {
return fmt.Errorf("could not push manifest list: %w", err)
}
logrus.Infof("manifest pushed: digest %s %d", digest, length)
// Create the card data
cardData := struct {
Image string `json:"image"`
Digest string `json:"digest"`
Linter string `json:"linter"`
}{
Image: yamlInput.Image,
Digest: digest,
Linter: linter,
}
data, _ := json.Marshal(cardData)
card := drone.CardInput{
Schema: "https://drone-plugins.github.io/drone-manifest/card.json",
Data: data,
}
writeCard(args.Card.Path, &card)
return nil
}
func lintArgs(args *Args) (issues int, warnings string) {
issues = 0
var warningsBuilder strings.Builder
if value, present := os.LookupEnv("PLUGIN_INSECURE"); present {
warningsBuilder.WriteString("remove insecure from config and use skip_verify instead")
args.SkipVerify = value == "true"
issues++
}
return issues, warningsBuilder.String()
}
func verifyArgs(args *Args) error {
if args.Username == "" {
return fmt.Errorf("no username provided: %w", errConfiguration)
}
if args.Password == "" {
return fmt.Errorf("no password provided: %w", errConfiguration)
}
if args.Spec == "" {
if len(args.Platforms) == 0 {
return fmt.Errorf("no platforms provided: %w", errConfiguration)
}
if args.Target == "" {
return fmt.Errorf("no target provided: %w", errConfiguration)
}
if args.Template == "" {
return fmt.Errorf("no template provided: %w", errConfiguration)
}
} else if len(args.Platforms) != 0 || args.Target != "" || args.Template != "" {
return fmt.Errorf("both spec and arguments provided: %w", errConfiguration)
}
return nil
}
func yamlFromSpec(args *Args) (types.YAMLInput, error) {
var yamlInput types.YAMLInput
var raw []byte
// if spec is not a valid file, assume inlining
if _, err := os.Stat(args.Spec); os.IsNotExist(err) {
raw = []byte(args.Spec)
} else { // otherwise read it
raw, err = os.ReadFile(args.Spec)
if err != nil {
return yamlInput, fmt.Errorf("failed to read template: %w", errConfiguration)
}
}
// Render using the old plugin format
p := toLegacyPlugin(args)
yamlFile, err := template.RenderTrim(string(raw), p)
if err != nil {
return yamlInput, fmt.Errorf("can't render template: %w", err)
}
// Modified from https://github.com/estesp/manifest-tool/blob/main/v2/cmd/manifest-tool/push.go
err = yaml.Unmarshal([]byte(yamlFile), &yamlInput)
if err != nil {
return yamlInput, fmt.Errorf("can't unmarshal to yaml: %w", err)
}
return yamlInput, nil
}
func yamlFromArgs(args *Args) (types.YAMLInput, error) {
// Modified from https://github.com/estesp/manifest-tool/blob/main/v2/cmd/manifest-tool/push.go
srcImages := []types.ManifestEntry{}
for _, platform := range args.Platforms {
osArchArr := strings.Split(platform, "/")
if len(osArchArr) != 2 && len(osArchArr) != 3 {
return types.YAMLInput{}, fmt.Errorf("platforms must be a string slice where one value is of the form 'os/arch': %w", errConfiguration)
}
variant := ""
os, arch := osArchArr[0], osArchArr[1]
if len(osArchArr) == 3 {
variant = osArchArr[2]
}
srcImages = append(srcImages, types.ManifestEntry{
Image: strings.Replace(strings.Replace(strings.Replace(args.Template, "ARCH", arch, 1), "OS", os, 1), "VARIANT", variant, 1),
Platform: ocispec.Platform{
OS: os,
Architecture: arch,
Variant: variant,
},
})
}
return types.YAMLInput{
Image: args.Target,
Tags: args.Tags,
Manifests: srcImages,
}, nil
}
+37
View File
@@ -0,0 +1,37 @@
// Copyright (c) 2023, the Drone Plugins project authors.
// Please see the AUTHORS file for details. All rights reserved.
// Use of this source code is governed by an Apache 2.0 license that can be
// found in the LICENSE file.
package plugin
import (
"encoding/base64"
"encoding/json"
"io"
"os"
)
//nolint:errcheck
func writeCard(path string, card interface{}) {
data, _ := json.Marshal(card)
switch {
case path == "/dev/stdout":
writeCardTo(os.Stdout, data)
case path == "/dev/stderr":
writeCardTo(os.Stderr, data)
case path != "":
os.WriteFile(path, data, 0o644) //nolint:gomnd,gosec
}
}
//nolint:errcheck
func writeCardTo(out io.Writer, data []byte) {
encoded := base64.StdEncoding.EncodeToString(data)
io.WriteString(out, "\u001B]1338;")
io.WriteString(out, encoded)
io.WriteString(out, "\u001B]0m")
io.WriteString(out, "\n")
}
+19 -6
View File
@@ -7,6 +7,16 @@ import (
"github.com/coreos/go-semver/semver"
)
func splitOff(input string, delim string) string {
parts := strings.SplitN(input, delim, 2)
if len(parts) == 2 {
return parts[0]
}
return input
}
// DefaultTags returns a set of default suggested tags.
func DefaultTags(ref string) []string {
if !strings.HasPrefix(ref, "refs/tags/") {
@@ -16,7 +26,6 @@ func DefaultTags(ref string) []string {
v := stripTagPrefix(ref)
version, err := semver.NewVersion(v)
if err != nil {
return []string{"latest"}
}
@@ -27,17 +36,21 @@ func DefaultTags(ref string) []string {
}
}
v = stripTagPrefix(ref)
v = splitOff(splitOff(v, "+"), "-")
dotParts := strings.SplitN(v, ".", 3)
if version.Major == 0 {
return []string{
fmt.Sprintf("%d.%d", version.Major, version.Minor),
fmt.Sprintf("%d.%d.%d", version.Major, version.Minor, version.Patch),
fmt.Sprintf("%0*d.%0*d", len(dotParts[0]), version.Major, len(dotParts[1]), version.Minor),
fmt.Sprintf("%0*d.%0*d.%0*d", len(dotParts[0]), version.Major, len(dotParts[1]), version.Minor, len(dotParts[2]), version.Patch),
}
}
return []string{
fmt.Sprint(version.Major),
fmt.Sprintf("%d.%d", version.Major, version.Minor),
fmt.Sprintf("%d.%d.%d", version.Major, version.Minor, version.Patch),
fmt.Sprintf("%0*d", len(dotParts[0]), version.Major),
fmt.Sprintf("%0*d.%0*d", len(dotParts[0]), version.Major, len(dotParts[1]), version.Minor),
fmt.Sprintf("%0*d.%0*d.%0*d", len(dotParts[0]), version.Major, len(dotParts[1]), version.Minor, len(dotParts[2]), version.Patch),
}
}
+3 -2
View File
@@ -6,7 +6,7 @@ import (
)
func TestDefaultTags(t *testing.T) {
var tests = []struct {
tests := []struct {
Before string
After []string
}{
@@ -21,6 +21,7 @@ func TestDefaultTags(t *testing.T) {
// malformed or errors
{"refs/tags/x1.0.0", []string{"latest"}},
{"v1.0.0", []string{"latest"}},
{"refs/tags/v18.06.0", []string{"18", "18.06", "18.06.0"}},
}
for _, test := range tests {
@@ -101,7 +102,7 @@ func Test_stripHeadPrefix(t *testing.T) {
}
func Test_stripTagPrefix(t *testing.T) {
var tests = []struct {
tests := []struct {
Before string
After string
}{
-141
View File
@@ -1,141 +0,0 @@
package main
import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strconv"
"strings"
"time"
"unicode"
"unicode/utf8"
"github.com/aymerick/raymond"
)
func init() {
raymond.RegisterHelpers(funcs)
}
// Render parses and executes a template, returning the results in string format.
func Render(template string, payload interface{}) (s string, err error) {
u, err := url.Parse(template)
if err == nil {
switch u.Scheme {
case "http", "https":
res, err := http.Get(template)
if err != nil {
return s, err
}
defer res.Body.Close()
out, err := ioutil.ReadAll(res.Body)
if err != nil {
return s, err
}
template = string(out)
default:
out, err := ioutil.ReadFile(u.Path)
if err != nil {
return s, err
}
template = string(out)
}
}
return raymond.Render(template, payload)
}
// RenderTrim parses and executes a template, returning the results in string
// format. The result is trimmed to remove left and right padding and newlines
// that may be added unintentially in the template markup.
func RenderTrim(template string, playload interface{}) (string, error) {
out, err := Render(template, playload)
return strings.Trim(out, " \n"), err
}
var funcs = map[string]interface{}{
"uppercase": strings.ToUpper,
"lowercase": strings.ToLower,
"trimPrefix": strings.TrimPrefix,
"trimSuffix": strings.TrimSuffix,
"quote": strconv.Quote,
"join": strings.Join,
"uppercasefirst": uppercaseFirst,
"duration": toDuration,
"datetime": toDatetime,
"success": isSuccess,
"failure": isFailure,
"truncate": truncate,
"urlencode": urlencode,
"since": since,
}
func uppercaseFirst(s string) string {
a := []rune(s)
a[0] = unicode.ToUpper(a[0])
s = string(a)
return s
}
func toDuration(started, finished float64) string {
return fmt.Sprintln(time.Duration(finished-started) * time.Second)
}
func toDatetime(timestamp float64, layout, zone string) string {
if len(zone) == 0 {
return time.Unix(int64(timestamp), 0).Format(layout)
}
loc, err := time.LoadLocation(zone)
if err != nil {
return time.Unix(int64(timestamp), 0).Local().Format(layout)
}
return time.Unix(int64(timestamp), 0).In(loc).Format(layout)
}
func isSuccess(conditional bool, options *raymond.Options) string {
if !conditional {
return options.Inverse()
}
switch options.ParamStr(0) {
case "success":
return options.Fn()
default:
return options.Inverse()
}
}
func isFailure(conditional bool, options *raymond.Options) string {
if !conditional {
return options.Inverse()
}
switch options.ParamStr(0) {
case "failure", "error", "killed":
return options.Fn()
default:
return options.Inverse()
}
}
func truncate(s string, len int) string {
if utf8.RuneCountInString(s) <= len {
return s
}
runes := []rune(s)
return string(runes[:len])
}
func urlencode(options *raymond.Options) string {
return url.QueryEscape(options.Fn())
}
func since(start int64) string {
// NOTE: not using `time.Since()` because the fractional second component
// will give us something like "40m12.917523438s" vs "40m12s". We lose
// some precision, but the format is much more readable.
now := time.Unix(time.Now().Unix(), 0)
return fmt.Sprintln(now.Sub(time.Unix(start, 0)))
}