Skip to content

Commit

Permalink
Sync develop to master (#115)
Browse files Browse the repository at this point in the history
<!-- Thanks for the contribution, this is awesome. -->

# PR Details
## Description
This is an intermediate branch cut from master which includes fixes to
the branch coupling of build and checkout scripts. This coupling can not
yet be removed from CI processes because this repository still uses
CircleCI. The functionality to decouple CI from branches is currently
only available through our GitHub actions
<!--- Describe your changes in detail -->

## Related GitHub Issue

<!--- This project only accepts pull requests related to open GitHub
issues or Jira Keys -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please DO NOT name partially fixed issues, instead open an issue
specific to this fix -->
<!--- Please link to the issue here: -->

## Related Jira Key

<!-- e.g. CAR-123 -->

## Motivation and Context
Decouple build/checkout from branch to make release process simpler
<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?
CI
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] Defect fix (non-breaking change that fixes an issue)
- [x] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that cause existing functionality
to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [ ] I have added any new packages to the sonar-scanner.properties file
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the
[**CONTRIBUTING**](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/Contributing.md)
document.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
  • Loading branch information
paulbourelly999 authored Apr 29, 2024
2 parents b6ac56f + 7454f81 commit 76a83ab
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ version: 2
# Run static code analyzer for SourceCloud
# Upload test results
# Every run command should start with source ${INIT_ENV} to ensure all default dependancies are available

# TODO:(CAR-6030) Move to github actions to remove branch/version coupling
jobs:
build:
# Pull docker image from docker hub
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Docker build

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
docker:
uses: usdot-fhwa-stol/actions/.github/workflows/docker.yml@main
17 changes: 17 additions & 0 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Docker Hub build

on:
push:
branches:
- develop
- master
- "release/*"
tags:
- "carma-system-*"

jobs:
dockerhub:
uses: usdot-fhwa-stol/actions/.github/workflows/dockerhub.yml@main
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
# License for the specific language governing permissions and limitations under
# the License.

FROM usdotfhwastoldev/carma-base:develop as deps

ARG DOCKER_ORG="usdotfhwastoldev"
ARG DOCKER_TAG="develop"
FROM ${DOCKER_ORG}/carma-base:${DOCKER_TAG} as deps

FROM deps as setup
ARG GIT_BRANCH="develop"

ARG ROS1_PACKAGES=""
ENV ROS1_PACKAGES=${ROS1_PACKAGES}
Expand All @@ -24,7 +26,7 @@ ENV ROS2_PACKAGES=${ROS2_PACKAGES}

RUN mkdir ~/src
COPY --chown=carma . /home/carma/src/
RUN ~/src/docker/checkout.bash
RUN ~/src/docker/checkout.bash -b ${GIT_BRANCH}
RUN ~/src/docker/install.sh

FROM deps
Expand Down
15 changes: 6 additions & 9 deletions docker/checkout.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
set -exo pipefail

dir=~
BRANCH=develop
while [[ $# -gt 0 ]]; do
arg="$1"
case $arg in
-d|--develop)
BRANCH=develop
-b|--branch)
BRANCH=$2
shift
shift
;;
-r|--root)
Expand All @@ -35,10 +37,5 @@ while [[ $# -gt 0 ]]; do
esac
done

if [[ "$BRANCH" = "develop" ]]; then
git clone https://github.com/usdot-fhwa-stol/carma-msgs.git ~/src/CARMAMsgs --branch $BRANCH
git clone https://github.com/usdot-fhwa-stol/carma-utils.git ~/src/CARMAUtils --branch $BRANCH
else
git clone https://github.com/usdot-fhwa-stol/carma-msgs.git ${dir}/src/CARMAMsgs --branch develop
git clone https://github.com/usdot-fhwa-stol/carma-utils.git ${dir}/src/CARMAUtils --branch develop
fi
git clone https://github.com/usdot-fhwa-stol/carma-msgs.git "${dir}"/src/CARMAMsgs --branch "${BRANCH}"
git clone https://github.com/usdot-fhwa-stol/carma-utils.git "${dir}"/src/CARMAUtils --branch "${BRANCH}"

0 comments on commit 76a83ab

Please sign in to comment.