Skip to content

Commit

Permalink
amazon build
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Przepiorowski committed Feb 9, 2024
1 parent c408d51 commit 86b12bd
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -475,3 +475,62 @@ jobs:
with:
name: osxbuild
path: ${{ env.FILENAME }}



amazon2023:

runs-on: ubuntu-latest
steps:
- name: checkout dxtoolkit code
uses: actions/checkout@master

- name: add version
run: |
mkdir dxtoolkit2
chmod 777 dxtoolkit2
cd ./lib
mv Toolkit_helpers.pm Toolkit_helpers.orig.pm
cat Toolkit_helpers.orig.pm | sed -r -e "s/([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\.?[[:digit:]]?)/\1-dev-${GITHUB_SHA}/" > Toolkit_helpers.pm
grep "version" Toolkit_helpers.pm
- name: Set up a Perl container
#uses: pioro/dxtoolkit@develop
uses: docker://pioro/pioroamazon:2023
with:
ENCKEY: ${{ secrets.ENCKEY }}

- name: Get the version
id: get_version
run: |
if (echo ${GITHUB_REF} | grep "/tags/" > /dev/null); then
SOURCE_TAG=${GITHUB_REF#refs/tags/}
elif (echo ${GITHUB_REF} | grep "/heads/" > /dev/null); then
SOURCE_TAG=${GITHUB_REF#refs/heads/}
else
exit 1
fi
FILENAME="dxtoolkit2-${SOURCE_TAG}-redhat7-installer.tar.gz"
echo SOURCE_TAG=$SOURCE_TAG >> $GITHUB_ENV
echo FILENAME=$FILENAME >> $GITHUB_ENV
- name: add examples
run: |
ls -l
gzip -d dxtoolkit.tar.gz
cp bin/dxtools.conf.example dxtoolkit2/dxtools.conf.example
cp bin/dxusers.csv.example dxtoolkit2/dxusers.csv.example
tar -rvf dxtoolkit.tar dxtoolkit2/dxtools.conf.example dxtoolkit2/dxusers.csv.example
gzip dxtoolkit.tar
- name: compress toolkit
run: |
mv dxtoolkit.tar.gz ${{ env.FILENAME }}
- name: Upload amazon 2023
uses: actions/upload-artifact@v1
with:
name: amazon2023
path: ${{ env.FILENAME }}

48 changes: 48 additions & 0 deletions build/amazon2023/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM amazonlinux:2023

RUN yum install -y perl \
tar \
perl-JSON-PP.noarch \
perl-Date-Manip.noarch \
perl-Net-SSLeay.x86_64 \
git \
perl-JSON-PP.noarch \
perl-JSON.noarch \
perl-LWP-Protocol-https.noarch \
perl-DateTime.x86_64 \
perl-DateTime-Locale.noarch \
perl-ExtUtils-Config.noarch \
perl-ExtUtils-InstallPaths.noarch \
perl-ExtUtils-Helpers.noarch \
perl-Module-Build-Tiny.noarch \
perl-DateTime-Format-DateParse.noarch \
perl-Test-Script.noarch \
perl-HTTP-Server-Simple.noarch \
perl-Log-Log4perl.noarch \
perl-Text-CSV.noarch \
perl-Text-CSV_XS.x86_64 \
perl-PAR-Dist.noarch \
perl-List-MoreUtils.noarch \
perl-List-MoreUtils-XS.x86_64 \
openssl \
openssl-devel

RUN echo | cpan
RUN cpan App::cpanminus

RUN cpanm -f DateTime::Event::Cron::Quartz \
&& cpanm Crypt::[email protected] \
&& cpanm Crypt::Blowfish \
&& cpanm PAR::Packer

RUN cpanm Test::Files
RUN cpanm Filter::Crypto::Decrypt


RUN mkdir -p /github/workspace
RUN mkdir -p /github/home
RUN mkdir -p /github/workflow
COPY entrypoint.sh /entrypoint.sh
WORKDIR /github/workspace

ENTRYPOINT ["/entrypoint.sh"]
43 changes: 43 additions & 0 deletions build/amazon2023/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

export DELPHIX_OUTPUT=/github/workspace/dxtoolkit2
mkdir $DELPHIX_OUTPUT


cd /github/workspace/lib
mv dbutils.pm dbutils.orig.pm
cat dbutils.orig.pm | sed -e "s/put your encryption key here/${INPUT_ENCKEY}/" > dbutils.pm
ls -l dbutils*

cd /github/workspace/bin
pp -u -I /github/workspace/lib -l /usr/lib64/libcrypto.so -l /usr/lib64/libssl.so -M Text::CSV_PP -M List::MoreUtils::PP -M Crypt::Blowfish \
-F Crypto=dbutils\.pm$ -M Filter::Crypto::Decrypt -o $DELPHIX_OUTPUT/runner `ls dx_*.pl | xargs`

cd $DELPHIX_OUTPUT
#for i in /github/workspace/bin/dx_*.pl ; do name=`basename $i .pl`; ln -s runner $name; done

echo #!/bin/bash > install.sh
echo LIST_OF_SCRIPTS=\( >> install.sh

for i in /github/workspace/bin/dx_*.pl ; do
name=`basename $i .pl`;
echo $name >> install.sh
done

echo \) >> install.sh
echo >> install.sh
echo >> install.sh
echo for i in \"\$\{LIST_OF_SCRIPTS\[\@\]\}\" >> install.sh
echo do >> install.sh
echo echo \$i >> install.sh
echo ln -sf runner \$i >> install.sh
echo done >> install.sh

cd /github/workspace
tar czvf /github/workspace/dxtoolkit.tar.gz dxtoolkit2/

echo ${HOME}

cp /github/workspace/dxtoolkit.tar.gz ${HOME}

ls -l ${HOME}

0 comments on commit 86b12bd

Please sign in to comment.