Add extra tags
Some checks failed
continuous-integration/drone Build is failing

This commit is contained in:
Aode (lion) 2022-01-31 14:43:48 -06:00
parent 299b604170
commit ef5aaef043
3 changed files with 25 additions and 4 deletions

View file

@ -6,6 +6,11 @@ platform:
arch: amd64
steps:
- name: extra-tags
image: busybox:latest
commands:
- echo "$BASE_TAG-$GIT_BRANCH-linux-amd64,$GIT_BRANCH-linux-amd64" | sed 's/\//-/g' > .tags
- name: push
image: plugins/docker:20
settings:
@ -20,7 +25,7 @@ steps:
- REPO_ARCH=amd64
- GIT_REPOSITORY=https://git.asonix.dog/asonix/mastodon
build_args_from_env:
- GIT_TAG
- GIT_BRANCH
trigger:
event:
@ -36,6 +41,11 @@ platform:
arch: arm64
steps:
- name: extra-tags
image: busybox:latest
commands:
- echo "$BASE_TAG-$GIT_BRANCH-linux-arm64v8,$GIT_BRANCH-linux-arm64v8" | sed 's/\//-/g' > .tags
- name: push
image: plugins/docker:20
settings:
@ -50,7 +60,7 @@ steps:
- REPO_ARCH=arm64v8
- GIT_REPOSITORY=https://git.asonix.dog/asonix/mastodon
build_args_from_env:
- GIT_TAG
- GIT_BRANCH
trigger:
event:
@ -66,6 +76,11 @@ platform:
arch: amd64
steps:
- name: extra-tags
image: busybox:latest
commands:
- echo "$BASE_TAG-$GIT_BRANCH,$GIT_BRANCH" | sed 's/\//-/g' > .tags
- name: manifest
image: plugins/manifest:1
settings:

View file

@ -3,7 +3,7 @@ ARG REPO_ARCH
FROM $REPO_ARCH/ruby:2.7-alpine3.15
# Set up git remote
ARG GIT_TAG
ARG GIT_BRANCH
ARG GIT_REPOSITORY
# Tell rails to serve static files
@ -33,7 +33,7 @@ RUN echo "Etc/UTC" > /etc/localtime && \
# Install mastodon
USER mastodon
RUN git clone -b ${GIT_TAG} ${GIT_REPOSITORY} /opt/mastodon && \
RUN git clone -b ${GIT_BRANCH} ${GIT_REPOSITORY} /opt/mastodon && \
rm -rf /opt/mastodon/.git
# Install dependencies

View file

@ -1,4 +1,10 @@
image: asonix/mastodon:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
-
image: asonix/mastodon:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64