ci auto deploy
This commit is contained in:
		
							parent
							
								
									1bfd7c3a59
								
							
						
					
					
						commit
						655683ebbd
					
				|  | @ -1,8 +1,9 @@ | ||||||
| cd $CI_PROJECT_DIR/wireless/ | #!/bin/sh | ||||||
| PKGS=$(ls) |  | ||||||
| 
 | 
 | ||||||
| cd $CI_PROJECT_DIR/build_dir | cd $CI_PROJECT_DIR/build_dir | ||||||
| 
 | 
 | ||||||
|  | PKGS=$(ls $CI_PROJECT_DIR/wireless/) | ||||||
|  | 
 | ||||||
| echo "=== Found new/modified packages: $PKGS" | echo "=== Found new/modified packages: $PKGS" | ||||||
| for PKG in $PKGS ; do | for PKG in $PKGS ; do | ||||||
|     echo "===+ Download: $PKG" |     echo "===+ Download: $PKG" | ||||||
|  |  | ||||||
|  | @ -0,0 +1,12 @@ | ||||||
|  | #!/bin/sh | ||||||
|  | 
 | ||||||
|  | HOST=$1 | ||||||
|  | PKG=$2 | ||||||
|  | 
 | ||||||
|  | scp -6 -o StrictHostKeyChecking=no $CI_PROJECT_DIR/build_dir/bin/packages/mips_24kc/wifictld/"$PKG"_*mips_24kc.ipk "root@$HOST":/tmp/"$PKG".ipk | ||||||
|  | if [ $? != 0 ]; then | ||||||
|  | 	echo "error on uploading pkg" | ||||||
|  | 	exit 1 | ||||||
|  | fi | ||||||
|  | ssh -6 -o StrictHostKeyChecking=no "root@$HOST" opkg remove $PKG | ||||||
|  | ssh -6 -o StrictHostKeyChecking=no "root@$HOST" opkg install /tmp/"$PKG".ipk | ||||||
|  | @ -1,5 +1,7 @@ | ||||||
| mkdir -p $CI_PROJECT_DIR/tmp | #!/bin/sh | ||||||
| cd $CI_PROJECT_DIR/tmp | 
 | ||||||
|  | mkdir $CI_PROJECT_DIR/cache/ | ||||||
|  | cd $CI_PROJECT_DIR/cache/ | ||||||
| 
 | 
 | ||||||
| curl "https://$SDK_HOST/$SDK_PATH/sha256sums" -sS -o sha256sums | curl "https://$SDK_HOST/$SDK_PATH/sha256sums" -sS -o sha256sums | ||||||
| curl "https://$SDK_HOST/$SDK_PATH/sha256sums.asc" -sS -o sha256sums.asc | curl "https://$SDK_HOST/$SDK_PATH/sha256sums.asc" -sS -o sha256sums.asc | ||||||
|  |  | ||||||
|  | @ -1,15 +1,16 @@ | ||||||
| mkdir -p $CI_PROJECT_DIR/build_dir | #!/bin/sh | ||||||
|  | 
 | ||||||
|  | mkdir $CI_PROJECT_DIR/build_dir | ||||||
| cd  $CI_PROJECT_DIR/build_dir | cd  $CI_PROJECT_DIR/build_dir | ||||||
| 
 | 
 | ||||||
| tar Jxf $CI_PROJECT_DIR/tmp/$SDK_FILE --strip=1 | tar Jxf $CI_PROJECT_DIR/cache/$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^eef6bd3393f406f73187a670fa34d5e6a228f9e8 | ||||||
| src-git packages https://git.openwrt.org/feed/packages.git | src-git packages https://git.openwrt.org/feed/packages.git^d05b98c6c86da58db5cbda3c945007be09583609 | ||||||
| src-git luci https://git.openwrt.org/project/luci.git | src-git luci https://git.openwrt.org/project/luci.git^4ba85e3d82b684262c570e38a72d2dc3bb712a13 | ||||||
| src-git routing https://git.openwrt.org/feed/routing.git | src-git routing https://git.openwrt.org/feed/routing.git^bc6e7f6903c8237c77131aedfc92dba40e1bc6ac | ||||||
| src-git telephony https://git.openwrt.org/feed/telephony.git | src-git gluon https://github.com/freifunk-gluon/packages.git^a52d5ced54acfe399b3ac36b33d53034f341f06b | ||||||
| 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 | ||||||
| EOF | EOF | ||||||
|  |  | ||||||
|  | @ -52,5 +52,4 @@ Mkfile.old | ||||||
| dkms.conf | dkms.conf | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| tmp/ |  | ||||||
| build_dir/ | build_dir/ | ||||||
|  | @ -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" | ||||||
| 
 | 
 | ||||||
| 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 wifictld | ||||||
|  |  | ||||||
|  | @ -13,7 +13,7 @@ define Package/wifictld/Default | ||||||
| 	SECTION:=net | 	SECTION:=net | ||||||
| 	CATEGORY:=Network | 	CATEGORY:=Network | ||||||
| 	TITLE:=wireless control daemon | 	TITLE:=wireless control daemon | ||||||
| 	URL:=https://dev.sum7.eu/wifictld/wifictld | 	URL:=https://dev.sum7.eu/genofire/wifictld | ||||||
| 	DEPENDS:=+libubus +libubox | 	DEPENDS:=+libubus +libubox | ||||||
| endef | endef | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue