New version format
This commit is contained in:
parent
b72916a8d9
commit
ef17f800b1
@ -1,12 +1,12 @@
|
||||
name: Build dev on push
|
||||
run-name: Build dev on push
|
||||
name: Build on push
|
||||
run-name: Build on push
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
build-api:
|
||||
prepare:
|
||||
runs-on: [runner]
|
||||
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||
steps:
|
||||
@ -15,10 +15,48 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.CI_ACCESS_TOKEN }}
|
||||
|
||||
- name: Get Date and Build Number
|
||||
run: |
|
||||
DATE=$(date +'%Y.%m.%d')
|
||||
git fetch --tags
|
||||
TAG_COUNT=$(git tag -l "${DATE}.*" | wc -l)
|
||||
BUILD_NUMBER=$(($TAG_COUNT + 1))
|
||||
BUILD_VERSION="${DATE}.${BUILD_NUMBER}-dev"
|
||||
echo "$BUILD_VERSION" > version.txt
|
||||
|
||||
- name: Create Git Tag for Build
|
||||
run: |
|
||||
git config user.name "ci"
|
||||
git config user.email "dev@sh-edratf.de"
|
||||
git tag ${{ env.BUILD_VERSION }}
|
||||
git push origin ${{ env.BUILD_VERSION }}
|
||||
|
||||
- name: Upload build version artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: version
|
||||
path: version.txt
|
||||
|
||||
build-api:
|
||||
runs-on: [runner]
|
||||
needs: prepare
|
||||
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||
steps:
|
||||
- name: Clone Repository
|
||||
uses: https://github.com/actions/checkout@v3
|
||||
with:
|
||||
token: ${{ secrets.CI_ACCESS_TOKEN }}
|
||||
|
||||
- name: Download build version artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: version
|
||||
|
||||
- name: Build docker
|
||||
run: |
|
||||
cd api
|
||||
docker build -t git.sh-edraft.de/sh-edraft.de/open-redirect-api-dev:$(cat ../version.txt) .
|
||||
echo "VERSION = \"$(cat version.txt)\"" > version.py
|
||||
docker build -t git.sh-edraft.de/sh-edraft.de/open-redirect-api:$(cat ../version.txt) .
|
||||
|
||||
- name: Login to registry git.sh-edraft.de
|
||||
uses: https://github.com/docker/login-action@v1
|
||||
@ -29,10 +67,11 @@ jobs:
|
||||
|
||||
- name: Push image
|
||||
run: |
|
||||
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-api-dev:$(cat version.txt)
|
||||
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-api:$(cat version.txt)
|
||||
|
||||
build-redirector:
|
||||
runs-on: [runner]
|
||||
needs: prepare
|
||||
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||
steps:
|
||||
- name: Clone Repository
|
||||
@ -40,10 +79,15 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.CI_ACCESS_TOKEN }}
|
||||
|
||||
- name: Download build version artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: version
|
||||
|
||||
- name: Build docker
|
||||
run: |
|
||||
cd api
|
||||
docker build -f dockerfile_redirector -t git.sh-edraft.de/sh-edraft.de/open-redirect-redirector-dev:$(cat ../version.txt) .
|
||||
docker build -f dockerfile_redirector -t git.sh-edraft.de/sh-edraft.de/open-redirect-redirector:$(cat ../version.txt) .
|
||||
|
||||
- name: Login to registry git.sh-edraft.de
|
||||
uses: https://github.com/docker/login-action@v1
|
||||
@ -54,10 +98,11 @@ jobs:
|
||||
|
||||
- name: Push image
|
||||
run: |
|
||||
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-redirector-dev:$(cat version.txt)
|
||||
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-redirector:$(cat version.txt)
|
||||
|
||||
build-web:
|
||||
runs-on: [runner]
|
||||
needs: prepare
|
||||
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||
steps:
|
||||
- name: Clone Repository
|
||||
@ -65,6 +110,11 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.CI_ACCESS_TOKEN }}
|
||||
|
||||
- name: Download build version artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: version
|
||||
|
||||
- name: Prepare web build
|
||||
run: |
|
||||
cd web
|
||||
@ -78,7 +128,7 @@ jobs:
|
||||
- name: Build docker
|
||||
run: |
|
||||
cd web
|
||||
docker build -t git.sh-edraft.de/sh-edraft.de/open-redirect-web-dev:$(cat ../version.txt) .
|
||||
docker build -t git.sh-edraft.de/sh-edraft.de/open-redirect-web:$(cat ../version.txt) .
|
||||
|
||||
- name: Login to registry git.sh-edraft.de
|
||||
uses: https://github.com/docker/login-action@v1
|
||||
@ -89,4 +139,4 @@ jobs:
|
||||
|
||||
- name: Push image
|
||||
run: |
|
||||
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-web-dev:$(cat version.txt)
|
||||
docker push git.sh-edraft.de/sh-edraft.de/open-redirect-web:$(cat version.txt)
|
||||
|
@ -6,7 +6,7 @@ on:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build-api:
|
||||
prepare:
|
||||
runs-on: [runner]
|
||||
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||
steps:
|
||||
@ -15,9 +15,47 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.CI_ACCESS_TOKEN }}
|
||||
|
||||
- name: Get Date and Build Number
|
||||
run: |
|
||||
DATE=$(date +'%Y.%m.%d')
|
||||
git fetch --tags
|
||||
TAG_COUNT=$(git tag -l "${DATE}.*" | wc -l)
|
||||
BUILD_NUMBER=$(($TAG_COUNT + 1))
|
||||
BUILD_VERSION="${DATE}.${BUILD_NUMBER}"
|
||||
echo "$BUILD_VERSION" > version.txt
|
||||
|
||||
- name: Create Git Tag for Build
|
||||
run: |
|
||||
git config user.name "ci"
|
||||
git config user.email "dev@sh-edratf.de"
|
||||
git tag ${{ env.BUILD_VERSION }}
|
||||
git push origin ${{ env.BUILD_VERSION }}
|
||||
|
||||
- name: Upload build version artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: version
|
||||
path: version.txt
|
||||
|
||||
build-api:
|
||||
runs-on: [runner]
|
||||
needs: prepare
|
||||
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||
steps:
|
||||
- name: Clone Repository
|
||||
uses: https://github.com/actions/checkout@v3
|
||||
with:
|
||||
token: ${{ secrets.CI_ACCESS_TOKEN }}
|
||||
|
||||
- name: Download build version artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: version
|
||||
|
||||
- name: Build docker
|
||||
run: |
|
||||
cd api
|
||||
echo "VERSION = \"$(cat version.txt)\"" > version.py
|
||||
docker build -t git.sh-edraft.de/sh-edraft.de/open-redirect-api:$(cat ../version.txt) .
|
||||
|
||||
- name: Login to registry git.sh-edraft.de
|
||||
@ -33,6 +71,7 @@ jobs:
|
||||
|
||||
build-redirector:
|
||||
runs-on: [runner]
|
||||
needs: prepare
|
||||
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||
steps:
|
||||
- name: Clone Repository
|
||||
@ -40,6 +79,11 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.CI_ACCESS_TOKEN }}
|
||||
|
||||
- name: Download build version artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: version
|
||||
|
||||
- name: Build docker
|
||||
run: |
|
||||
cd api
|
||||
@ -58,6 +102,7 @@ jobs:
|
||||
|
||||
build-web:
|
||||
runs-on: [runner]
|
||||
needs: prepare
|
||||
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
|
||||
steps:
|
||||
- name: Clone Repository
|
||||
@ -65,6 +110,11 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.CI_ACCESS_TOKEN }}
|
||||
|
||||
- name: Download build version artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: version
|
||||
|
||||
- name: Prepare web build
|
||||
run: |
|
||||
cd web
|
||||
|
@ -1 +0,0 @@
|
||||
1.2.1
|
Loading…
Reference in New Issue
Block a user