Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): push domain-proxy docker images to remote repository. #12331

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -925,3 +925,67 @@ jobs:
python -m pip install --upgrade pip
pip install Pyrebase
python ci-scripts/firebase_publish.py
domain-proxy-build:
if: github.repository_owner == 'magma'
name: domain proxy build job
runs-on: ubuntu-latest
outputs:
artifacts: ${{ steps.publish_artifacts.outputs.artifacts }}
env:
MAGMA_ROOT: "${{ github.workspace }}"
steps:
- uses: actions/checkout@v2
- name: Prepare tools
working-directory: "${{ github.workspace }}/dp"
run: |
make _install_skaffold_ci
- name: Create release Tag
if: github.event_name == 'push'
run: |
if [ "$GITHUB_REF" = "refs/heads/master" ]; then
echo TAG="${GITHUB_SHA:0:8}" >> $GITHUB_ENV
else
GIT_BRANCH_VERSION=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
echo TAG="${GIT_BRANCH_VERSION:1}" >> $GITHUB_ENV
fi
- name: Tag and push to Jfrog Registry
if: github.event_name == 'push'
working-directory: "${{ github.workspace }}/dp"
env:
DOCKER_REGISTRY: "orc8r-test.artifactory.magmacore.org"
DOCKER_USERNAME: "${{ secrets.JFROG_USERNAME }}"
DOCKER_PASSWORD: "${{ secrets.JFROG_PASSWORD }}"
run: |
docker login "${DOCKER_REGISTRY}" -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}"
skaffold build --default-repo="${DOCKER_REGISTRY}" --tag="${TAG}" --push --profile=remote-push
- name: Extract commit title
if: github.event_name == 'push'
id: commit
run: |
str="$(jq '.head_commit.message' $GITHUB_EVENT_PATH)" # get the head_commit message
echo ::set-output name=title::${str%%\\n*} | tr -d '"'
- name: Notify failure to Slack
if: failure() && github.event_name == 'push'
uses: rtCamp/action-slack-notify@v2.2.0
# yamllint enable
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: "Github action domain-proxy-build failed"
SLACK_USERNAME: "Build workflow"
SLACK_MESSAGE: "${{ steps.commit.outputs.title}}"
SLACK_ICON_EMOJI: ":boom:"
SLACK_COLOR: "#FF0000"
SLACK_FOOTER: ' '
# Notify ci channel when push succeeds
- name: Notify success to Slack
if: failure() && github.event_name == 'push'
uses: rtCamp/action-slack-notify@v2.2.0
env:
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL_ARTIFACTS }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_OSS }}
SLACK_TITLE: "*Domain proxy images have been published*"
SLACK_MESSAGE: "${{ steps.commit.outputs.title}}"
SLACK_USERNAME: "Build workflow"
SLACK_ICON_EMOJI: ":heavy_check_mark:"
SLACK_COLOR: "#00FF00"
SLACK_FOOTER: ' '
4 changes: 4 additions & 0 deletions dp/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,7 @@ profiles:
- "sh"
- "-c"
- "/var/opt/magma/bin/accessc add-existing -admin -cert /var/opt/magma/certs/admin_operator.pem admin_operator || exit 0"
- name: remote-push
patches:
- op: remove
path: /build/artifacts/5 # remove fake sas image