My Very Own CI-server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

108 lines
5.2 KiB

{{ define "title" }}{{ if eq .mode "add" }}Add Reposiroty{{ else }}Edit Repository{{end}}{{end}}
{{ define "toolbar" }}
{{ if eq .mode "add"}}
<li>
<a href="/repo">
<i class="fa fa-chevron-left"></i>Repositories
</a>
</li>
{{ else }}
<li>
<a href="/repo/view/{{ .repo.ID }}">
<i class="fa fa-chevron-left"></i>{{ .repo.Name }}
</a>
</li>
{{ end }}
{{ end }}
{{ define "content" }}
<h2>{{ if eq .mode "add" }}Add Repository{{ else }}Edit Repository{{ end }}</h2>
{{ render_error_list .errors }}
<div class="infobox">
You must ensure that the Flux CI server has read permission for
the clone URL that you specify below. The URL is stored unencrypted
in the database, thus you should <b>avoid</b> using the
<code class="repo_code">https://username:password@host/name</code> format.
</div>
<form method="post" action="{{ if eq .mode "add"}}/repo/post/add{{else}}/repo/post/edit/{{.repo.ID}}{{end}}">
<div class="field required">
<label for="repo_name">Name</label>
<input type="text" id="repo_name" name="repo_name" value="{{ if eq .mode "add" }}{{ else }}{{ .repo.Name }}{{ end}}" placeholder="Name"/>
</div>
<div class="field required">
<label for="repo_clone_url">Clone URL</label>
<input type="text" id="repo_clone_url" name="repo_clone_url" value="{{ if eq .mode "add" }}{{ else }}{{ .repo.CloneUrl }}{{ end }}" placeholder="https://..." />
<span id="repo_check_result" class="infobox" style="display: none;"></span>
</div>
<div class="field required">
<label for="repo_default_branch">Default Build Branch</label>
<div class="infobox">
The default branch for building from the web-interface.
This default setting is ignored, when the build is triggered
via a webhook.
</div>
<input type="text" id="repo_default_branch" name="repo_default_branch" value="{{ if eq .mode "add" }}master{{ else }}{{ .repo.DefaultBranch }}{{end}}" placeholder="master" />
</div>
{{ if eq .mode "edit" }}
<div class="field">
<label for="repo_secret">Secret</label>
<div class="infobox">
The secret key that is sent by the Git server for
authentication purpose. The default value is a randomly
generated UUID that serves the purpose. You can also leave
the field blank if the secret sent by the server is an empty string.
</div>
<input type="text" id="repo_secret" name="repo_secret" value="{{ .repo.Secret }}" />
</div>
{{ end }}
<div class="field">
<label for="repo_push_build_script">Build script for Push-Events</label>
<div class="infobox">
<b>Bash</b> script to be executed, when a build is requested either by user or by a Push-Event through a Webhook.
Use normal Bash-syntax.
There will be no parameters available for the script.
After the script ran the complete directory will be zipped (without <i>.git</i>-directory) so you may want to clean it from code.
</div>
<textarea id="repo_pushbuild_script" name="repo_push_build_script">{{ if eq .mode "add" }}{{ else }}{{ if .PushBuildScript }}{{ .PushBuildScript}}{{else}}{{ .repo.BuildScript }}{{end}}{{ end }}</textarea>
</div>
<div class="field">
<label for="repo_release_build_script">Build script for Release-Events</label>
<div class="infobox">
This Build script is used on Release-Events.
You may use the <i>$VERSION</i> environment variable, which contains the Tag-name to identify the version to your build-system.
The build artifact will then be uploaded to your VCS (currently gitea-only).
</div>
<textarea id="repo_release_build_script" name="repo_release_build_script">{{ if eq .mode "add" }}{{ else }}{{if .ReleaseBuildScript}}{{ .ReleaseBuildScript}}{{else}}{{ .repo.BuildScript }}{{end}}{{ end }}</textarea>
</div>
<div class="field">
<label>Build Hooks</label>
<div class="infobox">
Hooks are like callbacks for build your repository. The Webhook will enable integration with Github, Gitea and the like. The local build setup will enable a hook from the local machine. It can be triggered only from the local machine with the <em>mvoctl</em> script. Manual builds from the web interface are always enabled.
</div>
<label class="checkbox">
<input type="checkbox" name="repo_webhook_enable" {{ if .repo.WebHookEnable }}checked{{ end }} />
enable Webhook
</label>
</div>
<div class="field">
<label class="checkbox">
<input type="checkbox" name="repo_localbuild_enable" {{ if .repo.LocalBuildEnable }}checked{{ end }} />
enable local build (from local machine)
</label>
</div>
<div class="field">
<label>Misc Settings</label>
<label class="checkbox">
<input type="checkbox" name="repo_keepbuilds_enable" {{ if .repo.KeepBuilds }}checked{{ end }} />
Keep Build-archives
</label>
</div>
<div class="field">
<label class="checkbox">
<input type="checkbox" name="repo_public_enable" {{ if .repo.Public }}checked{{ end }} />
Public Repository
</label>
</div>
<button class="btn-primary">{{ if eq .mode "add" }}Add Repository{{ else }}Update{{ end }}</button>
</form>
{{ end }}