mirror of
https://github.com/drone-plugins/drone-docker.git
synced 2026-06-16 14:50:37 +08:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0bc05d3d59 | |||
| 1ba794cc2c | |||
| 4322b7a867 | |||
| a8d69304f4 | |||
| 64fb40b176 | |||
| 318241a06c | |||
| 090bbdbb73 | |||
| cbbb5d0692 |
+138
-346
@@ -40,7 +40,7 @@ trigger:
|
|||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: ssh
|
type: ssh
|
||||||
name: windows-1809-docker
|
name: windows-1809
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
os: windows
|
os: windows
|
||||||
@@ -53,195 +53,90 @@ server:
|
|||||||
from_secret: windows_username
|
from_secret: windows_username
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build_latest
|
- name: build-docker
|
||||||
|
commands:
|
||||||
|
- go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker
|
||||||
|
- docker login -u $env:USERNAME -p $env:PASSWORD
|
||||||
|
- |
|
||||||
|
$tag="windows-1809-amd64"
|
||||||
|
if (Test-Path env:DRONE_SEMVER_SHORT) {
|
||||||
|
$tag="$env:DRONE_SEMVER_SHORT-windows-1809-amd64"
|
||||||
|
}
|
||||||
|
docker build -f docker/docker/Dockerfile.windows.1809 -t plugins/docker:$tag .
|
||||||
|
docker push plugins/docker:$tag
|
||||||
environment:
|
environment:
|
||||||
VERSION: 1809
|
CGO_ENABLED: "0"
|
||||||
REGISTRY: docker
|
|
||||||
USERNAME:
|
USERNAME:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
PASSWORD:
|
PASSWORD:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
commands:
|
|
||||||
- powershell.exe scripts/windows/latest.ps1
|
|
||||||
|
|
||||||
- name: build_tag
|
- name: build-gcr
|
||||||
|
commands:
|
||||||
|
- go build -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr
|
||||||
|
- docker login -u $env:USERNAME -p $env:PASSWORD
|
||||||
|
- |
|
||||||
|
$tag="windows-1809-amd64"
|
||||||
|
if (Test-Path env:DRONE_SEMVER_SHORT) {
|
||||||
|
$tag="$env:DRONE_SEMVER_SHORT-windows-1809-amd64"
|
||||||
|
}
|
||||||
|
docker build -f docker/gcr/Dockerfile.windows.1809 -t plugins/gcr:$tag .
|
||||||
|
docker push plugins/gcr:$tag
|
||||||
environment:
|
environment:
|
||||||
VERSION: 1809
|
CGO_ENABLED: "0"
|
||||||
REGISTRY: docker
|
|
||||||
USERNAME:
|
USERNAME:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
PASSWORD:
|
PASSWORD:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
commands:
|
|
||||||
- powershell.exe scripts/windows/tag.ps1
|
|
||||||
when:
|
|
||||||
event: [ tag ]
|
|
||||||
|
|
||||||
depends_on:
|
- name: build-ecr
|
||||||
- testing
|
commands:
|
||||||
|
- go build -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr
|
||||||
|
- docker login -u $env:USERNAME -p $env:PASSWORD
|
||||||
|
- |
|
||||||
|
$tag="windows-1809-amd64"
|
||||||
|
if (Test-Path env:DRONE_SEMVER_SHORT) {
|
||||||
|
$tag="$env:DRONE_SEMVER_SHORT-windows-1809-amd64"
|
||||||
|
}
|
||||||
|
docker build -f docker/ecr/Dockerfile.windows.1809 -t plugins/ecr:$tag .
|
||||||
|
docker push plugins/ecr:$tag
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: "0"
|
||||||
|
USERNAME:
|
||||||
|
from_secret: docker_username
|
||||||
|
PASSWORD:
|
||||||
|
from_secret: docker_password
|
||||||
|
|
||||||
|
- name: build-acr
|
||||||
|
commands:
|
||||||
|
- go build -o release/windows/amd64/drone-acr.exe ./cmd/drone-acr
|
||||||
|
- docker login -u $env:USERNAME -p $env:PASSWORD
|
||||||
|
- |
|
||||||
|
$tag="windows-1809-amd64"
|
||||||
|
if (Test-Path env:DRONE_SEMVER_SHORT) {
|
||||||
|
$tag="$env:DRONE_SEMVER_SHORT-windows-1809-amd64"
|
||||||
|
}
|
||||||
|
docker build -f docker/acr/Dockerfile.windows.1809 -t plugins/acr:$tag .
|
||||||
|
docker push plugins/acr:$tag
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: "0"
|
||||||
|
USERNAME:
|
||||||
|
from_secret: docker_username
|
||||||
|
PASSWORD:
|
||||||
|
from_secret: docker_password
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
ref:
|
event:
|
||||||
- refs/heads/master
|
- push
|
||||||
- refs/tags/*
|
- tag
|
||||||
- "refs/pull/**"
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: ssh
|
|
||||||
name: windows-1809-ecr
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: windows
|
|
||||||
|
|
||||||
server:
|
|
||||||
host: windows.1809.amd64.plugins.drone.ci
|
|
||||||
password:
|
|
||||||
from_secret: windows_password
|
|
||||||
user:
|
|
||||||
from_secret: windows_username
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build_latest
|
|
||||||
environment:
|
|
||||||
VERSION: 1809
|
|
||||||
REGISTRY: ecr
|
|
||||||
USERNAME:
|
|
||||||
from_secret: docker_username
|
|
||||||
PASSWORD:
|
|
||||||
from_secret: docker_password
|
|
||||||
commands:
|
|
||||||
- powershell.exe scripts/windows/latest.ps1
|
|
||||||
when:
|
|
||||||
event: [ push ]
|
|
||||||
|
|
||||||
- name: build_tag
|
|
||||||
environment:
|
|
||||||
VERSION: 1809
|
|
||||||
REGISTRY: ecr
|
|
||||||
USERNAME:
|
|
||||||
from_secret: docker_username
|
|
||||||
PASSWORD:
|
|
||||||
from_secret: docker_password
|
|
||||||
commands:
|
|
||||||
- powershell.exe scripts/windows/tag.ps1
|
|
||||||
when:
|
|
||||||
event: [ tag ]
|
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- testing
|
- testing
|
||||||
- windows-1809-docker
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/*
|
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: ssh
|
type: ssh
|
||||||
name: windows-1809-gcr
|
name: windows-1909
|
||||||
|
|
||||||
platform:
|
|
||||||
os: windows
|
|
||||||
|
|
||||||
server:
|
|
||||||
host: windows.1809.amd64.plugins.drone.ci
|
|
||||||
password:
|
|
||||||
from_secret: windows_password
|
|
||||||
user:
|
|
||||||
from_secret: windows_username
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build_latest
|
|
||||||
environment:
|
|
||||||
VERSION: 1809
|
|
||||||
REGISTRY: gcr
|
|
||||||
USERNAME:
|
|
||||||
from_secret: docker_username
|
|
||||||
PASSWORD:
|
|
||||||
from_secret: docker_password
|
|
||||||
commands:
|
|
||||||
- powershell.exe scripts/windows/latest.ps1
|
|
||||||
when:
|
|
||||||
event: [ push ]
|
|
||||||
|
|
||||||
- name: build_tag
|
|
||||||
environment:
|
|
||||||
VERSION: 1809
|
|
||||||
REGISTRY: gcr
|
|
||||||
USERNAME:
|
|
||||||
from_secret: docker_username
|
|
||||||
PASSWORD:
|
|
||||||
from_secret: docker_password
|
|
||||||
commands:
|
|
||||||
- powershell.exe scripts/windows/tag.ps1
|
|
||||||
when:
|
|
||||||
event: [ tag ]
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- testing
|
|
||||||
- windows-1809-ecr
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/*
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: ssh
|
|
||||||
name: windows-1809-acr
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: windows
|
|
||||||
|
|
||||||
server:
|
|
||||||
host: windows.1809.amd64.plugins.drone.ci
|
|
||||||
password:
|
|
||||||
from_secret: windows_password
|
|
||||||
user:
|
|
||||||
from_secret: windows_username
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build_latest
|
|
||||||
environment:
|
|
||||||
VERSION: 1809
|
|
||||||
REGISTRY: acr
|
|
||||||
USERNAME:
|
|
||||||
from_secret: docker_username
|
|
||||||
PASSWORD:
|
|
||||||
from_secret: docker_password
|
|
||||||
commands:
|
|
||||||
- powershell.exe scripts/windows/latest.ps1
|
|
||||||
when:
|
|
||||||
event: [ push ]
|
|
||||||
|
|
||||||
- name: build_tag
|
|
||||||
environment:
|
|
||||||
VERSION: 1809
|
|
||||||
REGISTRY: acr
|
|
||||||
USERNAME:
|
|
||||||
from_secret: docker_username
|
|
||||||
PASSWORD:
|
|
||||||
from_secret: docker_password
|
|
||||||
commands:
|
|
||||||
- powershell.exe scripts/windows/tag.ps1
|
|
||||||
when:
|
|
||||||
event: [ tag ]
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- testing
|
|
||||||
- windows-1809-gcr
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/*
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: ssh
|
|
||||||
name: windows-1909-docker
|
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
os: windows
|
os: windows
|
||||||
@@ -254,190 +149,86 @@ server:
|
|||||||
from_secret: windows_username
|
from_secret: windows_username
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build_latest
|
- name: build-docker
|
||||||
|
commands:
|
||||||
|
- go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker
|
||||||
|
- docker login -u $env:USERNAME -p $env:PASSWORD
|
||||||
|
- |
|
||||||
|
$tag="windows-1909-amd64"
|
||||||
|
if (Test-Path env:DRONE_SEMVER_SHORT) {
|
||||||
|
$tag="$env:DRONE_SEMVER_SHORT-windows-1909-amd64"
|
||||||
|
}
|
||||||
|
docker build -f docker/docker/Dockerfile.windows.1909 -t plugins/docker:$tag .
|
||||||
|
docker push plugins/docker:$tag
|
||||||
environment:
|
environment:
|
||||||
VERSION: 1909
|
CGO_ENABLED: "0"
|
||||||
REGISTRY: docker
|
|
||||||
USERNAME:
|
USERNAME:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
PASSWORD:
|
PASSWORD:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
commands:
|
|
||||||
- powershell.exe scripts/windows/latest.ps1
|
|
||||||
when:
|
|
||||||
event: [ push ]
|
|
||||||
|
|
||||||
- name: build_tag
|
- name: build-gcr
|
||||||
|
commands:
|
||||||
|
- go build -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr
|
||||||
|
- docker login -u $env:USERNAME -p $env:PASSWORD
|
||||||
|
- |
|
||||||
|
$tag="windows-1909-amd64"
|
||||||
|
if (Test-Path env:DRONE_SEMVER_SHORT) {
|
||||||
|
$tag="$env:DRONE_SEMVER_SHORT-windows-1909-amd64"
|
||||||
|
}
|
||||||
|
docker build -f docker/gcr/Dockerfile.windows.1909 -t plugins/gcr:$tag .
|
||||||
|
docker push plugins/gcr:$tag
|
||||||
environment:
|
environment:
|
||||||
VERSION: 1909
|
CGO_ENABLED: "0"
|
||||||
REGISTRY: docker
|
|
||||||
USERNAME:
|
USERNAME:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
PASSWORD:
|
PASSWORD:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
|
|
||||||
|
- name: build-ecr
|
||||||
commands:
|
commands:
|
||||||
- powershell.exe scripts/windows/tag.ps1
|
- go build -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr
|
||||||
when:
|
- docker login -u $env:USERNAME -p $env:PASSWORD
|
||||||
event: [ tag ]
|
- |
|
||||||
|
$tag="windows-1909-amd64"
|
||||||
|
if (Test-Path env:DRONE_SEMVER_SHORT) {
|
||||||
|
$tag="$env:DRONE_SEMVER_SHORT-windows-1909-amd64"
|
||||||
|
}
|
||||||
|
docker build -f docker/ecr/Dockerfile.windows.1909 -t plugins/ecr:$tag .
|
||||||
|
docker push plugins/ecr:$tag
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: "0"
|
||||||
|
USERNAME:
|
||||||
|
from_secret: docker_username
|
||||||
|
PASSWORD:
|
||||||
|
from_secret: docker_password
|
||||||
|
|
||||||
|
- name: build-acr
|
||||||
|
commands:
|
||||||
|
- go build -o release/windows/amd64/drone-acr.exe ./cmd/drone-acr
|
||||||
|
- docker login -u $env:USERNAME -p $env:PASSWORD
|
||||||
|
- |
|
||||||
|
$tag="windows-1909-amd64"
|
||||||
|
if (Test-Path env:DRONE_SEMVER_SHORT) {
|
||||||
|
$tag="$env:DRONE_SEMVER_SHORT-windows-1909-amd64"
|
||||||
|
}
|
||||||
|
docker build -f docker/acr/Dockerfile.windows.1909 -t plugins/acr:$tag .
|
||||||
|
docker push plugins/acr:$tag
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: "0"
|
||||||
|
USERNAME:
|
||||||
|
from_secret: docker_username
|
||||||
|
PASSWORD:
|
||||||
|
from_secret: docker_password
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- tag
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- testing
|
- testing
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/*
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: ssh
|
|
||||||
name: windows-1909-ecr
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: windows
|
|
||||||
|
|
||||||
server:
|
|
||||||
host: windows.1909.amd64.plugins.drone.ci
|
|
||||||
password:
|
|
||||||
from_secret: windows_password
|
|
||||||
user:
|
|
||||||
from_secret: windows_username
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build_latest
|
|
||||||
environment:
|
|
||||||
VERSION: 1909
|
|
||||||
REGISTRY: ecr
|
|
||||||
USERNAME:
|
|
||||||
from_secret: docker_username
|
|
||||||
PASSWORD:
|
|
||||||
from_secret: docker_password
|
|
||||||
commands:
|
|
||||||
- powershell.exe scripts/windows/latest.ps1
|
|
||||||
when:
|
|
||||||
event: [ push ]
|
|
||||||
|
|
||||||
- name: build_tag
|
|
||||||
environment:
|
|
||||||
VERSION: 1909
|
|
||||||
REGISTRY: ecr
|
|
||||||
USERNAME:
|
|
||||||
from_secret: docker_username
|
|
||||||
PASSWORD:
|
|
||||||
from_secret: docker_password
|
|
||||||
commands:
|
|
||||||
- powershell.exe scripts/windows/tag.ps1
|
|
||||||
when:
|
|
||||||
event: [ tag ]
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- testing
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/*
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: ssh
|
|
||||||
name: windows-1909-gcr
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: windows
|
|
||||||
|
|
||||||
server:
|
|
||||||
host: windows.1909.amd64.plugins.drone.ci
|
|
||||||
password:
|
|
||||||
from_secret: windows_password
|
|
||||||
user:
|
|
||||||
from_secret: windows_username
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build_latest
|
|
||||||
environment:
|
|
||||||
VERSION: 1909
|
|
||||||
REGISTRY: gcr
|
|
||||||
USERNAME:
|
|
||||||
from_secret: docker_username
|
|
||||||
PASSWORD:
|
|
||||||
from_secret: docker_password
|
|
||||||
commands:
|
|
||||||
- powershell.exe scripts/windows/latest.ps1
|
|
||||||
when:
|
|
||||||
event: [ push ]
|
|
||||||
|
|
||||||
- name: build_tag
|
|
||||||
environment:
|
|
||||||
VERSION: 1909
|
|
||||||
REGISTRY: gcr
|
|
||||||
USERNAME:
|
|
||||||
from_secret: docker_username
|
|
||||||
PASSWORD:
|
|
||||||
from_secret: docker_password
|
|
||||||
commands:
|
|
||||||
- powershell.exe scripts/windows/tag.ps1
|
|
||||||
when:
|
|
||||||
event: [ tag ]
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- testing
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/*
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: ssh
|
|
||||||
name: windows-1909-acr
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: windows
|
|
||||||
|
|
||||||
server:
|
|
||||||
host: windows.1909.amd64.plugins.drone.ci
|
|
||||||
password:
|
|
||||||
from_secret: windows_password
|
|
||||||
user:
|
|
||||||
from_secret: windows_username
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build_latest
|
|
||||||
environment:
|
|
||||||
VERSION: 1909
|
|
||||||
REGISTRY: acr
|
|
||||||
USERNAME:
|
|
||||||
from_secret: docker_username
|
|
||||||
PASSWORD:
|
|
||||||
from_secret: docker_password
|
|
||||||
commands:
|
|
||||||
- powershell.exe scripts/windows/latest.ps1
|
|
||||||
when:
|
|
||||||
event: [ push ]
|
|
||||||
|
|
||||||
- name: build_tag
|
|
||||||
environment:
|
|
||||||
VERSION: 1909
|
|
||||||
REGISTRY: acr
|
|
||||||
USERNAME:
|
|
||||||
from_secret: docker_username
|
|
||||||
PASSWORD:
|
|
||||||
from_secret: docker_password
|
|
||||||
commands:
|
|
||||||
- powershell.exe scripts/windows/tag.ps1
|
|
||||||
when:
|
|
||||||
event: [ tag ]
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- testing
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
ref:
|
|
||||||
- refs/heads/master
|
|
||||||
- refs/tags/*
|
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: linux-amd64-docker
|
name: linux-amd64-docker
|
||||||
@@ -653,8 +444,8 @@ trigger:
|
|||||||
- "refs/tags/**"
|
- "refs/tags/**"
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- windows-1809-docker
|
- windows-1809
|
||||||
- windows-1909-docker
|
- windows-1909
|
||||||
- linux-amd64-docker
|
- linux-amd64-docker
|
||||||
- linux-arm64-docker
|
- linux-arm64-docker
|
||||||
- linux-arm-docker
|
- linux-arm-docker
|
||||||
@@ -859,8 +650,8 @@ trigger:
|
|||||||
- "refs/tags/**"
|
- "refs/tags/**"
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- windows-1809-gcr
|
- windows-1809
|
||||||
- windows-1909-gcr
|
- windows-1909
|
||||||
- linux-amd64-gcr
|
- linux-amd64-gcr
|
||||||
- linux-arm64-gcr
|
- linux-arm64-gcr
|
||||||
- linux-arm-gcr
|
- linux-arm-gcr
|
||||||
@@ -1065,8 +856,8 @@ trigger:
|
|||||||
- "refs/tags/**"
|
- "refs/tags/**"
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- windows-1809-ecr
|
- windows-1809
|
||||||
- windows-1909-ecr
|
- windows-1909
|
||||||
- linux-amd64-ecr
|
- linux-amd64-ecr
|
||||||
- linux-arm64-ecr
|
- linux-arm64-ecr
|
||||||
- linux-arm-ecr
|
- linux-arm-ecr
|
||||||
@@ -1474,10 +1265,11 @@ trigger:
|
|||||||
- "refs/tags/**"
|
- "refs/tags/**"
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- windows-1809-acr
|
- windows-1809
|
||||||
- windows-1909-acr
|
- windows-1909
|
||||||
- linux-amd64-acr
|
- linux-amd64-acr
|
||||||
- linux-arm64-acr
|
- linux-arm64-acr
|
||||||
- linux-arm-acr
|
- linux-arm-acr
|
||||||
|
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
# this script is used by the continuous integration server to
|
|
||||||
# build and publish the docker image for a commit to master.
|
|
||||||
|
|
||||||
$env:GOOS="windows"
|
|
||||||
$env:GOARCH="amd64"
|
|
||||||
$env:CGO_ENABLED="0"
|
|
||||||
|
|
||||||
if (-not (Test-Path env:VERSION)) {
|
|
||||||
$env:VERSION="1809"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (-not (Test-Path env:REGISTRY)) {
|
|
||||||
$env:REGISTRY="docker"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
echo $env:GOOS
|
|
||||||
echo $env:GOARCH
|
|
||||||
echo $env:VERSION
|
|
||||||
echo $env:REGISTRY
|
|
||||||
|
|
||||||
# build the binary
|
|
||||||
Write-Host "+ go build -o release/windows/amd64/drone-$env:REGISTRY.exe";
|
|
||||||
go build -o release/windows/amd64/drone-$env:REGISTRY.exe
|
|
||||||
|
|
||||||
# build and publish the docker image
|
|
||||||
docker login -u $env:USERNAME -p $env:PASSWORD
|
|
||||||
Write-Host "+ docker build -f docker/$env:REGISTRY/Dockerfile.windows.amd64.$env:VERSION -t plugins/$env:REGISTRY:windows-$env:VERSION-amd64 .";
|
|
||||||
docker build -f docker/$env:REGISTRY/Dockerfile.windows.amd64.$env:VERSION -t plugins/$env:REGISTRY:windows-$env:VERSION-amd64 .
|
|
||||||
Write-Host "+ docker push plugins/$env:REGISTRY:windows-$env:VERSION-amd64"
|
|
||||||
docker push plugins/$env:REGISTRY:windows-$env:VERSION-amd64
|
|
||||||
|
|
||||||
# remove images from local cache
|
|
||||||
Write-Host "+ docker rmi plugins/$env:REGISTRY:windows-$env:VERSION-amd64"
|
|
||||||
docker rmi plugins/$env:REGISTRY:windows-$env:VERSION-amd64
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
# this script is used by the continuous integration server to
|
|
||||||
# build and publish the docker image for a tagged revsision.
|
|
||||||
|
|
||||||
$env:GOOS="windows"
|
|
||||||
$env:GOARCH="amd64"
|
|
||||||
$env:CGO_ENABLED="0"
|
|
||||||
|
|
||||||
if (-not (Test-Path env:VERSION)) {
|
|
||||||
$env:VERSION="1809"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (-not (Test-Path env:DRONE_SEMVER_SHORT)) {
|
|
||||||
echo "missing semver"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
if (-not (Test-Path env:REGISTRY)) {
|
|
||||||
$env:REGISTRY="docker"
|
|
||||||
}
|
|
||||||
|
|
||||||
# define the image tags
|
|
||||||
$env:IMAGE_PATCH="plugins/$env:REGISTRY:$env:DRONE_SEMVER_SHORT-windows-$env:VERSION-amd64"
|
|
||||||
$env:IMAGE_MAJOR="plugins/$env:REGISTRY:$env:DRONE_SEMVER_MAJOR-windows-$env:VERSION-amd64"
|
|
||||||
$env:IMAGE_MINOR="plugins/$env:REGISTRY:$env:DRONE_SEMVER_MAJOR.$env:DRONE_SEMVER_MINOR-windows-$env:VERSION-amd64"
|
|
||||||
|
|
||||||
echo "build environment:"
|
|
||||||
echo $env:GOOS
|
|
||||||
echo $env:GOARCH
|
|
||||||
echo $env:VERSION
|
|
||||||
|
|
||||||
# build the binary
|
|
||||||
go build -o release/windows/amd64/drone-$env:REGISTRY.exe
|
|
||||||
|
|
||||||
# authenticate with the docker registry
|
|
||||||
docker login -u $env:USERNAME -p $env:PASSWORD
|
|
||||||
|
|
||||||
echo "building images:"
|
|
||||||
echo $env:IMAGE_PATCH
|
|
||||||
echo $env:IMAGE_MINOR
|
|
||||||
echo $env:IMAGE_MAJOR
|
|
||||||
|
|
||||||
# build and tag the docker images
|
|
||||||
docker build -f docker/$env:REGISTRY/Dockerfile.windows.amd64.$env:VERSION -t $env:IMAGE_PATCH .
|
|
||||||
docker tag $env:IMAGE_PATCH $env:IMAGE_MAJOR
|
|
||||||
docker tag $env:IMAGE_PATCH $env:IMAGE_MINOR
|
|
||||||
|
|
||||||
# publish the docker images
|
|
||||||
docker push $env:IMAGE_MAJOR
|
|
||||||
docker push $env:IMAGE_MINOR
|
|
||||||
docker push $env:IMAGE_PATCH
|
|
||||||
|
|
||||||
# remove images after from local cache
|
|
||||||
docker rmi $env:IMAGE_MAJOR
|
|
||||||
docker rmi $env:IMAGE_MINOR
|
|
||||||
docker rmi $env:IMAGE_PATCH
|
|
||||||
Reference in New Issue
Block a user