Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ name: CI
on:
push:
branches:
- main
- master
- develop
tags: [v*]
paths-ignore:
- README.md
- CHANGELOG.md
- LICENSE
pull_request:
branches:
- main
- master
- develop
paths-ignore:
- README.md
- CHANGELOG.md
Expand Down Expand Up @@ -62,7 +64,7 @@ jobs:
with:
registry: "ghcr.io"
username: ${{ github.actor }}
password: ${{ secrets.PAT }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push amd64 image
uses: docker/build-push-action@v5
with:
Expand All @@ -89,7 +91,7 @@ jobs:
with:
registry: "ghcr.io"
username: ${{ github.actor }}
password: ${{ secrets.PAT }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push arm64 image
uses: docker/build-push-action@v5
with:
Expand Down
314 changes: 157 additions & 157 deletions azure-pipelines.yaml
Original file line number Diff line number Diff line change
@@ -1,162 +1,162 @@
trigger:
tags:
include:
- v*
branches:
include:
- develop
paths:
exclude:
- README.md
- LICENSE
pr: none

variables:
imageName: 'focal-freedom-236620/router'
imageTag: 'dev'
ref: $(Build.SourceBranch)
buildTag: $(Build.BuildId)
isRelease: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/')]

stages:
- stage: Build
jobs:
- job: RouterDockerImages

timeoutInMinutes: 240
# trigger:
# tags:
# include:
# - v*
# branches:
# include:
# - develop
# paths:
# exclude:
# - README.md
# - LICENSE
# pr: none

# variables:
# imageName: 'focal-freedom-236620/router'
# imageTag: 'dev'
# ref: $(Build.SourceBranch)
# buildTag: $(Build.BuildId)
# isRelease: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/')]

# stages:
# - stage: Build
# jobs:
# - job: RouterDockerImages

# timeoutInMinutes: 240

strategy:
matrix:
amd64:
poolImageName: 'Azure Pipelines'
imageTagSuffix: 'amd64'
arm32v7:
poolImageName: 'RPi'
imageTagSuffix: 'arm32v7'
arm64v8:
poolImageName: 'build-farm-coral'
imageTagSuffix: 'arm64v8'

pool: $(poolImageName)

steps:
- script: |
if [[ $(ref) == refs/tags* ]]; then
TAG=$(echo $(ref) | sed "s|refs/tags/v||g")
echo "##vso[task.setvariable variable=imageTag]$TAG"
else
LATESTTAG=$(git tag | tail -1)
LATESTVERS=${LATESTTAG#?}
if [ -z "$LATESTVERS" ]; then LATESTVERS=0.0.0; fi
echo "##vso[task.setvariable variable=imageTag]$LATESTVERS-b$(buildTag)"
fi
displayName: 'Set image tag'

- template: ./pipeline.yaml
parameters:
imageName: $(imageName)
imageTag: $(imageTag)-$(imageTagSuffix)
dockerFile: 'Dockerfile'

- stage: Publish
jobs:
- job: Dev_ioFogRouterDockerManifest

timeoutInMinutes: 240
# strategy:
# matrix:
# amd64:
# poolImageName: 'Azure Pipelines'
# imageTagSuffix: 'amd64'
# arm32v7:
# poolImageName: 'RPi'
# imageTagSuffix: 'arm32v7'
# arm64v8:
# poolImageName: 'build-farm-coral'
# imageTagSuffix: 'arm64v8'

# pool: $(poolImageName)

# steps:
# - script: |
# if [[ $(ref) == refs/tags* ]]; then
# TAG=$(echo $(ref) | sed "s|refs/tags/v||g")
# echo "##vso[task.setvariable variable=imageTag]$TAG"
# else
# LATESTTAG=$(git tag | tail -1)
# LATESTVERS=${LATESTTAG#?}
# if [ -z "$LATESTVERS" ]; then LATESTVERS=0.0.0; fi
# echo "##vso[task.setvariable variable=imageTag]$LATESTVERS-b$(buildTag)"
# fi
# displayName: 'Set image tag'

# - template: ./pipeline.yaml
# parameters:
# imageName: $(imageName)
# imageTag: $(imageTag)-$(imageTagSuffix)
# dockerFile: 'Dockerfile'

# - stage: Publish
# jobs:
# - job: Dev_ioFogRouterDockerManifest

# timeoutInMinutes: 240

pool: 'Azure Pipelines'

variables:
DOCKER_CLI_EXPERIMENTAL: enabled

steps:
- script: |
if [[ $(ref) == refs/tags* ]]; then
TAG=$(echo $(ref) | sed "s|refs/tags/v||g")
echo "##vso[task.setvariable variable=imageTag]$TAG"
else
LATESTTAG=$(git tag | tail -1)
LATESTVERS=${LATESTTAG#?}
if [ -z "$LATESTVERS" ]; then LATESTVERS=0.0.0; fi
echo "##vso[task.setvariable variable=imageTag]$LATESTVERS-b$(buildTag)"
fi
displayName: 'Set image tag'

- script: |
echo $(imageTag)
displayName: 'Check image tag'
# pool: 'Azure Pipelines'

# variables:
# DOCKER_CLI_EXPERIMENTAL: enabled

# steps:
# - script: |
# if [[ $(ref) == refs/tags* ]]; then
# TAG=$(echo $(ref) | sed "s|refs/tags/v||g")
# echo "##vso[task.setvariable variable=imageTag]$TAG"
# else
# LATESTTAG=$(git tag | tail -1)
# LATESTVERS=${LATESTTAG#?}
# if [ -z "$LATESTVERS" ]; then LATESTVERS=0.0.0; fi
# echo "##vso[task.setvariable variable=imageTag]$LATESTVERS-b$(buildTag)"
# fi
# displayName: 'Set image tag'

# - script: |
# echo $(imageTag)
# displayName: 'Check image tag'

- task: Docker@2
displayName: Login to Dockerhub
inputs:
command: login
containerRegistry: 'Edgeworx GCP'

- script: |
docker pull gcr.io/$(imageName):$(imageTag)-amd64
docker pull gcr.io/$(imageName):$(imageTag)-arm32v7
docker pull gcr.io/$(imageName):$(imageTag)-arm64v8
displayName: 'Pull amd64, arm32v7, and arm64v8 docker images'

- script: |
docker manifest create \
gcr.io/$(imageName):$(imageTag) \
--amend gcr.io/$(imageName):$(imageTag)-amd64 \
--amend gcr.io/$(imageName):$(imageTag)-arm32v7 \
--amend gcr.io/$(imageName):$(imageTag)-arm64v8
displayName: 'Create image manifest'

- script: |
docker manifest push gcr.io/$(imageName):$(imageTag)
displayName: 'Push image manifest'

- job: Prod_ioFogRouterDockerManifest
condition: eq(variables['isRelease'], true)

timeoutInMinutes: 240
# - task: Docker@2
# displayName: Login to Dockerhub
# inputs:
# command: login
# containerRegistry: 'Edgeworx GCP'

# - script: |
# docker pull gcr.io/$(imageName):$(imageTag)-amd64
# docker pull gcr.io/$(imageName):$(imageTag)-arm32v7
# docker pull gcr.io/$(imageName):$(imageTag)-arm64v8
# displayName: 'Pull amd64, arm32v7, and arm64v8 docker images'

# - script: |
# docker manifest create \
# gcr.io/$(imageName):$(imageTag) \
# --amend gcr.io/$(imageName):$(imageTag)-amd64 \
# --amend gcr.io/$(imageName):$(imageTag)-arm32v7 \
# --amend gcr.io/$(imageName):$(imageTag)-arm64v8
# displayName: 'Create image manifest'

# - script: |
# docker manifest push gcr.io/$(imageName):$(imageTag)
# displayName: 'Push image manifest'

# - job: Prod_ioFogRouterDockerManifest
# condition: eq(variables['isRelease'], true)

# timeoutInMinutes: 240

pool: 'Azure Pipelines'

variables:
DOCKER_CLI_EXPERIMENTAL: enabled

steps:
- script: |
if [[ $(ref) == refs/tags* ]]; then
TAG=$(echo $(ref) | sed "s|refs/tags/v||g")
echo "##vso[task.setvariable variable=imageTag]$TAG"
else
LATESTTAG=$(git tag | tail -1)
LATESTVERS=${LATESTTAG#?}
if [ -z "$LATESTVERS" ]; then LATESTVERS=0.0.0; fi
echo "##vso[task.setvariable variable=imageTag]$LATESTVERS-b$(buildTag)"
fi
displayName: 'Set image tag'

- script: |
echo $(imageTag)
displayName: 'Check image tag'
# pool: 'Azure Pipelines'

# variables:
# DOCKER_CLI_EXPERIMENTAL: enabled

# steps:
# - script: |
# if [[ $(ref) == refs/tags* ]]; then
# TAG=$(echo $(ref) | sed "s|refs/tags/v||g")
# echo "##vso[task.setvariable variable=imageTag]$TAG"
# else
# LATESTTAG=$(git tag | tail -1)
# LATESTVERS=${LATESTTAG#?}
# if [ -z "$LATESTVERS" ]; then LATESTVERS=0.0.0; fi
# echo "##vso[task.setvariable variable=imageTag]$LATESTVERS-b$(buildTag)"
# fi
# displayName: 'Set image tag'

# - script: |
# echo $(imageTag)
# displayName: 'Check image tag'

- task: Docker@2
displayName: Login to Dockerhub
inputs:
command: login
containerRegistry: 'Edgeworx GCP'

- script: |
docker pull gcr.io/$(imageName):$(imageTag)-amd64
docker pull gcr.io/$(imageName):$(imageTag)-arm32v7
docker pull gcr.io/$(imageName):$(imageTag)-arm64v8
displayName: 'Pull amd64, arm32v7, and arm64v8 docker images'

- script: |
docker manifest create \
gcr.io/$(imageName):$(imageTag) \
--amend gcr.io/$(imageName):$(imageTag)-amd64 \
--amend gcr.io/$(imageName):$(imageTag)-arm32v7 \
--amend gcr.io/$(imageName):$(imageTag)-arm64v8
displayName: 'Create image manifest'

- script: |
docker manifest push gcr.io/$(imageName):$(imageTag)
displayName: 'Push image manifest'
# - task: Docker@2
# displayName: Login to Dockerhub
# inputs:
# command: login
# containerRegistry: 'Edgeworx GCP'

# - script: |
# docker pull gcr.io/$(imageName):$(imageTag)-amd64
# docker pull gcr.io/$(imageName):$(imageTag)-arm32v7
# docker pull gcr.io/$(imageName):$(imageTag)-arm64v8
# displayName: 'Pull amd64, arm32v7, and arm64v8 docker images'

# - script: |
# docker manifest create \
# gcr.io/$(imageName):$(imageTag) \
# --amend gcr.io/$(imageName):$(imageTag)-amd64 \
# --amend gcr.io/$(imageName):$(imageTag)-arm32v7 \
# --amend gcr.io/$(imageName):$(imageTag)-arm64v8
# displayName: 'Create image manifest'

# - script: |
# docker manifest push gcr.io/$(imageName):$(imageTag)
# displayName: 'Push image manifest'
Loading