1 Commits

Author SHA1 Message Date
Shubham Agrawal e41bce7a4f Support to run plugin directly on host 2023-04-19 15:31:48 +05:30
7 changed files with 15 additions and 437 deletions
+11 -11
View File
@@ -9,7 +9,7 @@ pool:
steps:
- name: lint
image: golang:1.20
image: golang:1.19
pull: always
commands:
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
@@ -19,7 +19,7 @@ steps:
- name: gopath
path: "/go"
- name: test
image: golang:1.20
image: golang:1.19
commands:
- go test -cover ./...
volumes:
@@ -46,7 +46,7 @@ pool:
steps:
- name: environment
image: golang:1.20
image: golang:1.19
pull: always
environment:
CGO_ENABLED: "0"
@@ -54,7 +54,7 @@ steps:
- go version
- go env
- name: build
image: golang:1.20
image: golang:1.19
environment:
CGO_ENABLED: "0"
commands:
@@ -80,7 +80,7 @@ trigger:
---
kind: pipeline
type: vm
type: docker
name: linux-arm64
platform:
os: linux
@@ -90,7 +90,7 @@ pool:
steps:
- name: environment
image: golang:1.20
image: golang:1.19
pull: always
environment:
CGO_ENABLED: "0"
@@ -98,7 +98,7 @@ steps:
- go version
- go env
- name: build
image: golang:1.20
image: golang:1.19
environment:
CGO_ENABLED: "0"
commands:
@@ -134,7 +134,7 @@ pool:
steps:
- name: environment
image: golang:1.20
image: golang:1.19
pull: always
environment:
CGO_ENABLED: "0"
@@ -142,7 +142,7 @@ steps:
- go version
- go env
- name: build
image: golang:1.20
image: golang:1.19
environment:
CGO_ENABLED: "0"
commands:
@@ -184,7 +184,7 @@ pool:
steps:
- name: environment
image: golang:1.20
image: golang:1.19
pull: always
environment:
CGO_ENABLED: "0"
@@ -192,7 +192,7 @@ steps:
- go version
- go env
- name: build
image: golang:1.20
image: golang:1.19
environment:
CGO_ENABLED: "0"
commands:
-14
View File
@@ -1,14 +0,0 @@
inputSet:
name: event-PR
identifier: eventPR
orgIdentifier: default
projectIdentifier: Drone_Plugins
pipeline:
identifier: dronegiteareleaseharness
properties:
ci:
codebase:
build:
type: PR
spec:
number: <+trigger.prNumber>
-14
View File
@@ -1,14 +0,0 @@
inputSet:
name: event-Push
identifier: eventPush
orgIdentifier: default
projectIdentifier: Drone_Plugins
pipeline:
identifier: dronegiteareleaseharness
properties:
ci:
codebase:
build:
type: branch
spec:
branch: <+trigger.branch>
-14
View File
@@ -1,14 +0,0 @@
inputSet:
name: event-Tag
identifier: eventTag
orgIdentifier: default
projectIdentifier: Drone_Plugins
pipeline:
identifier: dronegiteareleaseharness
properties:
ci:
codebase:
build:
type: tag
spec:
tag: <+trigger.tag>
-383
View File
@@ -1,383 +0,0 @@
pipeline:
name: drone-gitea-release-harness
identifier: dronegiteareleaseharness
projectIdentifier: Drone_Plugins
orgIdentifier: default
tags: {}
properties:
ci:
codebase:
connectorRef: GitHub_Drone_Plugins_Org
repoName: drone-gitea-release
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-gitea-release .
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/gitea-release
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/gitea-release
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-gitea-release .
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/gitea-release
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/gitea-release
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-gitea-release.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/gitea-release
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/gitea-release
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-gitea-release.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/gitea-release
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/gitea-release
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
+1 -1
View File
@@ -1,6 +1,6 @@
module github.com/drone-plugins/drone-gitea-release
go 1.20
go 1.19
require (
code.gitea.io/sdk/gitea v0.15.1
+3
View File
@@ -0,0 +1,3 @@
run:
go:
module: github.com/drone-plugins/drone-gitea-release