Compare commits

...

9 Commits

Author SHA1 Message Date
Marcus Noble
75fe5da1d8 Remove link to create new issue 2020-12-13 17:24:29 +00:00
68a14fa619 Target arm arch 2020-09-12 13:59:50 +01:00
cf97345a0c Rename dockerfile 2020-09-12 11:42:14 +01:00
8a2944d59b Fix arm build make task 2020-09-12 11:24:17 +01:00
b7c5a18c12 Split out arm dockerfile 2020-09-12 10:17:19 +01:00
da48480ab8 Multi-arch builds 2020-09-11 22:32:36 +01:00
f6a2e8277f Make entrypoint executable 2020-06-07 14:43:15 +01:00
b7db53d93c Merge pull request 'Initial release' (#1) from initial into master 2020-06-07 12:38:03 +00:00
1baba1d841 Initial release
Some checks are pending
Tekton PR Pipeline
CI PR Checks...
2020-06-07 12:50:01 +01:00
5 changed files with 76 additions and 27 deletions

View File

@@ -0,0 +1,18 @@
FROM ubuntu:19.10
RUN apt-get update && apt-get install -y curl ca-certificates
RUN adduser --disabled-password --gecos '' mega && adduser mega sudo && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN curl -k -o /megacmd.deb https://mega.nz/linux/MEGAsync/xUbuntu_19.10/amd64/megacmd-xUbuntu_19.10_amd64.deb
RUN apt install -y ./megacmd.deb
ADD entrypoint.sh /
RUN chmod +x /entrypoint.sh
WORKDIR /home/mega
USER mega
ENV PASSWORD=
ENV EMAIL=
CMD /entrypoint.sh

18
Dockerfile.armhf Normal file
View File

@@ -0,0 +1,18 @@
FROM ubuntu:19.10
RUN apt-get update && apt-get install -y curl ca-certificates
RUN adduser --disabled-password --gecos '' mega && adduser mega sudo && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN curl -k -o /megacmd.deb https://mega.nz/linux/MEGAsync/Raspbian_10.0/armhf/megacmd-Raspbian_10.0_armhf.deb
RUN apt install -y ./megacmd.deb
ADD entrypoint.sh /
RUN chmod +x /entrypoint.sh
WORKDIR /home/mega
USER mega
ENV PASSWORD=
ENV EMAIL=
CMD /entrypoint.sh

View File

@@ -1,6 +1,8 @@
.DEFAULT_GOAL := default
IMAGE ?= docker.cloud.cluster.fun/private/REPO_NAME_LOWER:latest
IMAGE ?= docker.cluster.fun/averagemarcus/megasync:latest
export DOCKER_CLI_EXPERIMENTAL=enabled
.PHONY: test # Run all tests, linting and format checks
test: lint check-format run-tests
@@ -8,58 +10,56 @@ test: lint check-format run-tests
.PHONY: lint # Perform lint checks against code
lint:
@echo "⚠️ 'lint' unimplemented"
# GO Projects
# @go vet && golint -set_exit_status ./...
.PHONY: check-format # Checks code formatting and returns a non-zero exit code if formatting errors found
check-format:
@echo "⚠️ 'check-format' unimplemented"
# GO Projects
# @gofmt -e -l .
.PHONY: format # Performs automatic format fixes on all code
format:
@echo "⚠️ 'format' unimplemented"
# GO Projects
# @gofmt -s -w .
.PHONY: run-tests # Runs all tests
run-tests:
@echo "⚠️ 'run-tests' unimplemented"
# GO Projects
# @go test
# Node Projects
# @npm test
.PHONY: fetch-deps # Fetch all project dependencies
fetch-deps:
@echo "⚠️ 'fetch-deps' unimplemented"
# GO Projects
# @go mod tidy
# Node Projects
# @npm install
.PHONY: build # Build the project
build: lint check-format fetch-deps
@echo "⚠️ 'build' unimplemented"
# GO Projects
# @go build -o PROJECT_NAME main.go
.PHONY: docker-build # Build the docker image
docker-build:
@docker build -t $(IMAGE) .
@docker buildx create --use --name=crossplat --node=crossplat && \
docker buildx build \
--output "type=docker,push=false" \
--tag $(IMAGE) \
.
.PHONY: docker-publish # Push the docker image to the remote registry
docker-publish:
@docker push $(IMAGE)
@docker buildx create --use --name=crossplat --node=crossplat && \
docker buildx build \
--output "type=image,push=true" \
--tag $(IMAGE) \
.
.PHONY: docker-publish-arm # Build and push the armhf image (needs to be built on ARM hardware)
docker-publish-arm:
@docker buildx create --use --name=crossplat --node=crossplat && \
docker buildx build \
--file Dockerfile.armhf \
--platform linux/arm/7 \
--output "type=image,push=true" \
--tag $(IMAGE)-armhf \
.
.PHONY: run # Run the application
run:
@echo "⚠️ 'run' unimplemented"
# GO Projects
# @go run main.go
# Node Projects
# @npm start
.PHONY: ci # Perform CI specific tasks to perform on a pull request
ci:

View File

@@ -1,14 +1,20 @@
# megasync
Run mega-sync as a Docker image
Run [mega-sync](https://mega.nz/sync) as a Docker image
## Features
## Install
* Keeps your MEGASync directory in your Mega account in sync with the `/home/mega` directory in the container
```sh
## Usage
```
docker run -d \
-e EMAIL=YOUR_MEGA_ACCOUNT_EMAIL \
-e PASSWORD=YOUR_MEGA_PASSWORD \
-v /path/to/sync:/home/mega \
docker.cluster.fun/averagemarcus/megasync
```
## Building from source
@@ -26,9 +32,12 @@ make build
## Resources
* [mega-sync](https://mega.nz/sync)
* [MEGAcmd](https://github.com/meganz/MEGAcmd)
## Contributing
If you find a bug or have an idea for a new feature please [raise an issue](/AverageMarcus/megasync/issues/new) to discuss it.
If you find a bug or have an idea for a new feature please raise an issue to discuss it.
Pull requests are welcomed but please try and follow similar code style as the rest of the project and ensure all tests and code checkers are passing.

4
entrypoint.sh Normal file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
mega-login ${EMAIL} ${PASSWORD}
mega-sync ./ /MEGAsync
cat