This walkthrough explains how to migrate a repository from Azure DevOps to AL-Go for GitHub while preserving the full commit history. As a sample, I will use a repository, which was setup using the CI/CD Hands On Lab, including scripts and pipelines from this.
If you do not want to preserve the full commit history, you should use Scenario A or Scenario 11
Note
This walkthrough will leave your existing Azure DevOps repository untouched and you can decide to keep working in that if you like.
-
Start out by navigating to your Azure DevOps repository. Click the Clone button and click Generate Git Credentials.
-
Copy the Password to the clipboard, navigate to GitHub, login and click the small + menu in the top right corner and select Import repository.
-
Enter the GIT URL to the Azure DevOps repository, choose the owner+name of the new GitHub repository and specify privacy level. Click Begin Import.
-
If your GIT repository requires authentication, you will be asked to provide this (the password you copied to the clipboard).
-
After GitHub is done importing your repo, you can navigate to the repo.
-
In the new GitHub repository, you might see different messages about branches and PRs. This is because GitHub has imported everything. Ignore this for now. Click the <> Code button and copy the git address to the clipboard.
-
Open VS Code, press Ctrl+Shift+P, select Git Clone and paste your git URL into the address bar. Select a location, clone and open the repo and open the Repo in VS Code.
-
Delete the files and folders that are not needed in AL-Go for GitHub (including .github, .azureDevOps, .pipelines and scripts folders), leaving only your apps, your test apps and other files you want to preserve.
-
Now, download the AL-Go template needed, either the PTE template or the AppSource Template. Unpack the .zip file and open the unpacked template files.
-
Drag the needed files and folders from the unpacked files file into VS Code (at a minimum the .AL-Go folder and the .github folder) and select to Copy the folders.
-
Modify any settings necessary for the app. Typical settings you might need to modify are:
- appFolders, see https://aka.ms/algosettings#appfolders
- testFolders, see https://aka.ms/algosettings#testfolders
- appSourceMandatoryAffixes, see https://aka.ms/algosettings#appSourceMandatoryAffixes
- enableAppSourceCop, see https://aka.ms/algosettings#enableAppSourceCop
- enablePerTenantExtensionCop, see https://aka.ms/algosettings#enablePerTenantExtensionCop
- enableCodeCop, see https://aka.ms/algosettings#enableCodeCop
- enableUICop, see https://aka.ms/algosettings#enableUICop
- rulesetFile, see https://aka.ms/algosettings#rulesetFile
- enableExternalRulesets, see https://aka.ms/algosettings#enableExternalRulesets
- runNumberOffset, see https://aka.ms/algosettings#runNumberOffset
Also, if you are migrating an AppSource App, you will need to create a secret called LicenseFileUrl, which should contain a secure direct download URL to your license file, as mentioned here.
Finally, if you want AL-Go for GitHub to digitally sign your file, you need to create two secrets in the repository (or in the organization) called CodeSignCertificateUrl and CodeSignCertificatePassword, being a secure direct download URL to your PFX certificate and the PFX password for the certificate.
See a list of all settings here.
-
In VS Code, in the Source Control area, Add all changed files, Commit the changes and press Sync Changes to push to GitHub.
-
Navigate back to your repository on GitHub. See that your files have been uploaded. Click Settings -> Actions -> General, select Allow all actions and reusable workflows and click Save.
-
Click Actions, select the CI/CD workflow and click Run workflow to manually run the CI/CD workflow.
-
Open the running workflow to see status and summary and wait for the build to complete.
-
Navigate to Code and click Commits to see the history and all your commits.