bromite-buildtools/.github/workflows/build_bromite.yaml

183 lines
5.9 KiB
YAML
Raw Normal View History

2021-07-11 16:25:43 +05:30
name: Build x86
permissions:
actions: none
checks: none
contents: none
deployments: none
issues: none
packages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
on:
workflow_dispatch:
2021-07-11 18:42:14 +05:30
env:
2021-07-28 14:59:15 +05:30
BROMITE_SHA: 76745fde6ed75542f005ea5528f486df41c56da4
2021-07-28 01:32:57 +05:30
REMOVEDOCKERSUPPORT: true
2021-07-30 13:00:54 +05:30
USELOCALIMAGE: true
2021-07-11 18:42:14 +05:30
2021-07-11 16:25:43 +05:30
jobs:
check_images:
runs-on: self-hosted
steps:
2021-07-11 18:46:50 +05:30
- name: Checkout repo
uses: actions/checkout@v2
with:
2021-07-11 18:51:44 +05:30
path: bromite-buildtools
2021-07-11 18:46:50 +05:30
fetch-depth: 1
2021-07-29 18:37:10 +05:30
- name: Get current proxy settings
shell: bash
run: |
if ! [[ -z "${HTTP_PROXY}" ]]; then
PROXY_ADDR=http://$(hostname -I | xargs):8118
2021-07-29 21:27:57 +05:30
echo "PROXY_ADDR=$PROXY_ADDR" >> $GITHUB_ENV
2021-07-29 18:37:10 +05:30
fi
2021-07-11 16:25:43 +05:30
- name: Get current chromium version
shell: bash
run: |
mkdir bromite
cd bromite
2021-07-11 17:26:27 +05:30
git init
2021-07-11 17:30:02 +05:30
git remote add origin https://github.com/uazo/bromite
2021-07-11 18:42:14 +05:30
git fetch origin $BROMITE_SHA
2021-07-11 17:30:02 +05:30
git reset --hard FETCH_HEAD
2021-07-11 16:25:43 +05:30
cd ..
export VERSION=$( cat ./bromite/build/RELEASE )
2021-07-11 18:42:14 +05:30
rm -rf bromite
2021-07-11 16:25:43 +05:30
echo Current version is $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
2021-07-11 18:49:19 +05:30
cd bromite-buildtools
2021-07-11 18:42:14 +05:30
- name: Checking build-deps for ${{ env.VERSION }}
shell: bash
run: |
IS_PRESENT=$(docker inspect --type=image uazo/build-deps:$VERSION > /dev/null ; echo $?)
if [ $IS_PRESENT -ne "0" ]; then
IS_PRESENT=$(docker manifest inspect uazo/build-deps:$VERSION > /dev/null ; echo $?)
if [ $IS_PRESENT -ne "0" ]; then
2021-07-11 18:54:44 +05:30
DOCKER_BUILDKIT=1 docker build -t uazo/build-deps:$VERSION \
--progress plain \
--build-arg VERSION=$VERSION \
2021-07-29 18:37:10 +05:30
--build-arg HTTP_PROXY="$PROXY_ADDR" \
2021-07-12 12:51:47 +05:30
--no-cache \
2021-07-11 18:54:44 +05:30
bromite-buildtools/images/build-deps/.
2021-07-11 18:42:14 +05:30
fi
fi
2021-07-11 16:25:43 +05:30
2021-07-11 18:42:14 +05:30
- name: Checking chromium for ${{ env.VERSION }}
shell: bash
run: |
IS_PRESENT=$(docker inspect --type=image uazo/chromium:$VERSION > /dev/null ; echo $?)
if [ $IS_PRESENT -ne "0" ]; then
IS_PRESENT=$(docker manifest inspect uazo/chromium:$VERSION > /dev/null ; echo $?)
if [ $IS_PRESENT -ne "0" ]; then
2021-07-11 18:54:44 +05:30
DOCKER_BUILDKIT=1 docker build -t uazo/chromium:$VERSION \
--progress plain \
--build-arg VERSION=$VERSION \
2021-07-29 18:37:10 +05:30
--build-arg HTTP_PROXY="$PROXY_ADDR" \
2021-07-11 18:54:44 +05:30
bromite-buildtools/images/chr-source/.
2021-07-11 18:42:14 +05:30
fi
fi
2021-07-11 16:25:43 +05:30
2021-07-11 18:42:14 +05:30
- name: Checking bromite for ${{ env.BROMITE_SHA }}
shell: bash
run: |
IS_PRESENT=$(docker inspect --type=image uazo/bromite:$BROMITE_SHA > /dev/null ; echo $?)
if [ $IS_PRESENT -ne "0" ]; then
IS_PRESENT=$(docker manifest inspect uazo/bromite:$BROMITE_SHA > /dev/null ; echo $?)
if [ $IS_PRESENT -ne "0" ]; then
DOCKER_BUILDKIT=1 docker build -t uazo/bromite:$BROMITE_SHA --progress plain \
--build-arg BROMITE_SHA=$BROMITE_SHA \
--build-arg VERSION=$VERSION \
2021-07-29 18:37:10 +05:30
--build-arg HTTP_PROXY="$PROXY_ADDR" \
2021-07-11 18:42:14 +05:30
bromite-buildtools/images/bromite-source/.
fi
fi
- name: Checking bromite-build for ${{ env.BROMITE_SHA }}
shell: bash
run: |
IS_PRESENT=$(docker inspect --type=image uazo/bromite-build:$BROMITE_SHA > /dev/null ; echo $?)
if [ $IS_PRESENT -ne "0" ]; then
IS_PRESENT=$(docker manifest inspect uazo/bromite-build:$BROMITE_SHA > /dev/null ; echo $?)
if [ $IS_PRESENT -ne "0" ]; then
DOCKER_BUILDKIT=1 docker build -t uazo/bromite-build:$BROMITE_SHA --progress plain \
--build-arg BROMITE_SHA=$BROMITE_SHA \
2021-07-29 18:37:10 +05:30
--build-arg HTTP_PROXY="$PROXY_ADDR" \
2021-07-13 00:13:47 +05:30
--no-cache \
2021-07-11 18:42:14 +05:30
bromite-buildtools/images/bromite-build/.
fi
fi
2021-07-11 16:25:43 +05:30
build:
runs-on: self-hosted
needs: check_images
if: success()
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
2021-07-28 01:32:57 +05:30
--health-retries 5
2021-07-30 13:08:27 +05:30
env:
REMOVEDOCKERSUPPORT: true
USELOCALIMAGE: true
2021-07-11 16:25:43 +05:30
gomaserver:
image: uazo/goma-server
#ports:
# - 5050:5050
volumes:
- /tmp/proxy:/tmp/proxy
2021-07-30 15:18:20 +05:30
options: >-
--health-cmd "hostname -I >/tmp/proxy/gomaserverip"
2021-07-30 15:36:31 +05:30
--health-interval 30s
2021-07-30 15:18:20 +05:30
--health-timeout 5s
--health-retries 5
2021-07-30 15:36:31 +05:30
2021-07-11 16:25:43 +05:30
env:
REDISHOST: redis
REMOTEEXEC_ADDR: ${{ secrets.REMOTEEXEC_ADDR }}
2021-07-30 13:08:27 +05:30
REMOVEDOCKERSUPPORT: true
USELOCALIMAGE: true
2021-07-11 16:25:43 +05:30
container:
2021-07-28 14:59:15 +05:30
image: uazo/bromite-build:76745fde6ed75542f005ea5528f486df41c56da4 #${{ env.BROMITE_SHA }}
2021-07-11 16:25:43 +05:30
env:
SERVER_HOST_GOMA: gomaserver
2021-07-30 13:08:27 +05:30
REMOVEDOCKERSUPPORT: true
USELOCALIMAGE: true
2021-07-30 20:53:32 +05:30
HTTP_PROXY: ""
HTTPS_PROXY: ""
http_proxy: ""
https_proxy: ""
2021-07-11 16:25:43 +05:30
volumes:
- /storage/bromite/${{ github.sha }}:/home/lg/working_dir/artifacs
- /tmp/proxy:/tmp/proxy
2021-07-30 13:23:16 +05:30
steps:
2021-07-11 16:25:43 +05:30
- name: Build Bromite
shell: bash
2021-07-13 20:57:26 +05:30
env:
GOMAJOBS: 60
2021-07-11 16:25:43 +05:30
run: |
export WORKSPACE=/home/lg/working_dir
2021-07-30 15:18:20 +05:30
cd $WORKSPACE
export SERVER_HOST_GOMA=$(cat /tmp/proxy/gomaserverip | xargs)
# get goma internal server ip
# SERVER_HOST_GOMA=$(docker inspect -f '{{.Config.Image}}={{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq) | grep goma-server | sed 's/[^=]*=\(.*\)/\1/' | xargs)
2021-07-11 16:25:43 +05:30
./start-build.sh