-
Notifications
You must be signed in to change notification settings - Fork 16
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
WIP: Crw-3071Use same arguments in all build scripts #114
Open
SDawley
wants to merge
2
commits into
devspaces-3-rhel-8
Choose a base branch
from
CRW-3071
base: devspaces-3-rhel-8
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
2 commits
Select commit
Hold shift + click to select a range
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 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 |
---|---|---|
|
@@ -28,16 +28,16 @@ PUBLISH_ARTIFACTS_TO_GITHUB=0 | |
PUBLISH_ARTIFACTS_TO_RCM=0 | ||
|
||
# for publishing to RCM only | ||
DESTHOST="crw-build/codeready-workspaces-jenkins.rhev-ci-vms.eng.rdu2.redhat.com@rcm-guest.app.eng.bos.redhat.com" | ||
DESTHOST="[email protected]" | ||
KERBEROS_USER="crw-build/codeready-workspaces-jenkins.rhev-ci-vms.eng.rdu2.redhat.com@REDHAT.COM" | ||
|
||
MIDSTM_BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
DEFAULT_TAG=${MIDSTM_BRANCH#*-}; DEFAULT_TAG=${DEFAULT_TAG%%-*} | ||
if [[ $DEFAULT_TAG == "2" ]]; then latestNext="next"; else latestNext="latest"; fi | ||
DS_VERSION=${MIDSTM_BRANCH#*-}; DS_VERSION=${DS_VERSION%%-*} | ||
if [[ $DS_VERSION == "3" ]]; then latestNext="next"; else latestNext="latest"; fi | ||
|
||
# default value for Jenkins builds | ||
if [[ -d ${WORKSPACE}/sources ]]; then | ||
SOURCE_DIR=${WORKSPACE}/sources # path to where chectl is checked out | ||
SOURCEDIR=${WORKSPACE}/sources # path to where chectl is checked out | ||
fi | ||
if [[ -d "${WORKSPACE}/devspaces-images" ]]; then | ||
DSIMG_DIR="${WORKSPACE}/devspaces-images" | ||
|
@@ -68,47 +68,43 @@ usage () { | |
|
||
Example: | ||
|
||
$0 -v ${DEFAULT_TAG}.0 -b ${MIDSTM_BRANCH} -s /path/to/chectl/ -i /path/to/devspaces-images/ -t ${DSC_DIR} --suffix RC" | ||
$0 -v ${DS_VERSION}.0 -b ${MIDSTM_BRANCH} -s /path/to/chectl/ -i /path/to/devspaces-images/ -t ${DSC_DIR} --suffix RC" | ||
echo "" | ||
echo "Options: | ||
--suffix [RC or GA] optionally, build an RC (copy to quay) or GA (copy to quay and RCM guest) | ||
--crw-version ${DEFAULT_TAG} compute from MIDSTM_BRANCH if not set | ||
" | ||
exit 1 | ||
} | ||
|
||
while [[ "$#" -gt 0 ]]; do | ||
case $1 in | ||
'-v') CSV_VERSION="$2"; shift 1;; | ||
'-b'|'--crw-branch') MIDSTM_BRANCH="$2"; shift 1;; # branch of redhat-developer/devspaces/pom.xml to check as default CHE_VERSION | ||
'-v') CSV_VERSION="$2"; DS_VERSION="${CSV_VERSION%.*}" shift 2;; | ||
'-b') MIDSTM_BRANCH="$2"; shift 2;; # branch of redhat-developer/devspaces/pom.xml to check as default CHE_VERSION | ||
# paths to use for input and ouput | ||
'-s') SOURCE_DIR="$2"; SOURCE_DIR="${SOURCE_DIR%/}"; shift 1;; | ||
'-t') DSC_DIR="$2"; DSC_DIR="${DSC_DIR%/}"; shift 1;; | ||
'-i') DSIMG_DIR="$2"; DSIMG_DIR="${DSIMG_DIR%/}"; shift 1;; | ||
'--help'|'-h') usageSegKey;; | ||
'-s') SOURCEDIR="$2"; SOURCEDIR="${SOURCEDIR%/}"; shift 2;; | ||
'-t') DSC_DIR="$2"; DSC_DIR="${DSC_DIR%/}"; shift 2;; | ||
'-i') DSIMG_DIR="$2"; DSIMG_DIR="${DSIMG_DIR%/}"; shift 2;; | ||
'--help'|'-h') usageSegKey; shift 1;; | ||
# optional tag overrides | ||
'--suffix') versionSuffix="$2"; shift 1;; | ||
'--crw-version') DS_VERSION="$2"; DEFAULT_TAG="$2"; shift 1;; | ||
'--gh') PUBLISH_ARTIFACTS_TO_GITHUB=1;; | ||
'--rcm') PUBLISH_ARTIFACTS_TO_RCM=1;; | ||
'--desthost') DESTHOST="$2"; shift 1;; | ||
'--kerbuser') KERBEROS_USER="$2"; shift 1;; | ||
'--no-sync') DO_SYNC=0;; | ||
'--no-redhat') DO_REDHAT_BUILD=0;; | ||
'--no-quay') DO_QUAY_BUILD=0;; | ||
'--suffix') versionSuffix="$2"; shift 2;; | ||
'--gh') PUBLISH_ARTIFACTS_TO_GITHUB=1; shift 1;; | ||
'--rcm') PUBLISH_ARTIFACTS_TO_RCM=1; shift 1;; | ||
'--desthost') DESTHOST="$2"; shift 2;; | ||
'--kerbuser') KERBEROS_USER="$2"; shift 2;; | ||
'--no-sync') DO_SYNC=0; shift 1;; | ||
'--no-redhat') DO_REDHAT_BUILD=0; shift 1;; | ||
'--no-quay') DO_QUAY_BUILD=0; shift 1;; | ||
esac | ||
shift 1 | ||
done | ||
|
||
if [[ ! "${SEGMENT_WRITE_KEY}" ]]; then usageSegKey; fi | ||
if [[ $PUBLISH_ARTIFACTS_TO_GITHUB -eq 1 ]] && [[ ! "${GITHUB_TOKEN}" ]]; then usageSegKey; fi | ||
if [[ ! -d "${SOURCE_DIR}" ]] || [[ ! -d "${DSC_DIR}" ]] || [[ ! -d "${DSIMG_DIR}" ]]; then usage; fi | ||
if [[ ! -d "${SOURCEDIR}" ]] || [[ ! -d "${DSC_DIR}" ]] || [[ ! -d "${DSIMG_DIR}" ]]; then usage; fi | ||
if [[ ${DSC_DIR} == "." ]]; then usage; fi | ||
if [[ ! ${DS_VERSION} ]]; then DS_VERSION="${CSV_VERSION%.*}"; fi | ||
if [[ ! ${CSV_VERSION} ]]; then usage; fi | ||
|
||
# compute branch from already-checked out sources dir | ||
SOURCE_BRANCH=$(cd "$SOURCE_DIR"; git rev-parse --abbrev-ref HEAD) | ||
SOURCE_BRANCH=$(cd "$SOURCEDIR"; git rev-parse --abbrev-ref HEAD) | ||
|
||
############################################################### | ||
|
||
|
@@ -157,8 +153,8 @@ if [[ $DO_SYNC -eq 1 ]]; then | |
popd >/dev/null | ||
|
||
pushd $DSC_DIR >/dev/null | ||
./build/scripts/sync.sh -b ${MIDSTM_BRANCH} -s ${SOURCE_DIR} -t ${DSC_DIR} \ | ||
--crw-version ${DS_VERSION} | ||
./build/scripts/sync.sh -b ${MIDSTM_BRANCH} -s ${SOURCEDIR} -t ${DSC_DIR} \ | ||
-v ${DS_VERSION} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be -t for tag/DS_VERSION (x.y) not -v for CSV_VERSION (x.y.z). |
||
# commit changes | ||
set -x | ||
git add . | ||
|
This file contains 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
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.
indents are different on line 81 and 82.
please make sure that
-v
always means CSV_VERSION (x.y.z), not DS_VERSION / image tag (x.y) ==-t