File tree Expand file tree Collapse file tree 6 files changed +22
-17
lines changed Expand file tree Collapse file tree 6 files changed +22
-17
lines changed Original file line number Diff line number Diff line change 1
1
# kola_temp can include socket files that the build process does not like
2
2
/mantle /_kola_temp
3
+ /bin
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ else ifeq ($(GOARCH),aarch64)
31
31
endif
32
32
33
33
bin/coreos-assembler :
34
- cd cmd && go build -mod vendor -o ../$@
34
+ cd cmd && go build $( GOFLAGS ) -mod vendor -o ../$@
35
35
.PHONY : bin/coreos-assembler
36
36
37
37
.% .shellchecked : %
Original file line number Diff line number Diff line change @@ -101,7 +101,6 @@ cosa() {
101
101
-v ${PWD} :/srv/ --device /dev/kvm --device /dev/fuse \
102
102
--tmpfs /tmp -v /var/tmp:/var/tmp --name cosa \
103
103
${COREOS_ASSEMBLER_CONFIG_GIT: +-v $COREOS_ASSEMBLER_CONFIG_GIT :/ srv/ src/ config/: ro} \
104
- ${COREOS_ASSEMBLER_GIT: +-v $COREOS_ASSEMBLER_GIT / src/:/ usr/ lib/ coreos-assembler/: ro} \
105
104
${COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS} \
106
105
${COREOS_ASSEMBLER_CONTAINER:- $COREOS_ASSEMBLER_CONTAINER_LATEST } " $@ "
107
106
rc=$? ; set +x; return $rc
@@ -127,9 +126,6 @@ The environment variables are special purpose:
127
126
128
127
- ` COREOS_ASSEMBLER_CONFIG_GIT ` : Allows you to specifiy a local directory that
129
128
contains the configs for the ostree you are trying to compose.
130
- - ` COREOS_ASSEMBLER_GIT ` : Allows you to specify a local directory that contains
131
- the CoreOS Assembler scripts. This allows for quick hacking on the assembler
132
- itself.
133
129
- ` COREOS_ASSEMBLER_CONTAINER_RUNTIME_ARGS ` : Allows for adding arbitrary mounts
134
130
or args to the container runtime.
135
131
- ` COREOS_ASSEMBLER_CONTAINER ` : Allows for overriding the default assembler
Original file line number Diff line number Diff line change @@ -12,18 +12,18 @@ guides if you are looking for how to use the CoreOS Assembler.
12
12
1 . TOC
13
13
{: toc }
14
14
15
- ## Hacking on CoreOS Assembler Scripts
15
+ ## Hacking on CoreOS Assembler
16
16
17
- If you find yourself wanting to hack on CoreOS Assembler itself then you can
18
- easily mount the scripts into the container and prevent rebuilding the
19
- container to test every change. This can be done using the
20
- ` COREOS_ASSEMBLER_GIT ` env var.
17
+ You could rerun ` podman build -t localhost/cosa ` every time you make
18
+ a change, but it'd be very expensive to do so.
21
19
22
- ```
23
- $ export COREOS_ASSEMBLER_GIT=/path/to/github.com/coreos/coreos-assembler/
24
- $ cosa init https://github.com/coreos/fedora-coreos-config.git
25
- $ cosa fetch && cosa build
26
- ```
20
+ Instead, you can use [ hack/Dockerfile] . There are instructions in that
21
+ file. This avoids redownloading and reinstalling all of the
22
+ dependency RPMs.
23
+
24
+ For even faster workflow, you can just bind mount in binaries from
25
+ your host or from another container by adding additional bind mounts,
26
+ and then copy files into your coreos-assembler container more manually.
27
27
28
28
## Installing cosa inside an existing container
29
29
Original file line number Diff line number Diff line change
1
+ # Use this for quicker iteration on coros-assembler; from the toplevel run e.g.:
2
+ # podman build -t localhost/cosa -f hack/Dockerfile .
3
+ FROM quay.io/coreos-assembler/coreos-assembler:latest
4
+ WORKDIR /src
5
+ COPY . .
6
+ USER root
7
+ RUN env GOFLAGS="-buildvcs=false" make && make install
8
+ USER builder
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ ldflags="-X ${REPO_PATH}/version.Version=${version}"
26
26
host_build () {
27
27
local cmd=$1 ; shift
28
28
echo " Building $cmd "
29
- go build \
29
+ go build ${GOFLAGS :- } \
30
30
-ldflags " ${ldflags} " \
31
31
-mod vendor \
32
32
-o " bin/$cmd " \
@@ -41,7 +41,7 @@ cross_static_build() {
41
41
mkdir -p " bin/$a "
42
42
echo " Building $a /$cmd (static)"
43
43
CGO_ENABLED=0 GOARCH=${BASEARCH_TO_GOARCH[$a]} \
44
- go build \
44
+ go build ${GOFLAGS :- } \
45
45
-ldflags " ${ldflags} -extldflags=-static" \
46
46
-mod vendor \
47
47
-o " bin/$a /$cmd " \
You can’t perform that action at this time.
0 commit comments