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.

snapcraft.yaml 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. name: gitea
  2. summary: Gitea - A painless self-hosted Git service
  3. description: |
  4. The goal of this project is to make the easiest, fastest, and most painless
  5. way of setting up a self-hosted Git service. With Go, this can be done with
  6. an independent binary distribution across ALL platforms that Go supports,
  7. including Linux, Mac OS X, Windows and ARM.
  8. type: app
  9. icon: public/img/gitea-lg.png
  10. confinement: strict
  11. grade: stable
  12. version: 'git'
  13. apps:
  14. gitea:
  15. command: bin/gitea
  16. plugs: [network, network-bind]
  17. web:
  18. command: bin/gitea web
  19. daemon: simple
  20. plugs: [network, network-bind]
  21. serv:
  22. command: bin/gitea serv
  23. plugs: [network, network-bind]
  24. admin:
  25. command: bin/gitea admin
  26. plugs: [network, network-bind]
  27. cert:
  28. command: bin/gitea cert
  29. hook:
  30. command: bin/gitea hook
  31. plugs: [network, network-bind]
  32. dump:
  33. command: bin/gitea dump
  34. plugs: [home]
  35. help:
  36. command: bin/gitea --help
  37. version:
  38. command: bin/gitea --version
  39. sqlite:
  40. command: usr/bin/sqlite3
  41. parts:
  42. go:
  43. source-tag: go1.8.3
  44. prime:
  45. - -*
  46. gitea:
  47. plugin: nil
  48. source: .
  49. source-type: git
  50. after: [ go ]
  51. stage-packages: [ git, sqlite3, openssh-client ]
  52. build-packages: [ libpam0g-dev, libsqlite3-dev]
  53. prepare: |
  54. export PATH=$SNAPCRAFT_PART_INSTALL/../../go/install/bin:$PATH
  55. export GOPATH=$SNAPCRAFT_PART_INSTALL/../go
  56. export bld=$SNAPCRAFT_PART_INSTALL/../build
  57. export src=$SNAPCRAFT_PART_INSTALL/../src
  58. mkdir -p $GOPATH/src/code.gitea.io/gitea
  59. cp -r $src/* $GOPATH/src/code.gitea.io/gitea
  60. build: |
  61. export PATH=$SNAPCRAFT_PART_INSTALL/../go/bin/:$SNAPCRAFT_PART_INSTALL/../../go/install/bin:$PATH
  62. export GOPATH=$SNAPCRAFT_PART_INSTALL/../go
  63. cd $GOPATH/src/code.gitea.io/gitea
  64. TAGS="bindata sqlite sqlite_unlock_notify pam cert" make generate build
  65. install: |
  66. # Set Convenience Variables
  67. src=$SNAPCRAFT_PART_INSTALL/../go/src/code.gitea.io/gitea
  68. giteaBase=$SNAPCRAFT_PART_INSTALL/gitea
  69. scurrent=/var/snap/$SNAPCRAFT_PROJECT_NAME/current
  70. scommon=/var/snap/$SNAPCRAFT_PROJECT_NAME/common
  71. # Copy build artifact and necessary files
  72. mkdir -p $giteaBase/conf
  73. # Workaround for gitea ignoring APP_DATA_PATH in app.ini after snap update.
  74. ln -s $scurrent/custom $giteaBase/custom
  75. ln -s $scommon/data $giteaBase/data
  76. # Workaround for cmd/certs not knowing how to put files somewhere else
  77. ln -s $scurrent/cert.pem $giteaBase/cert.pem
  78. ln -s $scurrent/key.pem $giteaBase/key.pem
  79. # Copy static content
  80. mkdir -p $SNAPCRAFT_PART_INSTALL/static
  81. cp $src/gitea $giteaBase/
  82. cp -r $src/LICENSE \
  83. $src/templates \
  84. $src/public \
  85. $src/scripts \
  86. $SNAPCRAFT_PART_INSTALL/static/
  87. cp -r $src/README.md \
  88. $src/LICENSE \
  89. $src/custom \
  90. $SNAPCRAFT_PART_INSTALL/
  91. prime:
  92. - -etc
  93. - -usr/lib/systemd
  94. - -usr/lib/gcc
  95. - -usr/lib/sasl2
  96. - -usr/lib/x86_64-linux-gnu/krb5
  97. - -usr/share/apport
  98. - -usr/share/bash-completion
  99. - -usr/share/doc
  100. - -usr/share/git-core/contrib
  101. - -usr/share/man
  102. - -usr/share/upstart
  103. - -var
  104. helpers:
  105. plugin: dump
  106. source: snap/helpers
  107. organize:
  108. simple_launcher.sh: bin/gitea
  109. app.ini: gitea/snapApp.ini
  110. configuration.sh: bin/gconfig
  111. prime:
  112. - bin/gitea
  113. - bin/gconfig
  114. - gitea/snapApp.ini