Browse Source

Merge pull request #1319 from erikwilson/manifest

Update manifest publish
pull/1321/head
Erik Wilson 5 years ago committed by GitHub
parent
commit
6592b61210
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      .drone.yml
  2. 16
      Dockerfile.manifest
  3. 16
      scripts/manifest

19
.drone.yml

@ -259,17 +259,20 @@ platform:
steps:
- name: manifest
image: rancher/dapper:v0.4.2
image: plugins/docker
environment:
USERNAME:
DOCKER_USERNAME:
from_secret: docker_username
PASSWORD:
DOCKER_PASSWORD:
from_secret: docker_password
commands:
- export DOCKER_TAG=$(echo "${DRONE_TAG}" | sed -e 's/+/-/g')
- docker login -u $env:USERNAME -p $env:PASSWORD
- docker manifest create ${DOCKER_TAG} ${DOCKER_TAG}-amd64 ${DOCKER_TAG}-arm64 ${DOCKER_TAG}-arm
- docker manifest push ${DOCKER_TAG}
settings:
dry_run: true
dockerfile: Dockerfile.manifest
repo: "rancher/k3s-manifest"
build_args_from_env:
- DOCKER_USERNAME
- DOCKER_PASSWORD
- DRONE_TAG
when:
instance:
- drone-publish.rancher.io

16
Dockerfile.manifest

@ -0,0 +1,16 @@
FROM golang:1.13.5-alpine3.10
COPY --from=plugins/manifest:1.2.3 /bin/* /bin/
ARG DOCKER_USERNAME
ENV DOCKER_USERNAME $DOCKER_USERNAME
ARG DOCKER_PASSWORD
ENV DOCKER_PASSWORD $DOCKER_PASSWORD
ARG DRONE_TAG
ENV DRONE_TAG $DRONE_TAG
COPY ./scripts/manifest /bin/
RUN manifest

16
scripts/manifest

@ -0,0 +1,16 @@
#!/bin/sh
if [ -z "${DRONE_TAG}" ]; then
echo "DRONE_TAG not defined" >&2
exit 1
fi
set -e -x
export REPO="rancher/k3s"
export DRONE_TAG=$(echo "${DRONE_TAG}" | sed -e 's/+/-/g')
export PLUGIN_TARGET="${REPO}:${DRONE_TAG}"
export PLUGIN_TEMPLATE="${REPO}:${DRONE_TAG}-ARCH"
export PLUGIN_PLATFORMS="linux/amd64,linux/arm64,linux/arm"
drone-manifest
Loading…
Cancel
Save