run apt-get update before git-core installation #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
permissions: | |
contents: read | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
name: deploy | |
jobs: | |
build_and_deploy: | |
runs-on: self-hosted | |
name: ubuntu build | |
container: | |
image: ubuntu | |
steps: | |
- name: Install Git | |
run: apt-get update && apt-get install git-core | |
- uses: actions/checkout@main | |
with: | |
submodules: true | |
- name: Checkout repo | |
run: | | |
ls -lah | |
apt-get install repo | |
chmod +x scripts/fetch_distribution_package.sh | |
./scripts/fetch_distribution_package.sh | |
- name: Install docker | |
run: | | |
apt-get update | |
apt-get install ca-certificates curl gnupg | |
install -m 0755 -d /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
chmod a+r /etc/apt/keyrings/docker.gpg | |
echo \ | |
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | |
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ | |
tee /etc/apt/sources.list.d/docker.list > /dev/null | |
apt-get update | |
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
- name: Build the docker image | |
run: | | |
chmod +x scripts/build_docker.sh | |
./scripts/build_docker.sh | |
systemctl start docker | |
echo "old container removed" | |
docker ps -a | |
docker images | |
docker run -i -d -P --name yocto -v ./data/:/data ubuntu-yocto | |
echo "running container in detached state" | |
docker ps | |
chmod -R 777 data | |
ls -lah | |
docker exec -i yocto bash -c "cd /data && ls -lah && source scripts/setup_env.sh && bitbake aurora-image-core && bitbake -c populate_sdk aurora-image-core" | |
#- name: Run the Yocto build in the docker container and create the SDK | |
# run: | | |
# sudo chmod +x scripts/start_docker.sh | |
# sudo ./scripts/start_docker.sh | |
# cd data | |
# source scripts/setup_env.sh | |
# bitbake aurora-image-core | |
# bitbake -c populate_sdk aurora-image-core | |
- name: Create the SD card image | |
run: | | |
cd data/openstlinux-kirkstone/build-openstlinuxweston-stm32mp1/tmp-glibc/deploy/images/stm32mp1/scripts | |
./create_sdcard_from_flashlayout.sh ../flashlayout_aurora-image-core/extensible/FlashLayout_sdcard_stm32mp157c-dk2-extensible.tsv | |
- name: Save the SD card image as an artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sd_card_image | |
path: data/openstlinux-kirkstone/build-openstlinuxweston-stm32mp1/tmp-glibc/deploy/images/stm32mp1/FlashLayout_sdcard_stm32mp157c-dk2-extensible.raw | |
- name: Save the SDK as an artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sdk | |
path: data/openstlinux-kirkstone/build-openstlinuxweston-stm32mp1/tmp-glibc/deploy/sdk/ | |