Skip to content

Commit

Permalink
Merge branch 'master' into 7137-two-line
Browse files Browse the repository at this point in the history
  • Loading branch information
dogi committed Aug 15, 2023
2 parents 03a381d + 07a21d4 commit 7ca1e2d
Show file tree
Hide file tree
Showing 83 changed files with 1,005 additions and 942 deletions.
108 changes: 108 additions & 0 deletions .github/workflows/planet-chat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Planet Chat API Builder

on:
push:
branches-ignore:
- l10n_i18n
release:
types: [published]
workflow_dispatch:

env:
DOCKER_ORG: treehouses
DOCKER_REPO_TAG: planet-tags
DOCKER_REPO: planet

jobs:

build-prepare:
name: Preparing
runs-on: ubuntu-latest
outputs:
planet_version: ${{ steps.step1.outputs.version }}
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setting Env
id: step1
run: |
version=$(jq '.version' package.json | sed -e 's/^"//' -e 's/"$//')
echo "::set-output name=version::$version"
build:
name: Chat API build
needs: [ build-prepare ]
runs-on: ubuntu-latest
env:
PLANET_VERSION: ${{ needs.build-prepare.outputs.planet_version }}

strategy:
matrix:
arch: [ amd64, arm, arm64 ]

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Docker login
run: docker login -u ${{ secrets.DOCKERUSERNAME }} -p ${{ secrets.DOCKERAPIKEY }}

- name: Build image
run: |
repo="$DOCKER_ORG/$DOCKER_REPO_TAG:${{ matrix.arch }}-chatapi-$PLANET_VERSION-$GITHUB_REF_NAME-${GITHUB_SHA::8}"
branchrepo="$DOCKER_ORG/$DOCKER_REPO_TAG:${{ matrix.arch }}-chatapi-$PLANET_VERSION-$GITHUB_REF_NAME"
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker build -f './docker/chatapi/${{ matrix.arch }}-Dockerfile' -t $repo .
docker images
docker tag $repo $branchrepo
docker push $repo
docker push $branchrepo
multiarch:
name: Manifest build
needs: [ build-prepare, build ]
env:
PLANET_VERSION: ${{ needs.build-prepare.outputs.planet_version }}
runs-on: ubuntu-latest

steps:
- name: Docker login
run: docker login -u ${{ secrets.DOCKERUSERNAME }} -p ${{ secrets.DOCKERAPIKEY }}

- name: Multiarch Deploy
run: |
sudo wget -O /usr/local/bin/manifest_tool https://github.com/estesp/manifest-tool/releases/download/v0.7.0/manifest-tool-linux-amd64
sudo chmod +x /usr/local/bin/manifest_tool
mkdir -p /tmp/MA_manifests
latesttag="$DOCKER_ORG/$DOCKER_REPO_TAG:chatapi-$PLANET_VERSION-$GITHUB_REF_NAME-${GITHUB_SHA::8}" yq e -n '.image = strenv(latesttag)' | \
amd64tag="$DOCKER_ORG/$DOCKER_REPO_TAG:amd64-chatapi-$PLANET_VERSION-$GITHUB_REF_NAME-${GITHUB_SHA::8}" yq e '.manifests[0].image = strenv(amd64tag)' - | \
yq e '.manifests[0].platform.architecture = "amd64"' - | \
yq e '.manifests[0].platform.os = "linux"' - | \
armtag="$DOCKER_ORG/$DOCKER_REPO_TAG:arm-chatapi-$PLANET_VERSION-$GITHUB_REF_NAME-${GITHUB_SHA::8}" yq e '.manifests[1].image = strenv(armtag)' - | \
yq e '.manifests[1].platform.architecture = "arm"' - | \
yq e '.manifests[1].platform.os = "linux"' - | \
arm64tag="$DOCKER_ORG/$DOCKER_REPO_TAG:arm64-chatapi-$PLANET_VERSION-$GITHUB_REF_NAME-${GITHUB_SHA::8}" yq e '.manifests[2].image = strenv(arm64tag)' - | \
yq e '.manifests[2].platform.architecture = "arm64"' - | \
yq e '.manifests[2].platform.os = "linux"' - | \
tee /tmp/MA_manifests/MA_chatapi_latest.yaml
manifest_tool push from-spec /tmp/MA_manifests/MA_chatapi_latest.yaml
- name: Multiarch Deploy Versioned
if: ${{ github.event_name == 'release' }}
run: |
sudo wget -O /usr/local/bin/manifest_tool https://github.com/estesp/manifest-tool/releases/download/v0.7.0/manifest-tool-linux-amd64
sudo chmod +x /usr/local/bin/manifest_tool
mkdir -p /tmp/MA_manifests
versiontag="$DOCKER_ORG/$DOCKER_REPO:chatapi-$PLANET_VERSION" yq e -n '.image = strenv(versiontag)' | \
yq e '.tags |= . + ["chatapi"] ' - | \
amd64tag="$DOCKER_ORG/$DOCKER_REPO_TAG:amd64-chatapi-$PLANET_VERSION-$GITHUB_REF_NAME-${GITHUB_SHA::8}" yq e '.manifests[0].image = strenv(amd64tag)' - | \
yq e '.manifests[0].platform.architecture = "amd64"' - | \
yq e '.manifests[0].platform.os = "linux"' - | \
armtag="$DOCKER_ORG/$DOCKER_REPO_TAG:arm-chatapi-$PLANET_VERSION-$GITHUB_REF_NAME-${GITHUB_SHA::8}" yq e '.manifests[1].image = strenv(armtag)' - | \
yq e '.manifests[1].platform.architecture = "arm"' - | \
yq e '.manifests[1].platform.os = "linux"' - | \
arm64tag="$DOCKER_ORG/$DOCKER_REPO_TAG:arm64-chatapi-$PLANET_VERSION-$GITHUB_REF_NAME-${GITHUB_SHA::8}" yq e '.manifests[2].image = strenv(arm64tag)' - | \
yq e '.manifests[2].platform.architecture = "arm64"' - | \
yq e '.manifests[2].platform.os = "linux"' - | \
tee /tmp/MA_manifests/MA_chatapi_versioned.yaml
manifest_tool push from-spec /tmp/MA_manifests/MA_chatapi_versioned.yaml
4 changes: 4 additions & 0 deletions .github/workflows/planet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v2

- name: Remove Landing Video
run: |
rm -rf ./src/assets/landing-page/video/landing.mp4
- name: Docker login
run: docker login -u ${{ secrets.DOCKERUSERNAME }} -p ${{ secrets.DOCKERAPIKEY }}

Expand Down
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc
dist/
tmp/
out-tsc/

# dependencies
/node_modules
node_modules/

# IDEs and editors
/.idea
Expand Down Expand Up @@ -51,3 +51,5 @@ package-lock.json
# extra yml files generated
docker/planet-*.yml
planet.yml

.env
168 changes: 0 additions & 168 deletions .travis.yml.old

This file was deleted.

66 changes: 0 additions & 66 deletions .travis/deploy_arm64.sh

This file was deleted.

13 changes: 0 additions & 13 deletions .travis/deploy_planet.sh

This file was deleted.

Loading

0 comments on commit 7ca1e2d

Please sign in to comment.