-
-
Notifications
You must be signed in to change notification settings - Fork 34
Refactor build structure and add noble. #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nzlosh
wants to merge
6
commits into
StackStorm:master
Choose a base branch
from
nzlosh:refactor
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
18b3551
Refactor build structure and add noble.
nzlosh d2d7229
Drop Focal
nzlosh 6bb0a5a
Move jammy to restructured docker build.
nzlosh 6dc2966
Drop rocky8
nzlosh cff7cf9
Move rocky9 to restructured docker build.
nzlosh a69aa59
Typo and warning added to help message.
nzlosh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e +x -o pipefail | ||
|
|
||
| function bootstrap_docker() | ||
| { | ||
| sudo apt-get update --quiet --quiet | ||
| sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common jq | ||
|
|
||
| export CODENAME=$(source /etc/os-release && echo "$VERSION_CODENAME") | ||
| export DISTRO=$(source /etc/os-release && echo "$ID") | ||
| export ARCH=$(dpkg --print-architecture) | ||
| # get gpg key for download.docker | ||
| curl -fsSL https://download.docker.com/linux/${DISTRO}/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/download.docker.gpg | ||
| sudo tee <<<"deb [arch=${ARCH}] https://download.docker.com/linux/${DISTRO} ${CODENAME} stable" /etc/apt/sources.list.d/download.docker.list | ||
| sudo apt update --quiet --quiet | ||
| sudo apt install docker-ce docker-ce-cli docker-compose-plugin | ||
| sudo usermod -a -G docker vagrant | ||
| } | ||
|
|
||
| function build() | ||
| { | ||
| local CODENAME="$1" | ||
|
|
||
| date_suffix=$(date +%Y-%m-%d) | ||
|
|
||
| echo "Building packagingbuild image..." | ||
| (docker build --progress plain -f "packagingbuild/${CODENAME}/Dockerfile" -t "stackstorm/packagingbuild:${CODENAME}" -t "stackstorm/packagingbuild:${CODENAME}-${date_suffix}" .) || exit -1 | ||
|
|
||
| echo "Building packagingtest image..." | ||
| (docker build --progress plain -f "packagingtest/${CODENAME}/Dockerfile" -t "stackstorm/packagingtest:${CODENAME}" -t "stackstorm/packagingtest:${CODENAME}-${date_suffix}" .) || exit -1 | ||
| } | ||
|
|
||
| function build_target() | ||
| { | ||
| local CODENAME="$1" | ||
| for DOCKERFILE in packagingbuild/$CODENAME/Dockerfile | ||
| do | ||
| TARGET_PATH=$(dirname $DOCKERFILE) | ||
| TARGET=$(basename $TARGET_PATH) | ||
| build $TARGET | ||
| done | ||
| } | ||
|
|
||
| function usage() | ||
| { | ||
| cat <<EOF | ||
| Usage $0 <bootstrap|build [distro]> | ||
|
|
||
| bootstrap - Configure the system with the Docker repository and | ||
| install Docker CE and Docker Compose packages. (Ubuntu only) | ||
| build [distro] - Build the Docker images for the given distro codename. | ||
| Builds all distros when no codename provided. | ||
|
|
||
| EOF | ||
| } | ||
|
|
||
| if [[ $# -eq 0 ]]; then | ||
| usage | ||
| exit 1 | ||
| fi | ||
|
|
||
| case "$1" in | ||
| "bootstrap") | ||
| bootstrap_docker | ||
| ;; | ||
| "build") | ||
| if [[ -n "$2" ]]; then | ||
| build_target "$2" | ||
| else | ||
| build_target '*' | ||
| fi | ||
| ;; | ||
| *) | ||
| usage | ||
| exit 1 | ||
| ;; | ||
| esac |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably worth mentioning what OS this
build_imageworks on, as it looks to be deb only, I couldn't run this on my macThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
./build_image build jammycommand should work on any *nix distro that has docker installed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a note about
bootstraponly supporting Ubuntu.