Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ECR Public registry #357

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ local pipeline = import 'pipeline.libsonnet';
'linux-arm',
]),

pipeline.build('ecr-public', 'linux', 'amd64'),
pipeline.build('ecr-public', 'linux', 'arm64'),
pipeline.build('ecr-public', 'linux', 'arm'),
pipeline.notifications('ecr-public', depends_on=[
'linux-amd64',
'linux-arm64',
'linux-arm',
]),

pipeline.build('heroku', 'linux', 'amd64'),
pipeline.build('heroku', 'linux', 'arm64'),
pipeline.build('heroku', 'linux', 'arm'),
Expand Down
309 changes: 308 additions & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,57 @@ trigger:
- refs/heads/master
- refs/tags/*

---
kind: pipeline
type: ssh
name: windows-1809-ecr-public

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-public
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-public
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
Expand Down Expand Up @@ -182,7 +233,7 @@ steps:

depends_on:
- testing
- windows-1809-ecr
- windows-1809-ecr-public

trigger:
ref:
Expand Down Expand Up @@ -340,6 +391,56 @@ trigger:
- refs/heads/master
- refs/tags/*

---
kind: pipeline
type: ssh
name: windows-1909-ecr-public

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-public
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-public
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
Expand Down Expand Up @@ -1073,6 +1174,212 @@ depends_on:
- linux-arm64-ecr
- linux-arm-ecr

---
kind: pipeline
name: linux-amd64-ecr-public

platform:
os: linux
arch: amd64

steps:
- name: build-push
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-ecr-public ./cmd/drone-ecr-public"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
exclude:
- tag

- name: build-tag
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-ecr-public ./cmd/drone-ecr-public"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag

- name: publish
image: plugins/docker:18
settings:
auto_tag: true
auto_tag_suffix: linux-amd64
daemon_off: false
dockerfile: docker/ecr-public/Dockerfile.linux.amd64
password:
from_secret: docker_password
repo: plugins/ecr-public
username:
from_secret: docker_username
when:
event:
exclude:
- pull_request

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

depends_on:
- linux-amd64-docker

---
kind: pipeline
name: linux-arm64-ecr-public

platform:
os: linux
arch: arm64

steps:
- name: build-push
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-ecr-public ./cmd/drone-ecr-public"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
exclude:
- tag

- name: build-tag
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-ecr-public ./cmd/drone-ecr-public"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag

- name: publish
image: plugins/docker:18
settings:
auto_tag: true
auto_tag_suffix: linux-arm64
daemon_off: false
dockerfile: docker/ecr-public/Dockerfile.linux.arm64
password:
from_secret: docker_password
repo: plugins/ecr-public
username:
from_secret: docker_username
when:
event:
exclude:
- pull_request

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

depends_on:
- linux-arm64-docker

---
kind: pipeline
name: linux-arm-ecr-public

platform:
os: linux
arch: arm

steps:
- name: build-push
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-ecr-public ./cmd/drone-ecr-public"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
exclude:
- tag

- name: build-tag
image: golang:1.17.3
commands:
- "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-ecr-public ./cmd/drone-ecr-public"
environment:
CGO_ENABLED: 0
GO111MODULE: on
when:
event:
- tag

- name: publish
image: plugins/docker:18
settings:
auto_tag: true
auto_tag_suffix: linux-arm
daemon_off: false
dockerfile: docker/ecr-public/Dockerfile.linux.arm
password:
from_secret: docker_password
repo: plugins/ecr-public
username:
from_secret: docker_username
when:
event:
exclude:
- pull_request

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

depends_on:
- linux-arm-docker

---
kind: pipeline
name: notifications-ecr-public

platform:
os: linux
arch: amd64

steps:
- name: manifest
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
password:
from_secret: docker_password
spec: docker/ecr-public/manifest.tmpl
username:
from_secret: docker_username

trigger:
ref:
- refs/heads/master
- "refs/tags/**"

depends_on:
- windows-1809-ecr-public
- windows-1909-ecr-public
- linux-amd64-ecr-public
- linux-arm64-ecr-public
- linux-arm-ecr-public

---
kind: pipeline
name: linux-amd64-heroku
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export GO111MODULE=on
go build -v -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker
go build -v -a -tags netgo -o release/linux/amd64/drone-gcr ./cmd/drone-gcr
go build -v -a -tags netgo -o release/linux/amd64/drone-ecr ./cmd/drone-ecr
go build -v -a -tags netgo -o release/linux/amd64/drone-ecr-public ./cmd/drone-ecr-public
go build -v -a -tags netgo -o release/linux/amd64/drone-acr ./cmd/drone-acr
go build -v -a -tags netgo -o release/linux/amd64/drone-heroku ./cmd/drone-heroku
```
Expand All @@ -47,6 +48,11 @@ docker build \
--label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \
--file docker/ecr/Dockerfile.linux.amd64 --tag plugins/ecr .

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/ecr-public/Dockerfile.linux.amd64 --tag plugins/ecr-public .

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) \
Expand Down Expand Up @@ -91,4 +97,4 @@ Run the changelog generator again with the future version according to semver.
docker run -it --rm -v "$(pwd)":/usr/local/src/your-app githubchangeloggenerator/github-changelog-generator -u drone-plugins -p drone-docker -t <secret token> --future-release v1.0.0
```

Create your pull request for the release. Get it merged then tag the release.
Create your pull request for the release. Get it merged then tag the release.
Loading