Local development
How to get started with local development
On this page:
When developing an application one will often have to work both in Altinn Studio and in a local development environment. Here is an overview of how to get started with local development.
Preparations
Follow the steps decribed on GitHub to prepare your local environment for development and testing of Altinn Apps.
How to clone an application to the local environment
Find the application you want to work with in the dashboard in Altinn Studio
Navigate to the repository by clicking the Repository-button
Copy the link of the repository (the blue square), either manually or by clicking the button marked with the red circle.
Open a terminal in your local environment
- Navigate to the desired location for the application repository
- Write the command
git clone
and paste the URL you copied in the previous step
$git clone https://altinn.studio/repos/ORG/APP.git
- In the terminal you should be seeing an output like the one below
Cloning into 'APP'... remote: Enumerating objects: 982, done. remote: Counting objects: 100% (982/982), done. remote: Compressing objects: 100% (950/950), done. remote: Total 982 (delta 600), reused 0 (delta 0), pack-reused 0 Receiving objects: 100% (982/982), 166.38 KiB | 1.51 MiB/s, done. Resolving deltas: 100% (600/600), done.
You should not be able to fine a new folder with the contents of the application repository. Open your preferred dev tool and get going with the app development!
How to synchronize changes in Altinn Studio
Upload changes to master
- Click Push on the Lage-page of the application in Altinn Studio
- Add a descriptive comment of the change(s) and click Valider endringer
- Wait for the changes to be validated
- If a conflict occurs, click Løs konflikt and follow the instructions
- Click Push to upload the changes to master
- If everything is successful you should see this confirmation
Download changes from master
- Click Pull on the Lage-page of the application in Altinn Studio
- If everything is successful you should see this confirmation
How to synchronize changes in local dev environment
Synchronization of changes made in the local dev environment can be achieved in several ways. Many dev tools have great integrations for this, check if your tool has this.
A description of how to synchronize changes from command line is available below.
Upload changes to master
Navigate to the application repository folder in a terminal
Add the files you want to push to master with the command
git add {insert path of the file}
The command can be run for single files, multiple files at once or a folderCommit the changes with a descriptive message with the command
git commit -m {insert comment}
Push the changes to master with
git push
Download changes from master
Navigate to the application repository folder in a terminal and run the command git pull
.