ci auto deploy

This commit is contained in:
Martin/Geno 2019-02-26 20:37:30 +01:00
parent 1bfd7c3a59
commit e1ce88fe56
No known key found for this signature in database
GPG Key ID: 9D7D3C6BFF600C6A
5 changed files with 39 additions and 22 deletions

0
.ci/build_pkgs.sh Normal file → Executable file
View File

8
.ci/deploy.sh Executable file
View File

@ -0,0 +1,8 @@
HOST=$1
scp -6 -o StrictHostKeyChecking=no $CI_PROJECT_DIR/build_dir/bin/packages/mips_24kc/wifictld/wifictld_*mips_24kc.ipk "root@$HOST":/tmp/wifictld.ipk
ssh -6 -o StrictHostKeyChecking=no "root@$HOST" opkg install /tmp/wifictld.ipk
ssh -6 -o StrictHostKeyChecking=no "root@$HOST" opkg remove wifictld

0
.ci/download_sdk.sh Normal file → Executable file
View File

10
.ci/prepare_build_dir.sh Normal file → Executable file
View File

@ -4,11 +4,11 @@ cd $CI_PROJECT_DIR/build_dir
tar Jxf $CI_PROJECT_DIR/tmp/$SDK_FILE --strip=1 tar Jxf $CI_PROJECT_DIR/tmp/$SDK_FILE --strip=1
cat > feeds.conf <<EOF cat > feeds.conf <<EOF
src-git base https://git.openwrt.org/openwrt/openwrt.git src-git base https://git.openwrt.org/openwrt/openwrt.git;$SDK_BRANCH
src-git packages https://git.openwrt.org/feed/packages.git src-git packages https://git.openwrt.org/feed/packages.git;$SDK_BRANCH
src-git luci https://git.openwrt.org/project/luci.git src-git luci https://git.openwrt.org/project/luci.git;$SDK_BRANCH
src-git routing https://git.openwrt.org/feed/routing.git src-git routing https://git.openwrt.org/feed/routing.git;$SDK_BRANCH
src-git telephony https://git.openwrt.org/feed/telephony.git src-git telephony https://git.openwrt.org/feed/telephony.git;$SDK_BRANCH
src-git gluon https://github.com/freifunk-gluon/packages.git src-git gluon https://github.com/freifunk-gluon/packages.git
src-link $CI_PROJECT_NAME $CI_PROJECT_DIR src-link $CI_PROJECT_NAME $CI_PROJECT_DIR

View File

@ -1,22 +1,31 @@
image: openwrtorg/packages-cci image: openwrtorg/packages-cci
variables: variables:
SDK_HOST: "downloads.openwrt.org" SDK_HOST: "downloads.openwrt.org"
SDK_PATH: "snapshots/targets/ar71xx/generic" SDK_PATH: "snapshots/targets/ar71xx/generic"
SDK_FILE: "openwrt-sdk-ar71xx-generic_*.Linux-x86_64.tar.xz" SDK_FILE: "openwrt-sdk-ar71xx-generic_*.Linux-x86_64.tar.xz"
SDK_BRANCH: "openwrt-18.06"
stages: stages:
- compile - compile
- deploy
compile: compile:
stage: compile stage: compile
script: script:
- echo "==== Download the SDK ====" - echo "==== Download the SDK ===="
- sh .ci/download_sdk.sh - .ci/download_sdk.sh
- echo "==== Prepare build_dir ====" - echo "==== Prepare build_dir ===="
- sh .ci/prepare_build_dir.sh - .ci/prepare_build_dir.sh
- echo "==== build packages ====" - echo "==== build packages ===="
- sh .ci/build_pkgs.sh - .ci/build_pkgs.sh
artifacts: artifacts:
paths: paths:
- build_dir/bin/packages - build_dir/bin/packages
deploy:
stage: deploy
script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- .ci/deploy.sh flur.hotoho.n.sum7.eu