-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildspec.yml
55 lines (49 loc) · 1.88 KB
/
buildspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
version: 0.2
env:
variables:
FORCE_UNSAFE_CONFIGURE: 1
ROOT_PATH: "/openwrt"
phases:
install:
commands:
- echo "Installing dependencies"
- apt-get update
- apt -y install build-essential clang flex bison g++ gawk gcc-multilib g++-multilib gettext git libncurses5-dev libssl-dev python3-distutils rsync unzip zlib1g-dev file wget python3
- apt -y install --upgrade awscli
# remove pyenv from path to use the default system installation.
- export PATH=$(echo $PATH | sed 's@/root/.pyenv/shims:/root/.pyenv/bin:@@g')
pre_build:
commands:
- mkdir -p $ROOT_PATH
- cp -r $CODEBUILD_SRC_DIR/. $ROOT_PATH
- mkdir -p $ROOT_PATH/keys
- aws s3 cp s3://onion-build/openwrt/openwrt21.key $ROOT_PATH/keys/key-build
- aws s3 cp s3://onion-build/openwrt/openwrt21.pub $ROOT_PATH/keys/key-build.pub
build:
commands:
- cd $ROOT_PATH
- bash build.sh
post_build:
commands:
- if [ "$CODEBUILD_BUILD_SUCCEEDING" = "0" ]; then echo ">>> VERBOSE DEBUG BUILD"; bash build.sh -V ; exit 1; fi
- cd $ROOT_PATH
- RELEASE_VERSION=$(. $ROOT_PATH/profile; echo ${VERSION#v})
- export TAG_NAME=`git describe --tags`
- echo "Copying Packages"
- cd "$ROOT_PATH/openwrt/bin/packages/mipsel_24kc"
- aws s3 cp --recursive . "s3://$OUTPUT_BUCKET/releases/$RELEASE_VERSION/packages/mipsel_24kc/"
- echo "Copying Binaries"
- cd "$ROOT_PATH/openwrt/bin/targets/ramips/mt76x8"
- aws s3 cp --recursive . "s3://$OUTPUT_BUCKET/releases/$RELEASE_VERSION/targets/ramips/mt76x8/"
cache:
paths:
- /var/cache/apt/**/*
- /var/lib/apt/lists/**/*
artifacts:
type: zip
files:
- "packages/mipsel_24kc/**/*"
- "targets/ramips/mt76x8/**/*"
base-directory: "$ROOT_PATH/openwrt/bin"