feat: works on production
This commit is contained in:
@@ -94,3 +94,10 @@ DEFAULT_MERGE_STYLE = merge
|
||||
|
||||
[repository.signing]
|
||||
DEFAULT_TRUST_MODEL = committer
|
||||
|
||||
[storage]
|
||||
STORAGE_TYPE = minio
|
||||
MINIO_ENDPOINT = s3.us-east-1.amazonaws.com
|
||||
MINIO_BUCKET = myrica-faya
|
||||
MINIO_USE_SSL = true
|
||||
MINIO_INSECURE_SKIP_VERIFY = false
|
||||
@@ -63,6 +63,8 @@
|
||||
GITEA__server__SSH_DOMAIN: "{{ full_domain.value }}"
|
||||
GITEA__server__DOMAIN: "{{ full_domain.value }}"
|
||||
GITEA__server__ROOT_URL: "https://{{ full_domain.value }}/"
|
||||
GITEA__storage__MINIO_ACCESS_KEY_ID: "{{ minio_access_key }}"
|
||||
GITEA__storage__MINIO_SECRET_ACCESS_KEY: "{{ minio_secret_key }}"
|
||||
labels:
|
||||
docker-volume-backup.stop-during-backup: "true"
|
||||
volumes:
|
||||
|
||||
@@ -11,22 +11,17 @@
|
||||
rebuild: always
|
||||
pull: true
|
||||
|
||||
- name: Make temp file.
|
||||
ansible.builtin.tempfile:
|
||||
suffix: .tar
|
||||
register: tar_file
|
||||
|
||||
- name: Push image to archive.
|
||||
community.docker.docker_image:
|
||||
name: "{{ image_name }}"
|
||||
archive_path: "{{ tar_file.path }}"
|
||||
archive_path: ../dist/image.tar
|
||||
source: local
|
||||
|
||||
- name: Compress archive to artifact.
|
||||
register: compress_image
|
||||
community.general.archive:
|
||||
path: "{{ tar_file.path }}"
|
||||
dest: "{{ tar_file.path }}.xz"
|
||||
path: ../dist/image.tar
|
||||
dest: ../dist/image.tar.xz
|
||||
format: xz
|
||||
mode: "0644"
|
||||
|
||||
@@ -34,7 +29,7 @@
|
||||
amazon.aws.s3_object:
|
||||
bucket: "{{ image_bucket }}"
|
||||
object: "{{ image_key }}"
|
||||
src: "{{ tar_file.path }}.xz"
|
||||
src: ../dist/image.tar.xz
|
||||
mode: put
|
||||
|
||||
region: "{{ aws_region }}"
|
||||
@@ -98,6 +93,8 @@
|
||||
GITEA__server__SSH_DOMAIN: "{{ full_domain.value }}"
|
||||
GITEA__server__DOMAIN: "{{ full_domain.value }}"
|
||||
GITEA__server__ROOT_URL: "https://{{ full_domain.value }}/"
|
||||
GITEA__storage__MINIO_ACCESS_KEY_ID: "{{ minio_access_key }}"
|
||||
GITEA__storage__MINIO_SECRET_ACCESS_KEY: "{{ minio_secret_key }}"
|
||||
labels:
|
||||
docker-volume-backup.stop-during-backup: "true"
|
||||
volumes:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
## Install extras.
|
||||
rpm --rebuilddb
|
||||
amazon-linux-extras install docker ansible2 python3.8 -y
|
||||
|
||||
@@ -10,7 +11,7 @@ systemctl start docker
|
||||
# Set up the correct version of Python (for Ansible).
|
||||
ln -sf /usr/bin/python3.8 /usr/bin/python3
|
||||
ln -sf /usr/bin/pip3.8 /usr/bin/pip3
|
||||
pip3 install botocore boto3 requests packaging
|
||||
pip3 install botocore boto3 requests packaging --user ssm-user
|
||||
python3 -m pip install -U pip
|
||||
|
||||
# Add some swap space.
|
||||
|
||||
@@ -18,7 +18,7 @@ resource "aws_instance" "this" {
|
||||
subnet_id = module.vpc.public_subnets[0]
|
||||
|
||||
user_data = file("install.sh")
|
||||
user_data_replace_on_change = false
|
||||
user_data_replace_on_change = true
|
||||
|
||||
iam_instance_profile = aws_iam_instance_profile.ssm.name
|
||||
vpc_security_group_ids = [aws_security_group.public_access.id]
|
||||
|
||||
Reference in New Issue
Block a user