2018-07-09 08:03:44 -06:00
|
|
|
version: 2
|
|
|
|
jobs:
|
2018-07-11 21:50:28 -06:00
|
|
|
######################################
|
|
|
|
# Common
|
|
|
|
######################################
|
2018-07-09 08:03:44 -06:00
|
|
|
build:
|
2022-12-23 08:10:58 -07:00
|
|
|
resource_class: large
|
2018-07-09 08:03:44 -06:00
|
|
|
docker:
|
2021-11-19 20:48:30 -07:00
|
|
|
- image: arednmesh/builder
|
|
|
|
|
2018-07-09 08:03:44 -06:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Update Config.mk
|
|
|
|
command: |
|
2018-07-09 12:08:22 -06:00
|
|
|
export MY_WORKING_DIRECTORY=`pwd`
|
2020-12-17 15:01:15 -07:00
|
|
|
export MY_PROCS=`nproc`
|
2020-12-17 15:19:06 -07:00
|
|
|
echo "#Procs: ${MY_PROCS}, DASH_J_VALUE: ${DASH_J_VALUE}"
|
2018-07-11 21:50:28 -06:00
|
|
|
sed -i "s/NoCall/${CIRCLE_BUILD_NUM}/g" ${MY_WORKING_DIRECTORY}/config.mk
|
2020-12-17 15:19:06 -07:00
|
|
|
sed -i "s/MAKE_ARGS=-j3/MAKE_ARGS=-j${DASH_J_VALUE}/g" ${MY_WORKING_DIRECTORY}/config.mk
|
2018-07-09 12:08:22 -06:00
|
|
|
cat ${MY_WORKING_DIRECTORY}/config.mk
|
2021-04-11 06:12:52 -06:00
|
|
|
echo "${TARGET_DIR}"
|
2018-07-09 08:03:44 -06:00
|
|
|
- run:
|
|
|
|
name: Build
|
2022-12-22 13:22:49 -07:00
|
|
|
command: make MAINTARGET=ath79 SUBTARGET=generic
|
2021-11-19 14:13:15 -07:00
|
|
|
no_output_timeout: 2h
|
2018-07-11 21:50:28 -06:00
|
|
|
- run:
|
|
|
|
name: Build
|
2022-12-22 13:22:49 -07:00
|
|
|
command: make MAINTARGET=ath79 SUBTARGET=tiny
|
2021-11-19 14:13:15 -07:00
|
|
|
no_output_timeout: 1h
|
2020-01-22 18:37:27 -07:00
|
|
|
- run:
|
|
|
|
name: Build
|
2022-12-22 13:22:49 -07:00
|
|
|
command: make MAINTARGET=ath79 SUBTARGET=mikrotik
|
2021-11-19 14:13:15 -07:00
|
|
|
no_output_timeout: 1h
|
2022-12-22 13:22:49 -07:00
|
|
|
- run:
|
|
|
|
name: Build
|
|
|
|
command: make MAINTARGET=ath79 SUBTARGET=mikrotik ALTTARGET=ath10k
|
|
|
|
no_output_timeout: 1h
|
2022-12-22 22:34:43 -07:00
|
|
|
- run:
|
|
|
|
name: Build
|
|
|
|
command: make MAINTARGET=ath79 SUBTARGET=mikrotik ALTTARGET=nand
|
|
|
|
no_output_timeout: 1h
|
2022-12-22 13:22:49 -07:00
|
|
|
- run:
|
|
|
|
name: Build
|
|
|
|
command: make MAINTARGET=ath79 SUBTARGET=nand
|
|
|
|
no_output_timeout: 1h
|
|
|
|
- run:
|
|
|
|
name: Build
|
|
|
|
command: make MAINTARGET=ipq40xx SUBTARGET=mikrotik
|
|
|
|
no_output_timeout: 2h
|
2023-04-28 12:01:58 -06:00
|
|
|
- run:
|
|
|
|
name: Build
|
|
|
|
command: make MAINTARGET=x86 SUBTARGET=64
|
|
|
|
no_output_timeout: 2h
|
2018-07-09 08:03:44 -06:00
|
|
|
- run:
|
|
|
|
name: Compress build files
|
2018-07-12 08:39:08 -06:00
|
|
|
command: tar -cjf ~/${CIRCLE_BRANCH}_${ARTIFACTS_FILE} -C ${MY_WORKING_DIRECTORY}/${ARTIFACTS_DIR} .
|
2018-07-09 08:03:44 -06:00
|
|
|
- run:
|
|
|
|
name: Deploy Files
|
2020-12-17 14:48:52 -07:00
|
|
|
command: scp -o StrictHostKeyChecking=no ~/${CIRCLE_BRANCH}_${ARTIFACTS_FILE} ${SSH_USER}@${SSH_HOST}:${TARGET_DIR}
|
2023-04-18 11:15:51 -06:00
|
|
|
|
2018-08-07 07:37:31 -06:00
|
|
|
check2build:
|
2018-08-05 10:23:33 -06:00
|
|
|
machine:
|
2023-04-19 20:20:48 -06:00
|
|
|
image: ubuntu-2004:2023.02.1
|
2018-08-05 10:23:33 -06:00
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: Retrieve last build info and check
|
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c ' ~/needs2build.sh ${CIRCLE_PROJECT_USERNAME} ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_BRANCH} ${CIRCLE_SHA1}'"
|
2021-11-23 08:24:22 -07:00
|
|
|
- run:
|
|
|
|
name: Check2build failure (build not needed)
|
|
|
|
when: on_fail
|
|
|
|
command: circleci-agent step halt
|
2023-04-18 11:15:51 -06:00
|
|
|
|
2018-08-05 10:23:33 -06:00
|
|
|
save_build_info:
|
2023-04-19 20:20:48 -06:00
|
|
|
machine:
|
|
|
|
image: ubuntu-2004:2023.02.1
|
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: Save last build info
|
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c ' echo ${CIRCLE_SHA1} > ~/build_info/${CIRCLE_PROJECT_USERNAME}_${CIRCLE_PROJECT_REPONAME}_${CIRCLE_BRANCH}'"
|
2018-08-05 10:23:33 -06:00
|
|
|
|
2018-07-11 21:50:28 -06:00
|
|
|
######################################
|
|
|
|
# Nightly
|
|
|
|
######################################
|
|
|
|
process_artifacts_nightly:
|
|
|
|
machine:
|
2023-04-19 20:20:48 -06:00
|
|
|
image: ubuntu-2004:2023.02.1
|
2018-07-11 21:50:28 -06:00
|
|
|
steps:
|
2018-07-09 08:03:44 -06:00
|
|
|
- run:
|
2018-07-09 13:50:17 -06:00
|
|
|
name: Untar Files
|
2020-12-17 14:48:52 -07:00
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c 'tar -xjf ${TARGET_DIR}/${CIRCLE_BRANCH}_${ARTIFACTS_FILE} -C ${TARGET_DIR}'"
|
2018-07-09 13:50:17 -06:00
|
|
|
- run:
|
|
|
|
name: Empty nightly dir
|
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c 'rm -rf ${NIGHTLY_DIR}'"
|
2018-07-14 22:47:51 -06:00
|
|
|
- run:
|
|
|
|
name: Create nightly dir
|
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c 'mkdir -p ${NIGHTLY_DIR}'"
|
2018-07-09 13:50:17 -06:00
|
|
|
- run:
|
|
|
|
name: Move targets
|
2020-12-17 14:48:52 -07:00
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c 'mv ${TARGET_DIR}/targets ${NIGHTLY_DIR}'"
|
2018-07-09 13:50:17 -06:00
|
|
|
- run:
|
|
|
|
name: Move packages
|
2020-12-17 14:48:52 -07:00
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c 'mv ${TARGET_DIR}/packages ${NIGHTLY_DIR}'"
|
2018-07-11 21:50:28 -06:00
|
|
|
|
|
|
|
changelog_nightly:
|
|
|
|
machine:
|
2023-04-19 20:20:48 -06:00
|
|
|
image: ubuntu-2004:2023.02.1
|
2018-07-11 21:50:28 -06:00
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: Generate changelog.md
|
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c 'docker run --rm -v ~/:/usr/local/src/your-app ferrarimarco/github-changelog-generator -u ${CIRCLE_PROJECT_USERNAME} -p ${CIRCLE_PROJECT_REPONAME} -t ${GITHUB_TOKEN}'"
|
|
|
|
- run:
|
|
|
|
name: Move changelog
|
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c 'mv ~/CHANGELOG.md ${NIGHTLY_DIR}'"
|
|
|
|
|
|
|
|
readme_nightly:
|
|
|
|
machine:
|
2023-04-19 20:20:48 -06:00
|
|
|
image: ubuntu-2004:2023.02.1
|
2018-07-11 21:50:28 -06:00
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: Fetch README.md
|
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c 'wget https://raw.githubusercontent.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}/README.md'"
|
|
|
|
- run:
|
|
|
|
name: Move README.md
|
2018-07-12 08:58:45 -06:00
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c 'mv ~/README.md ${NIGHTLY_DIR}/readme.md'"
|
2022-12-28 11:22:57 -07:00
|
|
|
- run:
|
|
|
|
name: Fetch SUPPORTED_DEVICES.md
|
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c 'wget https://raw.githubusercontent.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}/SUPPORTED_DEVICES.md'"
|
|
|
|
- run:
|
|
|
|
name: Move SUPPORTED_DEVICES.md
|
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c 'mv ~/SUPPORTED_DEVICES.md ${NIGHTLY_DIR}/SUPPORTED_DEVICES.md'"
|
|
|
|
|
2018-07-11 21:50:28 -06:00
|
|
|
|
2022-01-19 21:56:35 -07:00
|
|
|
afs_collector:
|
|
|
|
machine:
|
2023-04-19 20:20:48 -06:00
|
|
|
image: ubuntu-2004:2023.02.1
|
2022-01-19 21:56:35 -07:00
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: Run AFS collector
|
|
|
|
command: ssh ${SSH_USER}@${SSH_HOST} "sh -c '${DOWNLOADS_DOCROOT}/afs/misc/collect.py --image-url http://downloads.arednmesh.org/{base}/{target} ${DOWNLOADS_DOCROOT} ${DOWNLOADS_DOCROOT}/afs/www'"
|
|
|
|
|
2018-07-11 21:50:28 -06:00
|
|
|
######################################
|
|
|
|
# Workflows
|
|
|
|
######################################
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
|
|
|
|
nightly:
|
|
|
|
triggers:
|
|
|
|
- schedule:
|
|
|
|
cron: "0 9 * * *" # 9AM UTC
|
|
|
|
filters:
|
|
|
|
branches:
|
2021-01-26 20:15:00 -07:00
|
|
|
only: main
|
2018-07-11 21:50:28 -06:00
|
|
|
jobs:
|
2018-08-07 07:37:31 -06:00
|
|
|
- check2build
|
2018-08-05 10:23:33 -06:00
|
|
|
- build:
|
|
|
|
requires:
|
2018-08-07 07:37:31 -06:00
|
|
|
- check2build
|
2018-07-11 21:50:28 -06:00
|
|
|
- process_artifacts_nightly:
|
|
|
|
requires:
|
|
|
|
- build
|
|
|
|
filters:
|
|
|
|
branches:
|
2021-01-26 20:15:00 -07:00
|
|
|
only: main
|
2018-07-11 21:50:28 -06:00
|
|
|
- readme_nightly:
|
|
|
|
requires:
|
2018-07-13 09:22:59 -06:00
|
|
|
- process_artifacts_nightly
|
2018-07-11 21:50:28 -06:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
2021-01-26 20:15:00 -07:00
|
|
|
- main
|
2018-07-11 21:50:28 -06:00
|
|
|
- changelog_nightly:
|
|
|
|
requires:
|
2018-07-13 09:22:59 -06:00
|
|
|
- process_artifacts_nightly
|
2018-07-11 21:50:28 -06:00
|
|
|
filters:
|
|
|
|
branches:
|
2021-01-26 20:15:00 -07:00
|
|
|
only: main
|
2022-01-19 21:56:35 -07:00
|
|
|
- afs_collector:
|
|
|
|
requires:
|
|
|
|
- process_artifacts_nightly
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: main
|
2023-04-18 11:15:51 -06:00
|
|
|
- save_build_info:
|
|
|
|
requires:
|
|
|
|
- process_artifacts_nightly
|