As-Frontend CI/CD
This page will describe the CI/CD process for the as-frontend repository, along with guiding you step by step on how to deploy a new version of the your chosen app from inside as-frontend.
As an example for the rest of this page I will assume that you are trying to upload a new app called "myApp", and that it exists in the apps folder, under the name "myApp".
Getting started
If your app has never been build before/put up to a pod/endpoint, then use the following steps to get started.
Make sure you are merged with master and have the latest version of the code.
Message Alex and ask him to introduce the ci/cd pipelines for your new app.
Updating an endpoint
Assuming you have already created an endpoint, you can update it by following the steps below.
Create a branch called "myApp/{branch-name-write-whatever-you-want-here}"
Make your changes to the code, commit and push them
Go to the as-frontend repository and go to the pipelines tab
Click on the "build-app" pipeline and look for your commit
Get the docker image of your commit Possibly make this link to the bottom of the page where we teach how to do that
Go to the as-devops-infra repository and make sure you are on the flux-frontend-dev project
Go to the "releases" folder and open the "myApp.yaml" file
Change the image tag to the one you got from the build-app step
Commit and push your changes, the message doesn't matter and it should be pushed to master
And you are done. Your app should be up and running in a few minutes.
Making a new endpoint
Go to the as-devops-infra repository and make sure you are on the flux-frontend-dev project
Go to the "releases" folder and find a file u can copy for instance "myApp.yaml"
Create a new file called "myNewEndpoint.yaml" and paste the contents of the file you copied
Change the image tag to the one docker image you want to upload, and find and replace "myApp" with "myNewEndpoint"
You are done. Your app should be up and running in a few minutes.
Figuring out my docker image tag
Go to the as-frontend repository and go to the pipelines tab
Click on the "build-app" pipeline and look for your commit
Click on Build/Push in the jobs section
Go to Docker Push
You can get the docker image from the top here or scroll down and get it at the bottom
That's your docker image have fun.
Troubleshooting
My build-app pipeline failed
If it fails for verify commits, that means you wrote a bad commit message, fix it and try again. To fix it you have to rebase your branch and rewrite the commit messages, alternatively you could also squash it. If you are unfamiliar with rebasing commits, or scared to do it either message Tom or Alex and they will help you out.
if it fails in the build step, then you have a problem with your code, fix it and try again. To fix it open the error message itself and look at why it's failing. Usually it has to do with imports and paths. Linux (which the dockers all run on) requires all paths written to be case sensitive, so even though the code works on your computer it might not work on the docker.
If it fails for any other reason, or you couldn't figure out the build step problem then please open an issue on the as-frontend repository and tag Alex and Tom (This is ideal land just message us in the real world).
My app hasn't gone up
Wait a few more minutes and try clear cache refreshing, if the problem persists make sure that the file is .yaml. If it still doesn't work, then message Jonathan or Alex and ask for their assistance.