refactor: build the package separately from running ci

This commit is contained in:
Jose Diaz-Gonzalez committed 2020-06-19 22:01:12 -04:00
1 parent ef91685596
commit 9451216606
2 files changed
+47 -15

No files matched your search

+28 -8
View File
@@ -10,21 +10,41 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
index: [0, 1, 2,3]
env:
GITHUB_NODE_INDEX: ${{ matrix.compiler }}
name: ci.${{ matrix.index }} name: ci.${{ matrix.index }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: install ci-dependencies - name: install ci-dependencies
run: make ci-dependencies run: make ci-dependencies
- name: build package
run: ./tests/ci/setup.sh build
- name: upload packages
uses: actions/upload-artifact@v2
with:
name: build
path: build
ci:
env:
GITHUB_NODE_INDEX: ${{ matrix.compiler }}
name: ci.${{ matrix.index }}
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
index: [0, 1, 2,3]
steps:
- uses: actions/checkout@v2
- name: download packages
uses: actions/download-artifact@v1
with:
name: build
- name: setup tests - name: setup tests
run: ./tests/ci/setup.sh run: ./tests/ci/setup.sh
+19 -7
View File
@@ -40,6 +40,11 @@ install_dependencies() {
} }
build_dokku() { build_dokku() {
if [[ "$FROM_SOURCE" == "true" ]]; then
sudo -E CI=true make -e install
return
fi
echo "=====> build_dokku on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX" echo "=====> build_dokku on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
"${ROOT_DIR}/contrib/release-dokku" build "${ROOT_DIR}/contrib/release-dokku" build
} }
@@ -47,13 +52,10 @@ build_dokku() {
install_dokku() { install_dokku() {
echo "=====> install_dokku on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX" echo "=====> install_dokku on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
if [[ "$FROM_SOURCE" == "true" ]]; then if [[ ! -f "${ROOT_DIR}/build/deb-filename" ]]; then
sudo -E CI=true make -e install build_dokku
return
fi fi
build_dokku
echo "dokku dokku/hostname string dokku.me" | sudo debconf-set-selections echo "dokku dokku/hostname string dokku.me" | sudo debconf-set-selections
echo "dokku dokku/key_file string /root/.ssh/id_rsa.pub" | sudo debconf-set-selections echo "dokku dokku/key_file string /root/.ssh/id_rsa.pub" | sudo debconf-set-selections
echo "dokku dokku/nginx_enable boolean true" | sudo debconf-set-selections echo "dokku dokku/nginx_enable boolean true" | sudo debconf-set-selections
@@ -102,14 +104,19 @@ check_container() {
done done
} }
# shellcheck disable=SC2120 create_package() {
setup_circle() {
echo "=====> setup_circle on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX" echo "=====> setup_circle on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
sudo -E CI=true make -e sshcommand sudo -E CI=true make -e sshcommand
# need to add the dokku user to the docker group # need to add the dokku user to the docker group
sudo usermod -G docker dokku sudo usermod -G docker dokku
[[ "$1" == "buildstack" ]] && BUILD_STACK=true make -e stack [[ "$1" == "buildstack" ]] && BUILD_STACK=true make -e stack
install_dependencies
build_dokku
}
# shellcheck disable=SC2120
setup_circle() {
install_dependencies install_dependencies
install_dokku install_dokku
@@ -129,6 +136,11 @@ case "$1" in
build_dokku_docker_image build_dokku_docker_image
run_dokku_container run_dokku_container
;; ;;
build)
# shellcheck disable=SC2119
create_package
exit $?
;;
*) *)
# shellcheck disable=SC2119 # shellcheck disable=SC2119
setup_circle setup_circle