setup windows distribution
This commit is contained in:
105
.drone.yml
105
.drone.yml
@@ -82,6 +82,106 @@ volumes:
|
|||||||
- name: go
|
- name: go
|
||||||
temp: {}
|
temp: {}
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- none
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: ssh
|
||||||
|
name: window-1903
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: windows
|
||||||
|
|
||||||
|
server:
|
||||||
|
host: windows.1903.amd64.ssh.pipeline.drone.ci
|
||||||
|
password:
|
||||||
|
from_secret: windows_password
|
||||||
|
user:
|
||||||
|
from_secret: windows_username
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build_latest
|
||||||
|
environment:
|
||||||
|
VERSION: 1903
|
||||||
|
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: 1903
|
||||||
|
USERNAME:
|
||||||
|
from_secret: docker_username
|
||||||
|
PASSWORD:
|
||||||
|
from_secret: docker_password
|
||||||
|
commands:
|
||||||
|
- powershell.exe scripts/windows/latest.ps1
|
||||||
|
when:
|
||||||
|
event: [ tag ]
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- linux
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- refs/heads/master
|
||||||
|
- refs/tags/*
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: ssh
|
||||||
|
name: window-1809
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: windows
|
||||||
|
|
||||||
|
server:
|
||||||
|
host: windows.1809.amd64.ssh.pipeline.drone.ci
|
||||||
|
password:
|
||||||
|
from_secret: windows_password
|
||||||
|
user:
|
||||||
|
from_secret: windows_username
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build_latest
|
||||||
|
environment:
|
||||||
|
VERSION: 1809
|
||||||
|
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
|
||||||
|
USERNAME:
|
||||||
|
from_secret: docker_username
|
||||||
|
PASSWORD:
|
||||||
|
from_secret: docker_password
|
||||||
|
commands:
|
||||||
|
- powershell.exe scripts/windows/latest.ps1
|
||||||
|
when:
|
||||||
|
event: [ tag ]
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- linux
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- refs/heads/master
|
||||||
|
- refs/tags/*
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
@@ -100,9 +200,12 @@ steps:
|
|||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- linux
|
- windows-1903
|
||||||
|
- windows-1809
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
|
branch:
|
||||||
|
- none
|
||||||
ref:
|
ref:
|
||||||
- refs/heads/master
|
- refs/heads/master
|
||||||
- refs/tags/*
|
- refs/tags/*
|
||||||
|
|||||||
@@ -1,17 +1,24 @@
|
|||||||
# this script is used by the continuous integration server to
|
# this script is used by the continuous integration server to
|
||||||
# build and publish the docker image for a commit to master.
|
# build and publish the docker image for a commit to master.
|
||||||
|
|
||||||
$env:GOOS=windows
|
$env:GOOS="windows"
|
||||||
$env:GOARCH=amd64
|
$env:GOARCH="amd64"
|
||||||
$env:CGO_ENABLED=0
|
$env:CGO_ENABLED="0"
|
||||||
$env:VERSION=1809
|
|
||||||
|
if (-not (Test-Path env:VERSION)) {
|
||||||
|
$env:VERSION="1809"
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $env:GOOS
|
||||||
|
echo $env:GOARCH
|
||||||
|
echo $env:VERSION
|
||||||
|
|
||||||
# build the binary
|
# build the binary
|
||||||
go build -o release/windows/amd64/drone-runner-docker.exe
|
go build -o release/windows/amd64/drone-runner-docker.exe
|
||||||
|
|
||||||
# build and publish the docker image
|
# build and publish the docker image
|
||||||
docker login -u $env:USERNAME -p $env:PASSWORD
|
docker login -u $env:USERNAME -p $env:PASSWORD
|
||||||
docker build -f docker/Dockerfile.windows.$env:VERSION -t drone/drone-runner-docker:windows-$env:VERSION-amd64 .
|
docker build -f docker/Dockerfile.windows.amd64.$env:VERSION -t drone/drone-runner-docker:windows-$env:VERSION-amd64 .
|
||||||
docker push drone/drone-runner-docker:windows-$env:VERSION-amd64
|
docker push drone/drone-runner-docker:windows-$env:VERSION-amd64
|
||||||
|
|
||||||
# remove images from local cache
|
# remove images from local cache
|
||||||
|
|||||||
@@ -1,15 +1,28 @@
|
|||||||
# this script is used by the continuous integration server to
|
# this script is used by the continuous integration server to
|
||||||
# build and publish the docker image for a tagged revsision.
|
# build and publish the docker image for a tagged revsision.
|
||||||
|
|
||||||
$env:GOOS=windows
|
$env:GOOS="windows"
|
||||||
$env:GOARCH=amd64
|
$env:GOARCH="amd64"
|
||||||
$env:CGO_ENABLED=0
|
$env:CGO_ENABLED="0"
|
||||||
$env:VERSION=1903
|
|
||||||
|
if (-not (Test-Path env:VERSION)) {
|
||||||
|
$env:VERSION="1809"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-not (Test-Path env:DRONE_SEMVER_SHORT)) {
|
||||||
|
echo "missing semver"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
# define the image tags
|
# define the image tags
|
||||||
$env:IMAGE_PATCH=drone/drone-runner-docker:$env:DRONE_SEMVER_SHORT-windows-$env:VERSION-amd64
|
$env:IMAGE_PATCH="drone/drone-runner-docker:$env:DRONE_SEMVER_SHORT-windows-$env:VERSION-amd64"
|
||||||
$env:IMAGE_MAJOR=drone/drone-runner-docker:$env:DRONE_SEMVER_MAJOR-windows-$env:VERSION-amd64
|
$env:IMAGE_MAJOR="drone/drone-runner-docker:$env:DRONE_SEMVER_MAJOR-windows-$env:VERSION-amd64"
|
||||||
$env:IMAGE_MINOR=drone/drone-runner-docker:$env:DRONE_SEMVER_MAJOR.$env:DRONE_SEMVER_MINOR-windows-$env:VERSION-amd64
|
$env:IMAGE_MINOR="drone/drone-runner-docker:$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
|
# build the binary
|
||||||
go build -o release/windows/amd64/drone-runner-docker.exe
|
go build -o release/windows/amd64/drone-runner-docker.exe
|
||||||
@@ -17,8 +30,13 @@ go build -o release/windows/amd64/drone-runner-docker.exe
|
|||||||
# authenticate with the docker registry
|
# authenticate with the docker registry
|
||||||
docker login -u $env:USERNAME -p $env:PASSWORD
|
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
|
# build and tag the docker images
|
||||||
docker build -f docker/Dockerfile.windows.$env:VERSION -t $env:IMAGE_PATCH .
|
docker build -f docker/Dockerfile.windows.amd64.$env:VERSION -t $env:IMAGE_PATCH .
|
||||||
docker tag $env:IMAGE_PATCH $env:IMAGE_MAJOR
|
docker tag $env:IMAGE_PATCH $env:IMAGE_MAJOR
|
||||||
docker tag $env:IMAGE_PATCH $env:IMAGE_MINOR
|
docker tag $env:IMAGE_PATCH $env:IMAGE_MINOR
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user