mirror of https://github.com/Squidex/squidex.git
Browse Source
* add github actions workflows * add marketplace placeholders * minor changes * increment build number * fix yaml * fix build version * make main step uppercase * Update dev.yml * use cache instead of docker hub * load image to docker client * change cache key * minor changes * missing quote * add digitalocean packer * add release version in packer builds * add do secret Co-authored-by: Sebastian Stehle <sebastian@squidex.io>pull/708/head
committed by
GitHub
13 changed files with 324 additions and 58 deletions
@ -0,0 +1,69 @@ |
|||||
|
--- |
||||
|
- name: "Build Squidex Image" |
||||
|
hosts: default |
||||
|
become: true |
||||
|
|
||||
|
tasks: |
||||
|
- name: "Install Requirements" |
||||
|
apt: |
||||
|
name: |
||||
|
- apt-transport-https |
||||
|
- ca-certificates |
||||
|
- curl |
||||
|
- gnupg |
||||
|
- lsb-release |
||||
|
- python3-pip |
||||
|
- python3-setuptools |
||||
|
- software-properties-common |
||||
|
state: latest |
||||
|
update_cache: true |
||||
|
|
||||
|
- name: "Add Docker GPG Key" |
||||
|
apt_key: |
||||
|
url: "https://download.docker.com/linux/ubuntu/gpg" |
||||
|
state: "present" |
||||
|
|
||||
|
- name: "Add Docker Repository" |
||||
|
apt_repository: |
||||
|
repo: "deb https://download.docker.com/linux/ubuntu bionic stable" |
||||
|
state: present |
||||
|
mode: 0644 |
||||
|
|
||||
|
- name: "Install Docker" |
||||
|
apt: |
||||
|
name: |
||||
|
- containerd.io |
||||
|
- docker-ce |
||||
|
- docker-ce-cli |
||||
|
- docker-compose |
||||
|
state: latest |
||||
|
update_cache: true |
||||
|
|
||||
|
- name: "Install Docker Python Package" |
||||
|
pip: |
||||
|
name: |
||||
|
- docker |
||||
|
|
||||
|
- name: "Copy docker-compose.yml" |
||||
|
template: |
||||
|
src: "docker-compose.yml" |
||||
|
dest: "/opt/squidex/" |
||||
|
mode: 0644 |
||||
|
|
||||
|
- name: "Copy setup-squidex.sh" |
||||
|
template: |
||||
|
src: "setup-squidex.sh" |
||||
|
dest: "/opt/squidex/" |
||||
|
mode: 0755 |
||||
|
|
||||
|
- name: "Create /etc/squidex" |
||||
|
file: |
||||
|
path: "/etc/squidex" |
||||
|
state: "directory" |
||||
|
mode: 0755 |
||||
|
|
||||
|
- name: "Create MOTD" |
||||
|
template: |
||||
|
src: "99-squidex" |
||||
|
dest: "/etc/update-motd.d/" |
||||
|
mode: 0755 |
||||
@ -0,0 +1,6 @@ |
|||||
|
#!/bin/bash |
||||
|
echo -e "\033[0m" |
||||
|
echo -e "Welcome to \033[0;36mSquidex\033[0m!" |
||||
|
echo |
||||
|
echo -e "Please run \033[1;32m/opt/squidex/setup-squidex.sh\033[0m to get started." |
||||
|
echo |
||||
@ -0,0 +1,57 @@ |
|||||
|
version: '2.3' |
||||
|
services: |
||||
|
squidex_mongo: |
||||
|
image: mongo |
||||
|
volumes: |
||||
|
- /etc/squidex/mongo/db:/data/db |
||||
|
networks: |
||||
|
- internal |
||||
|
restart: unless-stopped |
||||
|
|
||||
|
squidex_squidex: |
||||
|
image: "squidex/squidex:{{ squidex_version }}" |
||||
|
environment: |
||||
|
- URLS__BASEURL=https://${SQUIDEX_DOMAIN} |
||||
|
- EVENTSTORE__TYPE=MongoDB |
||||
|
- EVENTSTORE__MONGODB__CONFIGURATION=mongodb://squidex_mongo |
||||
|
- STORE__MONGODB__CONFIGURATION=mongodb://squidex_mongo |
||||
|
- IDENTITY__ADMINEMAIL=${SQUIDEX_ADMINEMAIL} |
||||
|
- IDENTITY__ADMINPASSWORD=${SQUIDEX_ADMINPASSWORD} |
||||
|
- IDENTITY__GOOGLECLIENT=${SQUIDEX_GOOGLECLIENT} |
||||
|
- IDENTITY__GOOGLESECRET=${SQUIDEX_GOOGLESECRET} |
||||
|
- IDENTITY__GITHUBCLIENT=${SQUIDEX_GITHUBCLIENT} |
||||
|
- IDENTITY__GITHUBSECRET=${SQUIDEX_GITHUBSECRET} |
||||
|
- IDENTITY__MICROSOFTCLIENT=${SQUIDEX_MICROSOFTCLIENT} |
||||
|
- IDENTITY__MICROSOFTSECRET=${SQUIDEX_MICROSOFTSECRET} |
||||
|
- ASPNETCORE_URLS=http://+:5000 |
||||
|
healthcheck: |
||||
|
test: ["CMD", "curl", "-f", "http://localhost:5000/healthz"] |
||||
|
start_period: 60s |
||||
|
depends_on: |
||||
|
- squidex_mongo |
||||
|
volumes: |
||||
|
- /etc/squidex/assets:/app/Assets |
||||
|
networks: |
||||
|
- internal |
||||
|
restart: unless-stopped |
||||
|
|
||||
|
squidex_proxy: |
||||
|
image: squidex/caddy-proxy |
||||
|
ports: |
||||
|
- "80:80" |
||||
|
- "443:443" |
||||
|
environment: |
||||
|
- SITE_ADDRESS=${SQUIDEX_DOMAIN} |
||||
|
- SITE_SERVER="squidex_squidex:5000" |
||||
|
volumes: |
||||
|
- /etc/squidex/caddy/data:/data |
||||
|
- /etc/squidex/caddy/config:/config |
||||
|
depends_on: |
||||
|
- squidex_squidex |
||||
|
networks: |
||||
|
- internal |
||||
|
restart: unless-stopped |
||||
|
|
||||
|
networks: |
||||
|
internal: |
||||
|
driver: bridge |
||||
@ -0,0 +1,66 @@ |
|||||
|
#!/bin/bash |
||||
|
set -e |
||||
|
|
||||
|
cd /opt/squidex |
||||
|
|
||||
|
# Prompt user to enter config. |
||||
|
|
||||
|
echo "> This script will setup a basic configuration of Squidex" |
||||
|
echo "> using docker-compose that is suitable for the most use cases." |
||||
|
echo "> Please go to https://docs.squidex.io for advanced configuration." |
||||
|
echo |
||||
|
echo "> Please enter the host name. You need a public DNS entry," |
||||
|
echo "> because Squidex will get a certificate using lets encrypt." |
||||
|
echo |
||||
|
|
||||
|
read -p "Enter Host Name (required): " hostName |
||||
|
while [ -z "$hostName" ]; do |
||||
|
read -p "Enter Host Name (required): " hostName |
||||
|
done |
||||
|
|
||||
|
echo |
||||
|
echo "> You can also configure external authentication providers if you want." |
||||
|
echo "> If no external provider is configured you can later setup an account." |
||||
|
echo |
||||
|
|
||||
|
read -p "Enter Google Client ID (optional): " googleClientId |
||||
|
read -p "Enter Google Client Secret (optional): " googleSecret |
||||
|
|
||||
|
read -p "Enter Github Client ID (optional): " githubClientId |
||||
|
read -p "Enter Github Client Secret (optional): " githubSecret |
||||
|
|
||||
|
read -p "Enter Microsoft Client ID (optional): " microsoftClientId |
||||
|
read -p "Enter Microsoft Client Secret (optional)": microsoftSecret |
||||
|
|
||||
|
echo |
||||
|
echo "SUMMARY" |
||||
|
|
||||
|
echo "Hostname: $hostName" |
||||
|
echo "Google Client ID: $googleClientId" |
||||
|
echo "Google Client Secret: $googleSecret" |
||||
|
echo "Github Client ID: $githubClientId" |
||||
|
echo "Github Client Secret: $githubSecret" |
||||
|
echo "Microsoft Client ID: $microsoftClientId" |
||||
|
echo "Microsoft Client Secret: $microsoftSecret" |
||||
|
|
||||
|
envFile=".env" |
||||
|
|
||||
|
[ -f $envFile ] && rm $envFile |
||||
|
|
||||
|
echo "SQUIDEX_DOMAIN=$hostName" >> $envFile |
||||
|
echo "SQUIDEX_ADMINEMAIL=" >> $envFile |
||||
|
echo "SQUIDEX_ADMINPASSWORD=" >> $envFile |
||||
|
echo "SQUIDEX_GOOGLECLIENT=$googleClientId" >> $envFile |
||||
|
echo "SQUIDEX_GOOGLESECRET=$googleSecret" >> $envFile |
||||
|
echo "SQUIDEX_GITHUBCLIENT=$githubClientId" >> $envFile |
||||
|
echo "SQUIDEX_GITHUBSECRET=$githubSecret" >> $envFile |
||||
|
echo "SQUIDEX_MICROSOFTCLIENT=$microsoftClientId" >> $envFile |
||||
|
echo "SQUIDEX_MICROSOFTSECRET=$microsoftSecret" >> $envFile |
||||
|
echo "UI__ONLYADMINSCANCREATEAPPS=true" >> $envFile |
||||
|
|
||||
|
echo |
||||
|
echo "Waiting 10 seconds. You may press Ctrl+C now to abort this script." |
||||
|
|
||||
|
( set -x; sleep 10 ) |
||||
|
|
||||
|
docker-compose up -d |
||||
@ -0,0 +1,45 @@ |
|||||
|
variable "squidex_version" { |
||||
|
type = string |
||||
|
default = "5.7.0" |
||||
|
} |
||||
|
|
||||
|
source "digitalocean" "do" { |
||||
|
image = "ubuntu-20-04-x64" |
||||
|
region = "sfo3" |
||||
|
droplet_name = "squidex-${replace(var.squidex_version, ".", "-")}-build-{{ timestamp }}" |
||||
|
snapshot_name = "squidex-${replace(var.squidex_version, ".", "-")}" |
||||
|
snapshot_regions = [ |
||||
|
"nyc1", |
||||
|
"sfo1", |
||||
|
"nyc2", |
||||
|
"ams2", |
||||
|
"sgp1", |
||||
|
"lon1", |
||||
|
"nyc3", |
||||
|
"ams3", |
||||
|
"fra1", |
||||
|
"tor1", |
||||
|
"sfo2", |
||||
|
"blr1", |
||||
|
"sfo3", |
||||
|
] |
||||
|
size = "s-2vcpu-2gb" |
||||
|
ssh_username = "root" |
||||
|
} |
||||
|
|
||||
|
build { |
||||
|
sources = [ |
||||
|
"source.digitalocean.do" |
||||
|
] |
||||
|
|
||||
|
provisioner "ansible" { |
||||
|
ansible_env_vars = [ |
||||
|
"ANSIBLE_HOST_KEY_CHECKING=False", |
||||
|
"ANSIBLE_SSH_ARGS='-F /dev/null -o ForwardAgent=no -o ControlMaster=auto -o ControlPersist=60s'", |
||||
|
"ANSIBLE_NOCOLOR=True" |
||||
|
] |
||||
|
extra_arguments = ["--extra-vars", "squidex_version=${var.squidex_version}"] |
||||
|
playbook_file = "./ansible/playbook.yml" |
||||
|
use_proxy = false |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue