Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

036 mvp #25

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*.s9pk
scripts/*.js
startos/*.js
node_modules/
.DS_Store
.vscode/
docker-images/
docker-images
javascript
6 changes: 0 additions & 6 deletions Dockerfile

This file was deleted.

14 changes: 7 additions & 7 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Copyright (c) 2016 The Gitea Authors
Copyright (c) 2015 The Gogs Authors
Copyright (c) 2023 The Start9 Labs Authors
MIT License

Copyright (c) 2024 Start9 Labs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
76 changes: 25 additions & 51 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,59 +1,33 @@
PKG_ID := $(shell yq e ".id" manifest.yaml)
PKG_VERSION := $(shell yq e ".version" manifest.yaml)
TS_FILES := $(shell find ./ -name \*.ts)
PACKAGE_ID := gitea

.DELETE_ON_ERROR:
# Phony targets
.PHONY: all clean install

all: verify
# Default target
all: ${PACKAGE_ID}.s9pk

verify: $(PKG_ID).s9pk
@start-sdk verify s9pk $(PKG_ID).s9pk
@echo " Done!"
@echo " Filesize: $(shell du -h $(PKG_ID).s9pk) is ready"
# Build targets
${PACKAGE_ID}.s9pk: $(shell start-cli s9pk list-ingredients)
start-cli s9pk pack

install:
ifeq (,$(wildcard ~/.embassy/config.yaml))
@echo; echo "You must define \"host: http://server-name.local\" in ~/.embassy/config.yaml config file first"; echo
else
start-cli package install $(PKG_ID).s9pk
endif
javascript/index.js: $(shell git ls-files startos) tsconfig.json node_modules package.json
npm run build

arm:
@rm -f docker-images/x86_64.tar
ARCH=aarch64 $(MAKE)
node_modules: package.json package-lock.json
npm ci

x86:
@rm -f docker-images/aarch64.tar
ARCH=x86_64 $(MAKE)
package-lock.json: package.json
npm i

# Clean target
clean:
rm -rf docker-images
rm -f $(PKG_ID).s9pk
rm -f scripts/*.js

scripts/embassy.js: $(TS_FILES)
deno bundle scripts/embassy.ts scripts/embassy.js

docker-images/x86_64.tar: Dockerfile docker_entrypoint.sh
ifeq ($(ARCH),aarch64)
else
mkdir -p docker-images
docker buildx build --tag start9/$(PKG_ID)/main:$(PKG_VERSION) --platform=linux/amd64 -o type=docker,dest=docker-images/x86_64.tar .
endif

docker-images/aarch64.tar: Dockerfile docker_entrypoint.sh
ifeq ($(ARCH),x86_64)
else
mkdir -p docker-images
docker buildx build --tag start9/$(PKG_ID)/main:$(PKG_VERSION) --platform=linux/arm64 -o type=docker,dest=docker-images/aarch64.tar .
endif

$(PKG_ID).s9pk: manifest.yaml instructions.md LICENSE icon.png scripts/embassy.js docker-images/aarch64.tar docker-images/x86_64.tar
ifeq ($(ARCH),aarch64)
@echo "start-sdk: Preparing aarch64 package ..."
else ifeq ($(ARCH),x86_64)
@echo "start-sdk: Preparing x86_64 package ..."
else
@echo "start-sdk: Preparing Universal Package ..."
endif
@start-sdk pack
rm -rf ${PACKAGE_ID}.s9pk
rm -rf javascript
rm -rf node_modules

# Install target
install:
@if [ ! -f ~/.startos/config.yaml ]; then echo "You must define \"host: http://server-name.local\" in ~/.startos/config.yaml config file first."; exit 1; fi
@echo "\nInstalling to $$(grep -v '^#' ~/.startos/config.yaml | cut -d'/' -f3) ...\n"
@[ -f $(PACKAGE_ID).s9pk ] || ( $(MAKE) && echo "\nInstalling to $$(grep -v '^#' ~/.startos/config.yaml | cut -d'/' -f3) ...\n" )
@start-cli package install -s $(PACKAGE_ID).s9pk
67 changes: 3 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,7 @@
<p align="center">
<img src="icon.png" alt="Project Logo" width="21%">
</p>

# Gitea for StartOS

[Gitea](https://github.com/go-gitea/gitea) is a community managed lightweight code hosting solution written in Go.
It is published under the MIT license. This repository creates the `s9pk` package that is installed to run `gitea` on [StartOS](https://github.com/Start9Labs/start-os/).

## Dependencies

Install the system dependencies below to build this project by following the instructions in the provided links. You can find instructions on how to set up the appropriate build environment in the [Developer Docs](https://docs.start9.com/latest/developer-docs/packaging).

- [docker](https://docs.docker.com/get-docker)
- [docker-buildx](https://docs.docker.com/buildx/working-with-buildx/)
- [yq](https://mikefarah.gitbook.io/yq)
- [deno](https://deno.land/#installation)
- [make](https://www.gnu.org/software/make/)
- [start-sdk](https://github.com/Start9Labs/start-os/tree/sdk)

## Cloning

Clone the Gitea package repository locally.

```
git clone git@github.com:Start9Labs/gitea-startos.git
cd gitea-startos
```

## Building

To build the **Gitea** service as a universal package, run the following command:

```
make
```

Alternatively the package can be built for individual architectures by specifying the architecture as follows:

```
make x86
```

or

```
make arm
```

## Installing (on StartOS)

Before installation, define `host: https://server-name.local` in your `~/.embassy/config.yaml` config file then run the following commands to determine successful install:

> :information_source: Change server-name.local to your Start9 server address

```
start-cli auth login
#Enter your StartOS password
make install
```

**Tip:** You can also install the gitea.s9pk by sideloading it under the **StartOS > System > Sideload a Service** section.

## Verify Install
[Gitea](https://github.com/go-gitea/gitea) is a community managed lightweight code hosting solution written in Go. It is published under the MIT license. This repository creates the `s9pk` package that is installed to run Gitea on [StartOS](https://github.com/Start9Labs/start-os/).

Go to your StartOS Services page, select **Gitea**, configure and start the service.
## Building from source

**Done!**
`make`
47 changes: 0 additions & 47 deletions docker_entrypoint.sh

This file was deleted.

107 changes: 0 additions & 107 deletions manifest.yaml

This file was deleted.

Loading