Skip to content

Commit

Permalink
echo build vars
Browse files Browse the repository at this point in the history
  • Loading branch information
qdrvm-ci committed Apr 22, 2024
1 parent 08741c3 commit 511eaa1
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 65 deletions.
106 changes: 41 additions & 65 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,87 +14,63 @@ env:
~/.rustup
jobs:
Minideb-self-hosted:
#if: ${{ github.ref == 'refs/heads/master' || startsWith( github.ref, 'refs/tags/') || contains( github.event.pull_request.labels.*.name, 'Non-master self-hosted') }}
# Minideb-self-hosted:
# #if: ${{ github.ref == 'refs/heads/master' || startsWith( github.ref, 'refs/tags/') || contains( github.event.pull_request.labels.*.name, 'Non-master self-hosted') }}
# strategy:
# fail-fast: false
# matrix:
# options:
# - name: "Self-hosted: Minideb: Build Debug"
# build-type: "Debug"
# - name: "Self-hosted: Minideb: Build Release"
# build-type: "Release"
# name: "${{ matrix.options.name }}"
# runs-on: [ actions-runner-controller ]
# container: qdrvm/kagome-dev@sha256:2d70246c32418a3dd45c246d3f5c2dd99bdafde145b903271849affe476c4cfc
# steps:
# - uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6
# - uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
# with:
# path: ${{ env.CACHE_PATHS }}
# key: ${{ github.job }}-${{ matrix.options.name }}-${{ env.CACHE_VERSION }}
# - name: "${{ matrix.options.name }}"
# env:
# BUILD_TYPE: "${{ matrix.options.build-type }}"
# run: ./housekeeping/docker/kagome-dev/make.sh
Push-self-hosted:
#if: ${{ github.ref == 'refs/heads/master' || startsWith( github.ref, 'refs/tags/' ) }}
#needs: [clang-tidy, MacOS, Minideb-self-hosted]
strategy:
fail-fast: false
matrix:
options:
- name: "Self-hosted: Minideb: Build Debug"
- name: "Self-hosted: Push Debug Docker image"
build-type: "Debug"
name: "${{ matrix.options.name }}"
# - name: "Self-hosted: Push Release Docker image"
# build-type: "Release"
# - name: "Self-hosted: Push RelWithDebInfo Docker image"
# build-type: "RelWithDebInfo"
runs-on: [ actions-runner-controller ]
container: qdrvm/kagome-dev@sha256:2d70246c32418a3dd45c246d3f5c2dd99bdafde145b903271849affe476c4cfc
steps:
- uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6
- uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
with:
path: ${{ env.CACHE_PATHS }}
key: ${{ github.job }}-${{ matrix.options.name }}-${{ env.CACHE_VERSION }}
- name: "${{ matrix.options.name }}"
key: ${{ github.job }}-${{ env.CACHE_VERSION }}
- run: git config --global --add safe.directory /__w/kagome/kagome
- run: git fetch --prune --unshallow
- name: build
env:
BUILD_TYPE: "${{ matrix.options.build-type }}"
run: ./housekeeping/docker/kagome-dev/make.sh

- name: Prepare Docker Context
run: |
CTX_DIR="${{ github.workspace }}/docker_context"
rm -Rf ${CTX_DIR}
mkdir -p ${CTX_DIR}
cp -a ${{ github.workspace }}/node/kagome ${CTX_DIR}/
env:
BUILD_DIR: ${{ github.workspace }}

- name: Build Docker Image
run: docker build -t qdrvm/kagome-ci-test:${{ github.sha }} -f housekeeping/docker/kagome/minideb-debug.Dockerfile ${{ github.workspace }}/docker_context
env:
BUILD_TYPE: ${{ matrix.options.build-type }}

- name: Login to DockerHub
uses: docker/login-action@v1
- uses: azure/docker-login@83efeb77770c98b620c73055fbb59b2847e17dc0
with:
login-server: https://index.docker.io/v1/
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Push Docker Image
run: docker push qdrvm/kagome-ci-test:${{ github.sha }}
- name: docker pack and push
env:
IMAGE_TAG: ${{ github.sha }}

# Push-self-hosted:
# #if: ${{ github.ref == 'refs/heads/master' || startsWith( github.ref, 'refs/tags/' ) }}
# #needs: [clang-tidy, MacOS, Minideb-self-hosted]
# strategy:
# fail-fast: false
# matrix:
# options:
# - name: "Self-hosted: Push Debug Docker image"
# build-type: "Debug"
# - name: "Self-hosted: Push Release Docker image"
# build-type: "Release"
# - name: "Self-hosted: Push RelWithDebInfo Docker image"
# build-type: "RelWithDebInfo"
# runs-on: [ actions-runner-controller ]
# container: qdrvm/kagome-dev@sha256:2d70246c32418a3dd45c246d3f5c2dd99bdafde145b903271849affe476c4cfc
# steps:
# - uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6
# - uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
# with:
# path: ${{ env.CACHE_PATHS }}
# key: ${{ github.job }}-${{ env.CACHE_VERSION }}
# - run: git config --global --add safe.directory /__w/kagome/kagome
# - run: git fetch --prune --unshallow
# - name: build
# env:
# BUILD_TYPE: "${{ matrix.options.build-type }}"
# run: ./housekeeping/docker/kagome-dev/make.sh
# - uses: azure/docker-login@83efeb77770c98b620c73055fbb59b2847e17dc0
# with:
# login-server: https://index.docker.io/v1/
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_TOKEN }}
# - name: docker pack and push
# env:
# VERSION: ${{ github.ref }}
# BUILD_TYPE: "${{ matrix.options.build-type }}"
# run: ./housekeeping/docker/kagome/build_and_push_test.sh
VERSION: ${{ github.ref }}
BUILD_TYPE: "${{ matrix.options.build-type }}"
run: ./housekeeping/docker/kagome/build_and_push_test.sh
16 changes: 16 additions & 0 deletions housekeeping/docker/kagome/build_and_push_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@ mkdir -p ${CTX_DIR}
# Copy binaries
cp -a ${BUILD_DIR}/node/kagome ${CTX_DIR}/

echo "Building docker image $TAG"
echo "Build type: $BUILD_TYPE"
echo "Version: $VERSION"
echo "Build dir: $BUILD_DIR"
echo "Context dir: $CTX_DIR"
echo "Docker username: $DOCKER_USERNAME"
echo "Commit hash: $COMMIT_HASH"
echo "Docker tag: $TAG"
echo "Dockerfile: $DOCKERFILE"
echo "KAGOME_ROOT: $KAGOME_ROOT"
echo "CI: $CI"
echo "KAGOME_IN_DOCKER: $KAGOME_IN_DOCKER"
echo "BUILD_TYPE: $BUILD_TYPE"
docker ps
docker --version

if [ "$BUILD_TYPE" = "Release" ] || [ "$BUILD_TYPE" = "Custom" ]; then
docker build -t $TAG -f housekeeping/docker/kagome/minideb-release.Dockerfile ${CTX_DIR}

Expand Down

0 comments on commit 511eaa1

Please sign in to comment.