Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions lmp/build-sdk-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
HERE=$(dirname $(readlink -f $0))
source $HERE/../helpers.sh

TAG=$(git log -1 --format=%h)
LATEST=${LATEST:-latest}

status Launching dockerd
unset DOCKER_HOST
Expand All @@ -18,11 +18,15 @@ for i in `seq 12` ; do
done

container="hub.foundries.io/lmp-sdk"
tagged="${container}:${TAG}"
latest="${container}:latest"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll wind up needing a block like:
https://github.com/foundriesio/ci-scripts/blob/master/lmp/jobserv.yml#L18-L24

for changes to the "next" branch. Seems like the easiest way to control that will be via an environment variable. e.g.

- name: lmp-sdk-next
        host-tag: amd64
        container: foundries/dind-ci:19.03.9_b38f166
        privileged: true
        params:
           LATEST=next
        script-repo:
          name: fio
          path: lmp/build-sdk-container.sh

And then you could have this script take a variable for "latest". e.g:

LATEST=${LATEST:latest}
``

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well! With the argument it wouldn't work. thanks for the tip.
Also added the block on the main build job:

- name: lmp-sdk-next
        host-tag: amd64
        container: foundries/dind-ci:19.03.9_b38f166
        privileged: true
        params:
           LATEST=next
        script-repo:
          name: fio
          path: lmp/build-sdk-container.sh

# override tag if passed as argument
tags="${LATEST}"
if [ "${tags}" == "latest" ]; then
# add latest tag
tags="$(git log -1 --format=%h) ${tags}"
fi

docker_login

run docker build -t ${tagged} -t ${latest} .
run docker push ${tagged}
run docker push ${latest}
for t in ${tags}; do
run docker build -t ${container}:${t}
run docker push ${container}:${t}
done
15 changes: 12 additions & 3 deletions lmp/jobserv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,18 @@ triggers:
OTA_LITE_TAG: 'main'
AKLITE_TAG: promoted-main
runs:
- name: lmp-sdk-next
host-tag: amd64
container: foundries/dind-ci:19.03.9_b38f166
privileged: true
params:
LATEST=next
script-repo:
name: fio
path: lmp/build-sdk-container.sh
# images with no OTA
- name: "{loop}"
container: hub.foundries.io/lmp-sdk
container: hub.foundries.io/lmp-sdk:next
host-tag: amd64-partner-gcp-nocache
loop-on:
- param: MACHINE
Expand All @@ -271,7 +280,7 @@ triggers:

# mfgtool / uuu related build files
- name: mfgtool-{loop}
container: hub.foundries.io/lmp-sdk
container: hub.foundries.io/lmp-sdk:next
host-tag: amd64-partner-gcp-nocache
loop-on:
- param: MACHINE
Expand All @@ -296,7 +305,7 @@ triggers:

# wayland distro flavor
- name: build-lmp-wayland-{loop}
container: hub.foundries.io/lmp-sdk
container: hub.foundries.io/lmp-sdk:next
host-tag: amd64-partner-gcp-nocache
loop-on:
- param: MACHINE
Expand Down