diff --git a/.circleci/config.yml b/.circleci/config.yml index f67248cb..fb038c21 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -52,7 +52,7 @@ jobs: name: Pull Deps command: | source ${INIT_ENV} - ./src/CARMAAvtVimbaDriver/docker/checkout.sh -r ${PWD} + ./src/CARMAAvtVimbaDriver/docker/checkout.bash -r ${PWD} - run: name: Build Driver command: | diff --git a/Dockerfile b/Dockerfile index 3b6e5709..ca36df31 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ FROM usdotfhwastol/carma-base:3.7.0 as setup RUN mkdir ~/src COPY --chown=carma . /home/carma/src/CARMAAvtVimbaDriver -RUN ~/src/CARMAAvtVimbaDriver/docker/checkout.sh +RUN ~/src/CARMAAvtVimbaDriver/docker/checkout.bash RUN ~/src/CARMAAvtVimbaDriver/docker/install.sh FROM usdotfhwastol/carma-base:3.7.0 diff --git a/docker/build-image.sh b/docker/build-image.sh index 688e8ec1..03f8c984 100755 --- a/docker/build-image.sh +++ b/docker/build-image.sh @@ -56,7 +56,7 @@ echo "Final image name: $USERNAME/$IMAGE:$COMPONENT_VERSION_STRING" cd .. if [[ $COMPONENT_VERSION_STRING = "test" ]]; then - sed "s|usdotfhwastol|$USERNAME|g; s|:[0-9]*\.[0-9]*\.[0-9]*|:$COMPONENT_VERSION_STRING|g; s|checkout.sh|checkout.sh -d|g" \ + sed "s|usdotfhwastol|$USERNAME|g; s|:[0-9]*\.[0-9]*\.[0-9]*|:$COMPONENT_VERSION_STRING|g; s|checkout.bash|checkout.bash -d|g" \ Dockerfile | docker build -f - --no-cache -t $USERNAME/$IMAGE:$COMPONENT_VERSION_STRING \ --build-arg VERSION="$COMPONENT_VERSION_STRING" \ --build-arg VCS_REF=`git rev-parse --short HEAD` \ diff --git a/docker/checkout.sh b/docker/checkout.bash similarity index 100% rename from docker/checkout.sh rename to docker/checkout.bash diff --git a/docker/system_release.sh b/docker/system_release.sh index 83d72b0e..cf489a2d 100755 --- a/docker/system_release.sh +++ b/docker/system_release.sh @@ -15,7 +15,7 @@ # the License. # This script takes a system release name and version number as arguments, and -# updates version dependencies in Dockerfile and /docker/checkout.sh accordingly. +# updates version dependencies in Dockerfile and /docker/checkout.bash accordingly. # The -u | --unprompted option can be used to skip the interactive prompts, and # provide arguments directly from the commandline. @@ -47,19 +47,22 @@ if git ls-remote -q | grep $RELEASE_BRANCH; then echo "Checking out $RELEASE_BRANCH branch." git checkout $RELEASE_BRANCH - echo "Updating checkout.sh to point to system release version." - sed -i "s|CARMA[a-zA-Z]*_[0-9]*\.[0-9]*\.[0-9]*|$SYSTEM_RELEASE|g; s|carma-[a-zA-Z]*-[0-9]*\.[0-9]*\.[0-9]*|$SYSTEM_RELEASE|g" docker/checkout.sh + echo "Updating .circleci/config.yml base image." + sed -i "s|carma-base:.*|carma-base:$SYSTEM_RELEASE|g" .circleci/config.yml + + echo "Updating checkout.bash to point to system release version." + sed -i "s|CARMA[a-zA-Z]*_[0-9]*\.[0-9]*\.[0-9]*|$SYSTEM_RELEASE|g; s|carma-[a-zA-Z]*-[0-9]*\.[0-9]*\.[0-9]*|$SYSTEM_RELEASE|g" docker/checkout.bash echo "Updating Dockerfile to point to system release version." sed -i "s|:CARMASystem_[0-9]*\.[0-9]*\.[0-9]*|:$SYSTEM_RELEASE|g; s|:carma-system-[0-9]*\.[0-9]*\.[0-9]*|:$SYSTEM_RELEASE|g; s|:[0-9]*\.[0-9]*\.[0-9]*|:$SYSTEM_RELEASE|g" Dockerfile - git add docker/checkout.sh Dockerfile + git add docker/checkout.bash Dockerfile git commit -m "Updated dependencies for $SYSTEM_RELEASE" git tag -a $SYSTEM_RELEASE -m "$SYSTEM_RELEASE version tag." - echo "Dockerfile and checkout.sh updated, committed, and tagged." + echo "Dockerfile and checkout.bash updated, committed, and tagged." else echo "$RELEASE_BRANCH does not exist. Exiting script." exit 0 diff --git a/hooks/pre_build b/hooks/pre_build index 30bbb8af..45bff830 100644 --- a/hooks/pre_build +++ b/hooks/pre_build @@ -1,7 +1,13 @@ #!/bin/bash if [[ "$SOURCE_BRANCH" = "develop" ]]; then - # add -t flag to checkout.sh and update image dependencies - sed -i "s|/checkout.sh|/checkout.sh -d|g; s|usdotfhwastol|usdotfhwastoldev|g; s|:[0-9]*\.[0-9]*\.[0-9]*|:develop|g" \ + # add -t flag to checkout.bash and update image dependencies + sed -i "s|/checkout.bash|/checkout.bash -d|g; s|usdotfhwastol|usdotfhwastoldev|g; s|:[0-9]*\.[0-9]*\.[0-9]*|:develop|g" \ Dockerfile +elif [[ "$SOURCE_BRANCH" =~ ^release/.*$ ]]; then + # swap checkout branch in checkout.bash to release branch + sed -i "s|usdotfhwastol|usdotfhwastolcandidate|g; s|:[0-9]*\.[0-9]*\.[0-9]*|:candidate|g; s|CARMA[a-zA-Z]*_[0-9]*\.[0-9]*\.[0-9]*|candidate|g; s|carma-[a-zA-Z]*-[0-9]*\.[0-9]*\.[0-9]*|candidate|g" \ + Dockerfile + sed -i "s|CARMA[a-zA-Z]*_[0-9]*\.[0-9]*\.[0-9]*|$SOURCE_BRANCH|g; s|carma-[a-zA-Z]*-[0-9]*\.[0-9]*\.[0-9]*|$SOURCE_BRANCH|g" \ + docker/checkout.bash fi \ No newline at end of file