Refactor to Ulf's suggestions

This commit is contained in:
Wolfgang Huß 2021-05-12 08:52:39 +02:00
parent b57e1f23e2
commit ef1b2e7b7f
3 changed files with 17 additions and 22 deletions

View File

@ -1,9 +1,10 @@
name: ocelot.social publish branded CI
on:
push:
branches:
- master
# Wolle on:
# push:
# branches:
# - master
on: [push]
jobs:
##############################################################################
@ -98,25 +99,20 @@ jobs:
##########################################################################
- name: ENV - VERSION
run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV
- name: ENV - BUILD_NUMBER
run: echo "BUILD_NUMBER=$(node -p -e "require('./package.json').build-number")" >> $GITHUB_ENV
- name: ENV - DOCKER_ORGANISATION_SOURCE
run: echo "DOCKER_ORGANISATION_SOURCE=$(node -p -e "require('./package.json').docker-organisation-source")" >> $GITHUB_ENV
- name: ENV - DOCKER_ORGANISATION_PUSH
run: echo "DOCKER_ORGANISATION_PUSH=$(node -p -e "require('./package.json').docker-organisation-push")" >> $GITHUB_ENV
- name: ENV - BUILD_DATE
run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
- name: ENV - OCELOT_DOCKER_VERSION_TAG
run: echo "OCELOT_DOCKER_VERSION_TAG=$(node -p -e "require('./package.json').ocelot-docker-version-tag")" >> $GITHUB_ENV
- name: ENV - DOCKER_ORGANISATION
run: echo "DOCKER_ORGANISATION=$(node -p -e "require('./package.json').docker-organisation")" >> $GITHUB_ENV
# this is oriented on the node docker version tag "node:12.19.0-alpine3.10" and looks like "app-branded:1.0.2-3-ocelot.social1.0.2-79"
- name: ENV - BUILD_VERSION
run: echo "BUILD_VERSION=${VERSION}-${BUILD_NUMBER}" >> $GITHUB_ENV
- name: ENV - BUILD_COMMIT
run: echo "BUILD_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV
run: echo "BUILD_VERSION=${VERSION}-${GITHUB_RUN_NUMBER}-ocelot.social${OCELOT_DOCKER_VERSION_TAG}" >> $GITHUB_ENV
##########################################################################
# BUILD WEBAPP DOCKER IMAGE (build) ######################################
##########################################################################
- name: webapp | Build `branded` image
run: |
docker build --target branded -t "${DOCKER_ORGANISATION_PUSH}/webapp-branded:latest" -t "${DOCKER_ORGANISATION_PUSH}/webapp-branded:${VERSION}" -t "${DOCKER_ORGANISATION_PUSH}/webapp-branded:${BUILD_VERSION}" -f docker/webapp.Dockerfile --build-arg APP_IMAGE=${DOCKER_ORGANISATION_SOURCE}/webapp:${BUILD_VERSION} .
docker save "${DOCKER_ORGANISATION_PUSH}/webapp-branded" > /tmp/webapp-branded.tar
docker build --target branded -t "${DOCKER_ORGANISATION}/webapp-branded:latest" -t "${DOCKER_ORGANISATION}/webapp-branded:${BUILD_VERSION}" -f docker/webapp.Dockerfile --build-arg APP_IMAGE=ocelotsocialnetwork/webapp:${OCELOT_DOCKER_VERSION_TAG} .
docker save "${DOCKER_ORGANISATION}/webapp-branded" > /tmp/webapp-branded.tar
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:

View File

@ -5,9 +5,9 @@ version: "1.0.0"
# The appVersion defines which docker image is pulled.
# Having it set to latest will pull the latest build on dockerhub.
# You are free to define a specific version here tho.
# e.g. appVersion: "1.0.2-79"
# e.g. appVersion: "latest" or "1.0.2-3-ocelot.social1.0.2-79"
# Be aware that this requires all your apps to have the same docker image version available.
appVersion: "1.0.2-79"
appVersion: "latest"
description: The Helm chart for ocelot.social
home: https://ocelot.social
sources:

View File

@ -1,9 +1,8 @@
{
"name": "ocelot-social-branded",
"version": "1.0.2",
"build-number": "79",
"docker-organisation-source": "ocelotsocialnetwork",
"docker-organisation-push": "ocelotsocialnetwork",
"ocelot-docker-version-tag": "1.0.2-79",
"docker-organisation": "ocelotsocialnetwork",
"description": "Ocelot Social Branded",
"author": "ocelot.social Community",
"license": "MIT",