Skip to content

Commit

Permalink
Sync develop to master (#25)
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 22, 2024
2 parents f740821 + f264f8e commit 3450f94
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 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 : Move this to github actions to take advantage of dynamic base branch selection
jobs:
build:
# Pull docker image from docker hub
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Docker build

on:
push:
branches-ignore:
- "develop"
- "release/*"
pull_request:
types: [opened, synchronize, reopened]

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ name: Docker Hub build
on:
push:
branches:
- "develop"
- develop
- master
- "release/*"
tags:
- "carma-system-*"

jobs:
dockerhub:
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM usdotfhwastoldev/carma-base:develop as base_image
ARG DOCKER_ORG=usdotfhwastoldev
ARG DOCKER_TAG=develop
FROM ${DOCKER_ORG}/carma-base:${DOCKER_TAG} as base_image

FROM base_image as build
ARG GIT_BRANCH=develop

COPY --chown=carma . /home/carma/autoware.auto
RUN chmod -R 775 /home/carma/autoware.auto/docker/checkout.bash
RUN chmod -R 775 /home/carma/autoware.auto/docker/install.sh
RUN /home/carma/autoware.auto/docker/checkout.bash
RUN /home/carma/autoware.auto/docker/checkout.bash -b ${GIT_BRANCH}
RUN ./home/carma/autoware.auto/docker/install.sh

FROM base_image
Expand Down
21 changes: 10 additions & 11 deletions docker/checkout.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,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 @@ -33,17 +35,14 @@ while [[ $# -gt 0 ]]; do
;;
esac
done

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

#TODO This probably needs to be moved into install.sh
sudo apt-get update
sudo apt-get install ros-foxy-nmea-msgs -y
sudo apt-get install ros-foxy-gps-tools -y
Expand Down

0 comments on commit 3450f94

Please sign in to comment.