-
Notifications
You must be signed in to change notification settings - Fork 40
Added numbered symlinks to build steps for ease of use #2467
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
craigcomstock
wants to merge
6
commits into
cfengine:master
Choose a base branch
from
craigcomstock:ent-12599/master
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
c43d904
Added simple README-build-in-container.md explaining how to work insi…
craigcomstock ca7b247
Skip sshd hardening for build hosts that are containers
craigcomstock 0c07f23
Refactored build-scripts scripts to support running as numbered steps
craigcomstock e2b50f6
Added build-scripts/canaries.txt for use in the future with Jenkinsfile
craigcomstock 14727ae
Make setup-cfengine-build-host.sh more quiet
craigcomstock 3e061bc
fix mission-portal bootstrap
craigcomstock 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| Build with ./build-in-container.py | ||
|
|
||
| Using ./build-in-container.py --shell you can run the build interactively and debug issues. | ||
| Start in the container by running /srv/source/buildscripts/build-in-container-inner.sh | ||
|
|
||
| This will copy repository sources that are needed from the read-only /srv location to read-write work area in /home/builder/build. | ||
|
|
||
| Continue debugging by running steps in /home/builder/buildscripts/build-scripts/0*.sh | ||
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 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 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,5 @@ | ||
| #!/bin/sh | ||
|
|
||
| set -ex | ||
| thisdir="$(dirname "$0")" | ||
| sudo bash "$thisdir"/../ci/setup-cfengine-build-host.sh |
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 @@ | ||
| repositories | ||
|
olehermanse marked this conversation as resolved.
|
||
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 @@ | ||
| autogen | ||
|
olehermanse marked this conversation as resolved.
|
||
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 @@ | ||
| clean-buildmachine |
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 @@ | ||
| bootstrap-mission-portal |
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 @@ | ||
| generate-pull-request-file |
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 @@ | ||
| build-tarballs |
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 @@ | ||
| unpack-tarballs |
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 @@ | ||
| install-dependencies |
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 @@ | ||
| configure |
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 @@ | ||
| generate-source-tarballs |
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 @@ | ||
| compile |
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 @@ | ||
| produce-debug-symbols |
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 @@ | ||
| package |
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 @@ | ||
| prepare-results |
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 @@ | ||
| test |
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 @@ | ||
| prepare-results |
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 @@ | ||
| generate-checksum-list |
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 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,88 @@ | ||
| . "$(dirname "$0")"/functions | ||
| . detect-environment | ||
| . compile-options | ||
| . version | ||
| set -e | ||
|
|
||
| if [ "$ROLE" = hub ] || [ "$JOB_NAME" = bootstrap-pr ]; then | ||
| if [ ! -d "$BASEDIR/mission-portal" ] || [ ! -d "$BASEDIR/nova" ]; then | ||
| fatal "ROLE is $ROLE but $BASEDIR is missing mission-portal and nova repositories" | ||
| fi | ||
| else | ||
| log_debug "ROLE ($ROLE) is not hub and JOB_NAME ($JOB_NAME) is not bootstrap-pr so skipping $0" | ||
| exit 0 | ||
| fi | ||
|
|
||
| if [ -d "$BASEDIR"/mission-portal/vendor ] && \ | ||
| [ -d "$BASEDIR"/nova/api/http/vendor ] && \ | ||
| [ -d "$BASEDIR"/mission-portal/public/scripts/node_modules ] && \ | ||
| [ -f "$BASEDIR"/mission-portal/public/themese/default/bootstrap/compiled/css/cfengine.less.css ] && \ | ||
| [ -d "$BASEDIR"/mission-portal/ldap/vendor ]; then | ||
| log_debug "All mission-portal/nova dependencies are installed (by build-in-container.py --tarballs or bootstrap-pr job) so skipping $0" | ||
| exit 0 | ||
| fi | ||
|
|
||
| if command -v composer >/dev/null; then | ||
| COMPOSER=$(command -v composer) | ||
| elif [ -f /usr/local/bin/composer.phar ]; then | ||
| COMPOSER=/usr/local/bin/composer.phar | ||
| else | ||
| fatal "Could not find composer command in PATH or at /usr/local/bin/composer.phar" | ||
| exit 1 | ||
| fi | ||
|
|
||
| log_debug "Installing javascript npm dependencies..." | ||
| ( | ||
| if test -f "$BASEDIR"/mission-portal/public/scripts/package.json; then | ||
| cd "$BASEDIR"/mission-portal/public/scripts | ||
| # display node & npm versions | ||
| npm --version | ||
| node --version | ||
| # install dependencies from npmjs | ||
| run_and_print_on_failure npm ci --prefix "$BASEDIR"/mission-portal/public/scripts/ | ||
| # build react components | ||
| run_and_print_on_failure npm run build --prefix "$BASEDIR"/mission-portal/public/scripts/ | ||
| # remove node_modules since the bundles are already built | ||
| run_and_print_on_failure rm -rf "$BASEDIR"/mission-portal/public/scripts/node_modules | ||
| fi | ||
| ) | ||
|
|
||
| log_debug "Installing PHP composer dependencies from mission-portal repository..." | ||
| ( | ||
| if test -f "$BASEDIR"/mission-portal/composer.json; then | ||
| cd "$BASEDIR"/mission-portal | ||
| # install PHP dependencies from composer | ||
| run_and_print_on_failure "$COMPOSER" install --no-dev | ||
| fi | ||
| ) | ||
|
|
||
| log_debug "Installing PHP composer dependencies from nova repository..." | ||
| ( | ||
| if test -f "$BASEDIR"/nova/api/http/composer.json; then | ||
| cd "$BASEDIR"/nova/api/http | ||
| # install PHP dependencies from composer | ||
| run_and_print_on_failure "$COMPOSER" install --no-dev --ignore-platform-reqs | ||
| fi | ||
| ) | ||
|
|
||
| log_debug "Compiling Mission Portal styles..." | ||
| ( | ||
| if test -f "$BASEDIR"/mission-portal/public/themes/default/bootstrap/cfengine_theme.less; then | ||
| cd "$BASEDIR"/mission-portal/public/themes/default/bootstrap | ||
| run_and_print_on_failure npx -p less lessc --compress ./cfengine_theme.less ./compiled/css/cfengine.less.css | ||
| fi | ||
| ) | ||
|
|
||
| log_debug "Installing LDAP API PHP composer dependencies..." | ||
| ( | ||
| if test -f "$BASEDIR"/mission-portal/ldap/composer.json; then | ||
| cd "$BASEDIR"/mission-portal/ldap | ||
| # install PHP dependencies from composer | ||
| run_and_print_on_failure php "$COMPOSER" install --no-dev | ||
| fi | ||
| ) | ||
|
|
||
| # Composer falls back to git clone when GitHub's anonymous zipball | ||
| # rate limit is hit, leaving non-reproducible .git directories in the | ||
| # vendor tree. Strip them. | ||
| find "$BASEDIR/mission-portal" "$BASEDIR/nova/api/http" -type d -name .git -path '*/vendor/*' -exec rm -rf {} + |
Oops, something went wrong.
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.
We already have
build-in-container.md, maybe you can expand that section?Debugging
# Drop into a shell inside the container ./build-in-container.py --platform ubuntu-22 --project community --role agent --build-type DEBUG --shellThe shell session has the same mounts and environment as a build run. The
container is ephemeral (
--rm), so any changes are lost on exit.