Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
Support non TTY builds of ignite binaries for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
stealthybox committed Nov 4, 2020
1 parent 77c135e commit a335147
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/upload-release-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ on:
description: Git tag to checkout.
required: true

env:
DOCKER_TTY: "" # using `docker run -t` seems to not work in github actions, maybe related to https://github.com/actions/runner/issues/241
REL_TAG: ${{ github.event.inputs.tag }}

jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
- name: Set tag name env var.
run: echo "REL_TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
ref: ${{ env.REL_TAG }}
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ endif

SHELL:=/bin/bash
# Set the command for running `docker`
# -- allows user to override for things like sudo usage or container images
# -- allows user to override for things like sudo usage or container images
DOCKER := docker
# DOCKER_TTY defaults for a nice docker buildkit tty experience on dev laptops -- can be disabled in CI if no tty available
DOCKER_TTY ?= -t

# Set the first containerd.sock that successfully stats -- fallback to the docker4mac default
CONTAINERD_SOCK := $(shell \
$(DOCKER) run -i --rm \
Expand Down Expand Up @@ -99,7 +102,7 @@ local: # Do not use directly -- use $(GO_MAKE_TARGET)
$(COMMAND)
go-in-docker: # Do not use directly -- use $(GO_MAKE_TARGET)
mkdir -p $(CACHE_DIR)/go $(CACHE_DIR)/cache
$(DOCKER) run -it --rm \
$(DOCKER) run -i $(DOCKER_TTY) --rm \
-v $(CACHE_DIR)/go:/go \
-v $(CACHE_DIR)/cache:/.cache/go-build \
-v $(shell pwd):/go/src/${PROJECT} \
Expand Down Expand Up @@ -208,7 +211,7 @@ api-doc:
mv bin/tmp/${GROUPVERSION}/*.go $(shell pwd)/pkg/apis/${GROUPVERSION}/
rm -r bin/tmp/${GROUPVERSION}
# Format the docs with pandoc
$(DOCKER) run -it --rm \
$(DOCKER) run -i $(DOCKER_TTY) --rm \
-v $(shell pwd):/data \
-u $(shell id -u):$(shell id -g) \
pandoc/core:2.10 `# TODO: let's try bumping this image tag in 2021` \
Expand Down
4 changes: 3 additions & 1 deletion hack/release-common.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/bin/bash

DOCKER_TTY="${DOCKER_TTY:+"-t"}"

if [[ ! -f bin/gren_token ]]; then
echo "File bin/gren_token is needed; should contain a Github token with repo access"
exit 1
fi

run_gren() {
docker run -it \
docker run -i ${DOCKER_TTY} \
-v $(pwd):/data \
-w /data \
-u $(id -u):$(id -g) \
Expand Down
4 changes: 3 additions & 1 deletion images/kernel/upgrade-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

KERNEL_BUILDER_IMAGE=luxas/kernel-builder:gcc-7

DOCKER_TTY="${DOCKER_TTY:+"-t"}"

if [[ $# != 2 ]]; then
echo "Usage: $0 [FROM] [TO]"
exit 1
Expand All @@ -22,7 +24,7 @@ if [[ ${FROM} != ${TO} ]]; then
fi

docker pull ${KERNEL_BUILDER_IMAGE}
docker run -it \
docker run -i ${DOCKER_TTY} \
${ARCH_PARAMETER} \
-v $(pwd)/${TO}:/tmp/.config \
${KERNEL_BUILDER_IMAGE} /bin/bash -c "\
Expand Down

0 comments on commit a335147

Please sign in to comment.