Skip to content

Commit

Permalink
Merge pull request #28 from tphoney/windows_2022
Browse files Browse the repository at this point in the history
(feat) adding windows ltsc2022
  • Loading branch information
TP Honey authored Apr 17, 2023
2 parents e56ef4a + bc635ae commit 12cfd6f
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 16 deletions.
68 changes: 58 additions & 10 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ platform:

steps:
- name: build-push
pull: always
image: golang:1.18
commands:
- 'go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/plugin'
Expand All @@ -39,7 +38,6 @@ steps:
- tag

- name: build-tag
pull: always
image: golang:1.18
commands:
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/plugin'
Expand All @@ -50,7 +48,6 @@ steps:
- tag

- name: publish
pull: always
image: plugins/docker:linux-amd64
settings:
auto_tag: true
Expand Down Expand Up @@ -78,6 +75,7 @@ depends_on:
---
kind: pipeline
name: linux-arm64
type: vm
pool:
use: ubuntu_arm64

Expand All @@ -87,7 +85,6 @@ platform:

steps:
- name: build-push
pull: always
image: golang:1.18
commands:
- 'go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/plugin'
Expand All @@ -99,7 +96,6 @@ steps:
- tag

- name: build-tag
pull: always
image: golang:1.18
commands:
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/plugin'
Expand All @@ -110,7 +106,6 @@ steps:
- tag

- name: publish
pull: always
image: plugins/docker:linux-arm64
settings:
auto_tag: true
Expand Down Expand Up @@ -148,7 +143,6 @@ platform:

steps:
- name: build-push
pull: always
image: golang:1.18
commands:
- 'go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/windows/amd64/plugin'
Expand All @@ -159,7 +153,6 @@ steps:
exclude:
- tag
- name: build-tag
pull: always
image: golang:1.18
commands:
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/windows/amd64/plugin'
Expand All @@ -169,7 +162,6 @@ steps:
event:
- tag
- name: publish
pull: always
image: plugins/docker@sha256:f0233d950ae87ee6cb5500b2d5497fe02aa338201c0bdce2619f443fd174cfa4
settings:
auto_tag: true
Expand All @@ -194,6 +186,62 @@ trigger:
- refs/tags/**
- "refs/pull/**"

---
kind: pipeline
type: vm
name: windows-ltsc2022-amd64

pool:
use: windows-2022

platform:
os: windows

steps:
- name: build-push
image: golang:1.18
commands:
- 'go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/windows/amd64/plugin'
environment:
CGO_ENABLED: 0
when:
event:
exclude:
- tag
- name: build-tag
image: golang:1.18
commands:
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/windows/amd64/plugin'
environment:
CGO_ENABLED: 0
when:
event:
- tag
- name: publish
image: plugins/docker@sha256:f0233d950ae87ee6cb5500b2d5497fe02aa338201c0bdce2619f443fd174cfa4
settings:
auto_tag: true
auto_tag_suffix: windows-ltsc2022-amd64
dockerfile: docker/Dockerfile.windows.amd64.ltsc2022
password:
from_secret: docker_password
repo: plugins/artifactory
username:
from_secret: docker_username
when:
event:
exclude:
- pull_request

depends_on:
- testing

trigger:
ref:
- refs/heads/main
- refs/tags/**
- "refs/pull/**"

---
kind: pipeline
name: notifications
Expand All @@ -208,7 +256,6 @@ platform:

steps:
- name: manifest
pull: always
image: plugins/manifest
settings:
ignore_missing: "true"
Expand All @@ -228,3 +275,4 @@ depends_on:
- linux-amd64
- linux-arm64
- windows-1809-amd64
- windows-ltsc2022-amd64
2 changes: 1 addition & 1 deletion docker/Dockerfile.linux.amd64
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
RUN apk add --update \
curl \
&& rm -rf /var/cache/apk/*
RUN curl -fL https://getcli.jfrog.io/v2-jf | sh /dev/stdin 2.18.2
RUN curl -fL https://getcli.jfrog.io/v2-jf | sh /dev/stdin 2.36.1
RUN mv ./jf /usr/local/bin/jfrog
RUN chmod +x /usr/local/bin/jfrog

Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.linux.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
RUN apk add --update \
curl \
&& rm -rf /var/cache/apk/*
RUN curl -fL https://getcli.jfrog.io | sh /dev/stdin 1.35.5
RUN curl -fL https://getcli.jfrog.io | sh /dev/stdin 2.36.1
RUN mv ./jfrog /usr/local/bin/
RUN chmod +x /usr/local/bin/jfrog

ADD release/linux/arm64/plugin /bin/
ENTRYPOINT ["/bin/plugin"]
ENTRYPOINT ["/bin/plugin"]
4 changes: 2 additions & 2 deletions docker/Dockerfile.windows.amd64.1809
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ USER ContainerAdministrator

ENV GODEBUG=netdns=go
RUN mkdir /bin
RUN Invoke-WebRequest https://releases.jfrog.io/artifactory/jfrog-cli/v2/2.10.0/jfrog-cli-windows-amd64/jfrog.exe -OutFile C:/bin/jfrog.exe
RUN Invoke-WebRequest https://releases.jfrog.io/artifactory/jfrog-cli/v2/2.36.1/jfrog-cli-windows-amd64/jfrog.exe -OutFile C:/bin/jfrog.exe
ADD release/windows/amd64/plugin C:/bin/drone-artifactory.exe

ENTRYPOINT [ "C:\\bin\\drone-artifactory.exe" ]
ENTRYPOINT [ "C:\\bin\\drone-artifactory.exe" ]
12 changes: 12 additions & 0 deletions docker/Dockerfile.windows.amd64.ltsc2022
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# escape=`

FROM mcr.microsoft.com/windows/servercore:ltsc2022
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
USER ContainerAdministrator

ENV GODEBUG=netdns=go
RUN mkdir /bin
RUN Invoke-WebRequest https://releases.jfrog.io/artifactory/jfrog-cli/v2/2.36.1/jfrog-cli-windows-amd64/jfrog.exe -OutFile C:/bin/jfrog.exe
ADD release/windows/amd64/plugin C:/bin/drone-artifactory.exe

ENTRYPOINT [ "C:\\bin\\drone-artifactory.exe" ]
8 changes: 7 additions & 1 deletion docker/manifest.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@ manifests:
platform:
architecture: amd64
os: windows
version: 1809
version: 1809
-
image: plugins/artifactory:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-ltsc2022-amd64
platform:
architecture: amd64
os: windows
version: ltsc2022

0 comments on commit 12cfd6f

Please sign in to comment.