forked from lucimobility/luci-ros2-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from lucimobility/feature/humble-release
Added action and bash script
- Loading branch information
Showing
2 changed files
with
84 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Create and Deploy Docker | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
DEV: | ||
type: boolean | ||
description: "If the DEV image should be build" | ||
required: true | ||
default: false | ||
RELEASE: | ||
type: boolean | ||
description: "If the public RELEASE image should be build" | ||
required: true | ||
default: false | ||
|
||
|
||
env: | ||
REPO: ${{github.event.repository.name}} | ||
JF_URL: ${{ secrets.JF_URL }} | ||
JF_ACCESS_TOKEN: ${{ secrets.artifactory_token}} | ||
|
||
jobs: | ||
Build-and-deploy-dev: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: jfrog/setup-jfrog-cli@v3 | ||
|
||
- name: Checkout SDK Branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref }} | ||
path: ${{env.REPO}} | ||
|
||
- name: Build and deploy dev | ||
if: ${{ github.event.inputs.DEV == 'true'}} | ||
run: | | ||
cd ${{env.REPO}} | ||
./build-and-deploy-dockers.sh -d | ||
shell: bash | ||
|
||
Build-and-deploy-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: jfrog/setup-jfrog-cli@v3 | ||
- name: Checkout SDK Branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref }} | ||
path: ${{env.REPO}} | ||
|
||
- name: Build and deploy release | ||
if: ${{ github.event.inputs.RELEASE == 'true' }} | ||
run: | | ||
cd ${{env.REPO}} | ||
./build-and-deploy-dockers.sh -r | ||
shell: bash |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
while getopts 'dr' flag; | ||
do | ||
case "${flag}" in | ||
d) development=true;; | ||
r) release=true;; | ||
esac | ||
done | ||
|
||
if [ "$development" = true ]; then | ||
echo "Development building..." | ||
cd development | ||
# Build development image | ||
docker build -t luci.jfrog.io/ros2-sdk-docker-local/luci-sdk-development-image:latest . | ||
# Push development image to jfrog | ||
docker push luci.jfrog.io/ros2-sdk-docker-local/luci-sdk-development-image:latest | ||
fi | ||
|
||
if [ "$release" = true ]; then | ||
echo "Release building..." | ||
|
||
# Build release image | ||
docker build -t luci.jfrog.io/ros2-sdk-docker-local/luci-ros2-sdk:latest . | ||
# Push release image to jfrog | ||
docker push luci.jfrog.io/ros2-sdk-docker-local/luci-ros2-sdk:latest | ||
fi |