Skip to content

Commit

Permalink
feat: replace docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhouYixun committed Dec 10, 2022
1 parent 2e103c3 commit cddaa86
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 91 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: replace version
run: ver=${{ steps.previoustag.outputs.tag }} && new_ver=${ver:1} && sed -i "s/SONIC_VERSION/${new_ver}/g" pom.xml
- name: login docker hub
run: echo "${{ secrets.ACCESS_TOKEN }}" | docker login -u zhouyixun --password-stdin
run: echo "${{ secrets.ACCESS_TOKEN_ALIYUN }}" | docker login --username=${{ secrets.ALIYUN_USERNAME }} registry.cn-hongkong.aliyuncs.com --password-stdin
- name: sas-download
uses: robinraju/[email protected]
with:
Expand All @@ -52,12 +52,6 @@ jobs:
- name: sib
run: tar zxvf *_linux_x86_64.tar.gz && rm *_linux_x86_64.tar.gz && mv sib plugins/sonic-ios-bridge
- name: deploy
run: mvn package -Dplatform=linux-x86_64 && docker build -t sonicorg/sonic-agent-linux:${{ steps.previoustag.outputs.tag }} -f src/main/docker/Dockerfile .
run: mvn package -Dplatform=linux-x86_64 && docker build -t registry.cn-hongkong.aliyuncs.com/sonic-cloud/sonic-agent-linux:${{ steps.previoustag.outputs.tag }} -f src/main/docker/Dockerfile .
- name: push
run: docker push sonicorg/sonic-agent-linux:${{ steps.previoustag.outputs.tag }}
- name: login docker hub
run: echo "${{ secrets.ACCESS_TOKEN_ALIYUN }}" | docker login --username=${{ secrets.ALIYUN_USERNAME }} registry.cn-hangzhou.aliyuncs.com --password-stdin
- name: tag
run: docker tag sonicorg/sonic-agent-linux:${{ steps.previoustag.outputs.tag }} registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-agent-linux:${{ steps.previoustag.outputs.tag }}
- name: push
run: docker push registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-agent-linux:${{ steps.previoustag.outputs.tag }}
run: docker push registry.cn-hongkong.aliyuncs.com/sonic-cloud/sonic-agent-linux:${{ steps.previoustag.outputs.tag }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}/sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}.zip;src/main/docker/docker-compose.yml;src/main/docker/docker-compose2.yml
file: sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}/sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}.zip;src/main/docker/docker-compose.yml
tag_name: ${{ steps.previoustag.outputs.tag }}
update_latest_release: true
draft: false
52 changes: 1 addition & 51 deletions src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,54 +1,4 @@
FROM ubuntu:bionic-20220315

ENV DEBIAN_FRONTEND=noninteractive

ENV SDK_VERSION=commandlinetools-linux-7583922_latest

WORKDIR /root

RUN apt-get -qqy update && \
apt-get -qqy --no-install-recommends install \
ca-certificates \
usbmuxd \
zip \
unzip \
curl \
wget \
libqt5webkit5 \
libgconf-2-4 \
gnupg \
salt-minion \
libasound2-dev freeglut3-dev libgtk2.0-dev libusb-dev zlib1g libffi-dev libnss3 libbz2-dev zlib1g-dev \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

RUN wget -O java.tar.gz https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.2%2B7/OpenJDK15U-jdk_x64_linux_hotspot_15.0.2_7.tar.gz && \
tar zxvf java.tar.gz && rm java.tar.gz && \
chmod a+x -R /root/jdk-15.0.2+7 && \
chown -R root:root /root/jdk-15.0.2+7

ENV JAVA_HOME="/root/jdk-15.0.2+7" \
PATH=$PATH:$JAVA_HOME/bin

ENV ANDROID_HOME=/root

RUN mkdir -p $ANDROID_HOME/cmdline-tools && \
cd $ANDROID_HOME/cmdline-tools && \
wget -O tools.zip https://dl.google.com/android/repository/${SDK_VERSION}.zip && \
unzip tools.zip && rm tools.zip && \
mv ./* ./latest && \
chmod a+x -R $ANDROID_HOME && \
chown -R root:root $ANDROID_HOME

ENV PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest:$ANDROID_HOME/cmdline-tools/latest/bin

RUN mkdir -p ~/.android && \
touch ~/.android/repositories.cfg && \
echo y | sdkmanager "platform-tools"

ENV PATH=$PATH:$ANDROID_HOME/platform-tools

RUN mkdir -p mini plugins config
FROM registry.cn-hongkong.aliyuncs.com/sonic-cloud/sonic-agent-linux-base:v1.0.0

ADD /mini /root/mini
ADD /plugins /root/plugins
Expand Down
2 changes: 1 addition & 1 deletion src/main/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
sonic-agent:
image: "registry.cn-hangzhou.aliyuncs.com/sonic-cloud/sonic-agent-linux:SONIC_VERSION"
image: "registry.cn-hongkong.aliyuncs.com/sonic-cloud/sonic-agent-linux:SONIC_VERSION"
environment:
# 对应server的env配置,注意防火墙关闭对应端口
- SONIC_SERVER_HOST=192.168.1.1
Expand Down
29 changes: 0 additions & 29 deletions src/main/docker/docker-compose2.yml

This file was deleted.

0 comments on commit cddaa86

Please sign in to comment.