I've made the following bash script, and added it under startup scripts for a google cloud VM. It doesn't seem to do anything however, and i cant quite understand why. Here is the code. I'm unexperienced in .sh scripts, so i might be missing something simple. I'd be happy if someone could help out.
#! /bin/bash
apt-get update
apt-get install python3-pip
apt-get install python3-venv
git clone https://github.com/account/myrepo.git
python3 -m venv myrepo
cd myrepo
source bin/activate
pip3 install beautifulsoup sklearn numpy pandas
screen -AmdS ./myrep/main.py
Edit: "Added under startup scripts" mean that when creating a google vm you can add a startup script to the instance. See the section "Providing startup script contents directly" here https://cloud.google.com/compute/docs/startupscript